Bug 605127 - Autoscroll stops unintentionally while page is scrolling, r=neil, a=blocking
authorOlli Pettay <Olli.Pettay@helsinki.fi>
Wed, 29 Dec 2010 10:14:12 +0200
changeset 59724 759b0cf2e6ebef2bf527aae47ede4fbdde00ddc4
parent 59723 250bf984b8bcd8013a4e40f8f0dff09d4519ab32
child 59725 fc1ca73d597894fe3067cb013c9257119f54c1b4
push id17756
push useropettay@mozilla.com
push dateWed, 29 Dec 2010 08:31:22 +0000
treeherdermozilla-central@759b0cf2e6eb [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersneil, blocking
bugs605127
milestone2.0b9pre
first release with
nightly linux32
759b0cf2e6eb / 4.0b9pre / 20101229030346 / files
nightly linux64
759b0cf2e6eb / 4.0b9pre / 20101229030346 / files
nightly mac
759b0cf2e6eb / 4.0b9pre / 20101229030346 / files
nightly win32
759b0cf2e6eb / 4.0b9pre / 20101229030346 / files
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
releases
nightly linux32
nightly linux64
nightly mac
nightly win32
Bug 605127 - Autoscroll stops unintentionally while page is scrolling, r=neil, a=blocking
toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
toolkit/content/widgets/browser.xml
--- a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
+++ b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
@@ -45,16 +45,23 @@ function test()
       ok((scrollHori && elem.scrollLeft > 0) ||
          (!scrollHori && elem.scrollLeft == 0),
          test.elem+' should'+(scrollHori ? '' : ' not')+' have scrolled horizontally');
       window.removeEventListener("MozAfterPaint", checkScroll, false);
       nextTest();
     };
     EventUtils.synthesizeMouse(elem, 50, 50, { button: 1 },
                                gBrowser.contentWindow);
+
+    var iframe = gBrowser.contentDocument.getElementById("iframe");
+    var e = iframe.contentDocument.createEvent("pagetransition");
+    e.initPageTransitionEvent("pagehide", true, true, false);
+    iframe.contentDocument.dispatchEvent(e);
+    iframe.contentDocument.documentElement.dispatchEvent(e);
+
     EventUtils.synthesizeMouse(elem, 100, 100,
                                { type: "mousemove", clickCount: "0" },
                                gBrowser.contentWindow);
     window.addEventListener("MozAfterPaint", checkScroll, false);
     /*
      * if scrolling didn’t work, we wouldn’t do any redraws and thus time out.
      * so request and force redraws to get the chance to check for scrolling at
      * all.
@@ -72,16 +79,17 @@ function test()
     <select id="e" style="width: 100px; height: 100px;" multiple="multiple"><option>aaaaaaaaaaaaaaaaaaaaaaaa</option><option>a</option><option>a</option>\
     <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option>\
     <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option></select>\
     <select id="f" style="width: 100px; height: 100px;"><option>a</option><option>aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa</option><option>a</option>\
     <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option>\
     <option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option><option>a</option></select>\
     <div id="g" style="width: 99px; height: 99px; padding: 10px; border: 10px solid black; margin: 10px; overflow: auto;"><div style="width: 100px; height: 100px;"></div></div>\
     <div id="h" style="width: 100px; height: 100px; overflow: -moz-hidden-unscrollable;"><div style="width: 200px; height: 200px;"></div></div>\
+    <iframe id="iframe" style="display: none;"></iframe>\
     </body>';
   gBrowser.selectedBrowser.addEventListener("pageshow", onLoad, false);
   gBrowser.loadURI(dataUri);
 
   function onLoad() {
     gBrowser.selectedBrowser.removeEventListener("pageshow", onLoad, false);
     waitForFocus(onFocus, content);
   }
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -499,18 +499,24 @@
             if (this.feeds && aEvent.target == this.contentDocument)
               this.feeds = null;
             if (!this.docShell || !this.fastFind)
               return;
             var tabBrowser = this.getTabBrowser();
             if (!tabBrowser || tabBrowser.mCurrentBrowser == this)
               this.fastFind.setDocShell(this.docShell);
 
-            if (this._scrollable)
-              this._autoScrollPopup.hidePopup();
+            
+            if (this._scrollable) {
+              var doc =
+                this._scrollable.ownerDocument || this._scrollable.document;
+              if (doc == aEvent.target) {
+                this._autoScrollPopup.hidePopup();
+              }
+            }
          ]]>
         </body>
       </method>
 
       <method name="updatePageReport">
         <body>
           <![CDATA[
             var event = document.createEvent("Events");