Bug 979051 - Avoid browser.xml handling pageshow/pagehide events for remote frames. r=felipe.

This commit is contained in:
Mark Hammond 2014-04-02 10:53:54 +11:00
parent 146211b798
commit 1d3d268554

View File

@ -759,8 +759,12 @@
} }
// Listen for first load for lazy attachment to form fill controller // Listen for first load for lazy attachment to form fill controller
this.addEventListener("pageshow", this.onPageShow, true); // (But we don't want to do this for remote browsers - the test infra
this.addEventListener("pagehide", this.onPageHide, true); // might fire these events when they normally wouldn't.)
if (!this.isRemoteBrowser) {
this.addEventListener("pageshow", this.onPageShow, true);
this.addEventListener("pagehide", this.onPageHide, true);
}
if (this.messageManager) { if (this.messageManager) {
this.messageManager.addMessageListener("PopupBlocking:UpdateBlockedPopups", this); this.messageManager.addMessageListener("PopupBlocking:UpdateBlockedPopups", this);
@ -806,8 +810,10 @@
this.lastURI = null; this.lastURI = null;
this.removeEventListener("pageshow", this.onPageShow, true); if (!this.isRemoteBrowser) {
this.removeEventListener("pagehide", this.onPageHide, true); this.removeEventListener("pageshow", this.onPageShow, true);
this.removeEventListener("pagehide", this.onPageHide, true);
}
if (this._autoScrollNeedsCleanup) { if (this._autoScrollNeedsCleanup) {
// we polluted the global scope, so clean it up // we polluted the global scope, so clean it up