Bug 937407 Only add the popuphidden event listener if we are actully opening the popup r=gavin
authorNeil Rashbrook <neil@parkwaycc.co.uk>
Fri, 14 Mar 2014 01:41:54 +0000
changeset 173515 17a33bb88521b4c62a25d871ddd567c3c969f9da
parent 173514 c261d5623b088c0116f43f8f8ab7d20d53fec50e
child 173516 d42a36615c7e4ff3225c44e37c99f3c65bb14184
push id26407
push usercbook@mozilla.com
push dateFri, 14 Mar 2014 11:34:21 +0000
treeherdermozilla-central@0a5ec8ab99a2 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersgavin
bugs937407
milestone30.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
Bug 937407 Only add the popuphidden event listener if we are actully opening the popup r=gavin
toolkit/content/widgets/browser.xml
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -920,18 +920,16 @@
               else {
                 // we weren't provided a popup; we have to use the global scope
                 this._autoScrollPopup = this._createAutoScrollPopup();
                 document.documentElement.appendChild(this._autoScrollPopup);
                 this._autoScrollNeedsCleanup = true;
               }
             }
 
-            this._autoScrollPopup.addEventListener("popuphidden", this, true);
-
             // we need these attributes so themers don't need to create per-platform packages
             if (screen.colorDepth > 8) { // need high color for transparency
               // Exclude second-rate platforms
               this._autoScrollPopup.setAttribute("transparent", !/BeOS|OS\/2/.test(navigator.appVersion));
               // Enable translucency on Windows and Mac
               this._autoScrollPopup.setAttribute("translucent", /Win|Mac/.test(navigator.platform));
             }
 
@@ -986,16 +984,17 @@
                 this._autoScrollPopup.setAttribute("scrolldir", "NS");
               }
               else {
                 this._scrollable = null; // abort scrolling
                 return;
               }
             }
 
+            this._autoScrollPopup.addEventListener("popuphidden", this, true);
             this._autoScrollPopup.showPopup(document.documentElement,
                                             event.screenX,
                                             event.screenY,
                                             "popup", null, null);
             this._ignoreMouseEvents = true;
             this._startX = event.screenX;
             this._startY = event.screenY;
             this._screenX = event.screenX;