Backed out changeset 72c1f97df4c6
authorDão Gottwald <dao@mozilla.com>
Fri, 28 Aug 2009 20:45:38 +0200
changeset 32065 1e5262ff9eff7793dc807ef5de0a438989c34a21
parent 32057 72c1f97df4c6e5c8857d97e004ab7168ef15f399
child 32066 676aee55294c26ad50ebf7faf25f2747922cb337
push idunknown
push userunknown
push dateunknown
milestone1.9.3a1pre
backs out72c1f97df4c6e5c8857d97e004ab7168ef15f399
Backed out changeset 72c1f97df4c6
toolkit/content/tests/browser/Makefile.in
toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
toolkit/content/widgets/browser.xml
--- a/toolkit/content/tests/browser/Makefile.in
+++ b/toolkit/content/tests/browser/Makefile.in
@@ -45,23 +45,20 @@ include $(DEPTH)/config/autoconf.mk
 
 DIRS = \
   common \
   data \
   $(NULL)
 
 include $(topsrcdir)/config/rules.mk
 
-_BROWSER_TEST_FILES = \
+_BROWSER_FILES = \
   browser_bug471962.js \
   $(NULL)
 
 # browser_keyevents_during_autoscrolling.js cannot start the autoscrolling by
 # synthesizeMouse with middle button on linux, therefore, disable it temporarily
 ifneq ($(MOZ_WIDGET_TOOLKIT),gtk2)
-_BROWSER_TEST_FILES += \
-  browser_keyevents_during_autoscrolling.js \
-  browser_bug295977_autoscroll_overflow.js \
-  $(NULL)
+_BROWSER_FILES += browser_keyevents_during_autoscrolling.js
 endif
 
-libs:: $(_BROWSER_TEST_FILES)
+libs:: $(_BROWSER_FILES)
 	$(INSTALL) $(foreach f,$^,"$f") $(DEPTH)/_tests/testing/mochitest/browser/$(relativesrcdir)
deleted file mode 100644
--- a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js
+++ /dev/null
@@ -1,88 +0,0 @@
-function test()
-{
-  const kPrefName_AutoScroll = "general.autoScroll";
-  var prefSvc = Components.classes["@mozilla.org/preferences-service;1"]
-                          .getService(Components.interfaces.nsIPrefBranch2);
-  var kAutoScrollingEnabled = prefSvc.getBoolPref(kPrefName_AutoScroll);
-  prefSvc.setBoolPref(kPrefName_AutoScroll, true);
-
-  const expectScrollNone = 0;
-  const expectScrollVert = 1;
-  const expectScrollHori = 2;
-  const expectScrollBoth = 3;
-
-  var allTests = [
-    {elem: 'a', expected: expectScrollNone},
-    {elem: 'b', expected: expectScrollBoth},
-    {elem: 'c', expected: expectScrollHori},
-    {elem: 'd', expected: expectScrollVert},
-    {elem: 'e', expected: expectScrollVert},
-    {elem: 'f', expected: expectScrollNone}
-  ];
-
-  var doc;
-
-  function nextTest() {
-    var test = allTests.shift();
-    if(!test) {
-      endTest();
-      return;
-    }
-    var elem = doc.getElementById(test.elem);
-    EventUtils.synthesizeMouse(elem, 10, 10, { button: 1 },
-                               gBrowser.contentWindow);
-    EventUtils.synthesizeMouse(elem, 80, 80,
-                               { type: "mousemove", clickCount: "0" },
-                               gBrowser.contentWindow);
-    // the autoscroll implementation uses a 20ms interval
-    // wait for 40ms to make sure it did autoscroll at least once
-    setTimeout(function () {
-      EventUtils.synthesizeKey("VK_ESCAPE", {}, gBrowser.contentWindow);
-      var scrollVert = test.expected & expectScrollVert;
-      ok((scrollVert && elem.scrollTop > 0) ||
-         (!scrollVert && elem.scrollTop == 0),
-         test.elem+' should'+(scrollVert ? '' : ' not')+' have scrolled vertically');
-      var scrollHori = test.expected & expectScrollHori;
-      ok((scrollHori && elem.scrollLeft > 0) ||
-         (!scrollHori && elem.scrollLeft == 0),
-         test.elem+' should'+(scrollHori ? '' : ' not')+' have scrolled horizontally');
-      nextTest();
-    }, 40);
-  }
-
-  function startTest() {
-    waitForExplicitFinish();
-    gBrowser.addEventListener("load", onLoad, false);
-    var dataUri = 'data:text/html,<body>\
-    <div id="a" style="width: 100px; height: 100px; overflow: hidden;"><div style="width: 200px; height: 200px;"></div></div>\
-    <div id="b" style="width: 100px; height: 100px; overflow: auto;"><div style="width: 200px; height: 200px;"></div></div>\
-    <div id="c" style="width: 100px; height: 100px; overflow-x: auto; overflow-y: hidden;"><div style="width: 200px; height: 200px;"></div></div>\
-    <div id="d" style="width: 100px; height: 100px; overflow-y: auto; overflow-x: hidden;"><div style="width: 200px; height: 200px;"></div></div>\
-    <select id="e" style="width: 100px; height: 100px;" multiple="multiple"><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><option>a</option></select>\
-    <select id="f" style="width: 100px; height: 100px;"><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><option>a</option></select>\
-    </body>';
-    gBrowser.loadURI(dataUri);
-  }
-
-  function onLoad() {
-    gBrowser.removeEventListener("load", onLoad, false);
-    gBrowser.contentWindow.focus();
-    doc = gBrowser.contentDocument;
-    nextTest();
-  }
-
-  function endTest() {
-    // restore the changed prefs
-    prefSvc.setBoolPref(kPrefName_AutoScroll, kAutoScrollingEnabled);
-    // cleaning-up
-    gBrowser.loadURI("about:blank");
-
-    finish();
-  }
-
-  startTest();
-}
--- a/toolkit/content/widgets/browser.xml
+++ b/toolkit/content/widgets/browser.xml
@@ -806,20 +806,18 @@
             }
 
             // go upward in the DOM and find any parent element that has a overflow
             // area and can therefore be scrolled
             for (this._scrollable = event.originalTarget; this._scrollable;
                  this._scrollable = this._scrollable.parentNode) {
               // do not use overflow based autoscroll for <html> Elements
               // or non-html elements such as svg or Document nodes
-              // also make sure to skip select elements that are not multiline
               if (!(this._scrollable instanceof HTMLElement) ||
-                  (this._scrollable instanceof HTMLHtmlElement) ||
-                  ((this._scrollable instanceof HTMLSelectElement) && !this._scrollable.multiple)) {
+                  (this._scrollable instanceof HTMLHtmlElement)) {
                 continue;
               }
 
               var overflowx = this._scrollable.ownerDocument.defaultView
                                   .getComputedStyle(this._scrollable, '')
                                   .getPropertyValue('overflow-x');
               var overflowy = this._scrollable.ownerDocument.defaultView
                                   .getComputedStyle(this._scrollable, '')