author | Jim Chen <nchen@mozilla.com> |
Tue, 21 Aug 2018 15:23:28 -0400 | |
changeset 487735 | 05566ea3c85ecb2293d477dd13558116e7800c71 |
parent 487734 | 20a3dacdf9b898432d0eecd5340a74b34aeb5255 |
child 487736 | 5f44c144b1e52f8f3fa26f837eeea0d7c0f88f60 |
push id | 9719 |
push user | ffxbld-merge |
push date | Fri, 24 Aug 2018 17:49:46 +0000 |
treeherder | mozilla-beta@719ec98fba77 [default view] [failures only] |
perfherder | [talos] [build metrics] [platform microbench] (compared to previous push) |
reviewers | droeh |
bugs | 1330257 |
milestone | 63.0a1 |
first release with | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
last release without | nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
|
--- a/mobile/android/chrome/geckoview/GeckoViewContent.js +++ b/mobile/android/chrome/geckoview/GeckoViewContent.js @@ -174,18 +174,30 @@ class GeckoViewContent extends GeckoView break; case "GeckoView:RestoreState": this._savedState = JSON.parse(aMsg.data.state); if (this._savedState.history) { let restoredHistory = SessionHistory.restore(docShell, this._savedState.history); - addEventListener("load", this, {capture: true, mozSystemGroup: true, once: true}); - addEventListener("pageshow", this, {capture: true, mozSystemGroup: true, once: true}); + addEventListener("load", _ => { + const formdata = this._savedState.formdata; + if (formdata) { + FormData.restoreTree(content, formdata); + } + }, {capture: true, mozSystemGroup: true, once: true}); + + addEventListener("pageshow", _ => { + const scrolldata = this._savedState.scrolldata; + if (scrolldata) { + ScrollPosition.restoreTree(content, scrolldata); + } + delete this._savedState; + }, {capture: true, mozSystemGroup: true, once: true}); if (!this.progressFilter) { this.progressFilter = Cc["@mozilla.org/appshell/component/browser-status-filter;1"] .createInstance(Ci.nsIWebProgress); this.flags = Ci.nsIWebProgress.NOTIFY_LOCATION; } @@ -264,31 +276,16 @@ class GeckoViewContent extends GeckoView return; } aEvent.preventDefault(); this.eventDispatcher.sendRequest({ type: "GeckoView:DOMWindowClose" }); break; - case "load": { - const formdata = this._savedState.formdata; - if (formdata) { - FormData.restoreTree(content, formdata); - } - break; - } - case "pageshow": { - const scrolldata = this._savedState.scrolldata; - if (scrolldata) { - ScrollPosition.restoreTree(content, scrolldata); - } - delete this._savedState; - break; - } } } // WebProgress event handler. onLocationChange(aWebProgress, aRequest, aLocationURI, aFlags) { debug `onLocationChange`; if (this._savedState) {