From 20b9f85629d9b5f9d696b3728eff401dbba5cba8 Mon Sep 17 00:00:00 2001 From: Arpad Borsos Date: Wed, 18 Aug 2010 19:57:31 +0200 Subject: [PATCH] Bug 588435 - Use mozRequestAnimationFrame to animate autoscroll; r=neil@parkwaycc.co.uk a=dtownsend --- toolkit/content/widgets/browser.xml | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/toolkit/content/widgets/browser.xml b/toolkit/content/widgets/browser.xml index cc195574265..b51a9073d98 100644 --- a/toolkit/content/widgets/browser.xml +++ b/toolkit/content/widgets/browser.xml @@ -738,11 +738,9 @@ ]]> - - 3 + 10 null - null null null null @@ -762,7 +760,7 @@ window.removeEventListener("keydown", this, true); window.removeEventListener("keypress", this, true); window.removeEventListener("keyup", this, true); - clearInterval(this._autoScrollTimer); + window.removeEventListener("MozBeforePaint", this, true); } ]]> @@ -875,6 +873,8 @@ this._startY = event.screenY; this._screenX = event.screenX; this._screenY = event.screenY; + this._scrollErrorX = 0; + this._scrollErrorY = 0; window.addEventListener("mousemove", this, true); window.addEventListener("mousedown", this, true); @@ -883,12 +883,9 @@ window.addEventListener("keydown", this, true); window.addEventListener("keypress", this, true); window.addEventListener("keyup", this, true); + window.addEventListener("MozBeforePaint", this, true); - this._scrollErrorX = 0; - this._scrollErrorY = 0; - - this._autoScrollTimer = setInterval(function(self) { self.autoScrollLoop(); }, - 20, this); + window.mozRequestAnimationFrame(); ]]> @@ -909,7 +906,7 @@ 1) @@ -948,6 +945,7 @@ this._scrollable.scrollLeft += actualScrollX; this._scrollable.scrollTop += actualScrollY; } + window.mozRequestAnimationFrame(); ]]> @@ -994,6 +992,9 @@