mirror of
https://github.com/servo/servo.git
synced 2025-06-20 23:28:59 +01:00
Add history information to mozbrowserlocationchange event This is a change in the Browser API itself. Before, on `mozbrowserlocationchange`, we would call `getCanGoBack()` and `getCanGoForward()`. Two asynchronous methods called on an event, which doesn't make much sense, especially because we already know on `mozbrowserlocationchange` if we can go back/forward. So here I'm adding 2 new properties to the event to tell if the iframe can go back/forward. The way `event.detail` is defined also changed. Before, `event.detail` was a string (the new uri), now it's an object (`{uri:String,canGoBack:bool,canGoForward:bool}`). This is one of the design flaw of the early Browser API: not using objects for the detail property, making it hard to extend the event payload. So that makes this event not backward compatible. We can: 1. just don't care. It's up to the client to test if event.detail is a string or not if it needs to be compatible with Gecko 2. fix it in Gecko. The client will still have to test `event.detail` to make it compatible with older version of gecko 3. rename `mozbrowserlocationchange` to something else (`mozbrowserlocationchange2` ?) Please advise. <!-- Reviewable:start --> --- This change is [<img src="https://reviewable.io/review_button.svg" height="35" align="absmiddle" alt="Reviewable"/>](https://reviewable.io/reviews/servo/servo/10100) <!-- Reviewable:end --> |
||
---|---|---|
.. | ||
docs | ||
dom | ||
parse | ||
task_source | ||
build.rs | ||
Cargo.toml | ||
clipboard_provider.rs | ||
cors.rs | ||
devtools.rs | ||
document_loader.rs | ||
layout_interface.rs | ||
lib.rs | ||
makefile.cargo | ||
mem.rs | ||
network_listener.rs | ||
page.rs | ||
reporter.rs | ||
script_thread.rs | ||
textinput.rs | ||
timers.rs | ||
unpremultiplytable.rs | ||
webdriver_handlers.rs |