Read-only Git mirror of the Mercurial gecko repositories at https://hg.mozilla.org. How to contribute: https://firefox-source-docs.mozilla.org/contributing/contribution_quickref.html
Go to file
Paul Rouget b19e374949 servo: Merge #10100 - Add history information to mozbrowserlocationchange event (from paulrouget:historyOnLocationChange); r=paulrouget
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.

Source-Repo: https://github.com/servo/servo
Source-Revision: db63aa423fcfc87e47d9250680737ef11d2c3d26
2016-03-22 07:22:19 +05:01
servo servo: Merge #10100 - Add history information to mozbrowserlocationchange event (from paulrouget:historyOnLocationChange); r=paulrouget 2016-03-22 07:22:19 +05:01