From cd50e2b550227d98d0e890c5852672ecacd5d0ec Mon Sep 17 00:00:00 2001 From: Dave Townsend Date: Sun, 7 Nov 2010 18:35:16 -0800 Subject: [PATCH] Backing out changeset e3ce3780f870 from bug 588435 which landed without approval. a=backout --- .../browser_bug295977_autoscroll_overflow.js | 35 +++++-------------- toolkit/content/widgets/browser.xml | 34 ++++++------------ 2 files changed, 20 insertions(+), 49 deletions(-) diff --git a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js index 83edb454fc59..fe33b15929ac 100644 --- a/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js +++ b/toolkit/content/tests/browser/browser_bug295977_autoscroll_overflow.js @@ -29,13 +29,14 @@ function test() } var elem = doc.getElementById(test.elem); - // skip a few frames before checking the tests - var skipFrames = 3; - var checkScroll = function () { - if (skipFrames--) { - window.mozRequestAnimationFrame(); - return; - } + EventUtils.synthesizeMouse(elem, 50, 50, { button: 1 }, + gBrowser.contentWindow); + EventUtils.synthesizeMouse(elem, 100, 100, + { 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) || @@ -45,26 +46,12 @@ 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); - 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. - */ - window.mozRequestAnimationFrame(); + }, 40); } waitForExplicitFinish(); var dataUri = 'data:text/html,\ -
\
\
\
\ @@ -88,10 +75,6 @@ function test() function onFocus() { doc = gBrowser.contentDocument; - // force redraws, so we actually get AfterPaint events - window.addEventListener("MozBeforePaint", function(ev) { - doc.getElementById("forceredraw").style.left = ev.timeStamp % 100; - }, false); nextTest(); } diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index 44ce3553bd76..40c903c5aefa 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -738,14 +738,15 @@ ]]> - + + 3 10 null + null null null null null - null null false @@ -761,7 +762,7 @@ window.removeEventListener("keydown", this, true); window.removeEventListener("keypress", this, true); window.removeEventListener("keyup", this, true); - window.removeEventListener("MozBeforePaint", this, true); + clearInterval(this._autoScrollTimer); } ]]> @@ -874,9 +875,6 @@ this._startY = event.screenY; this._screenX = event.screenX; this._screenY = event.screenY; - this._scrollErrorX = 0; - this._scrollErrorY = 0; - this._lastFrame = window.mozAnimationStartTime; window.addEventListener("mousemove", this, true); window.addEventListener("mousedown", this, true); @@ -885,9 +883,12 @@ window.addEventListener("keydown", this, true); window.addEventListener("keypress", this, true); window.addEventListener("keyup", this, true); - window.addEventListener("MozBeforePaint", this, true); - window.mozRequestAnimationFrame(); + this._scrollErrorX = 0; + this._scrollErrorY = 0; + + this._autoScrollTimer = setInterval(function(self) { self.autoScrollLoop(); }, + 20, this); ]]> @@ -921,30 +922,21 @@ - @@ -1003,9 +994,6 @@