From 4db270f6c80f0d5e75175b785e21189bb5e68deb Mon Sep 17 00:00:00 2001 From: Boris Zbarsky Date: Thu, 1 Dec 2011 03:51:22 +0000 Subject: [PATCH] Bug 706323. Fix scrollbar smoothscrolling to get the timestamp the new way. r=dao --- toolkit/content/widgets/scrollbox.xml | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/toolkit/content/widgets/scrollbox.xml b/toolkit/content/widgets/scrollbox.xml index c4c0e86ccd11..5530ed1ad2db 100644 --- a/toolkit/content/widgets/scrollbox.xml +++ b/toolkit/content/widgets/scrollbox.xml @@ -287,12 +287,12 @@ stop: function scrollAnim_stop() { this.started = false; }, - sample: function scrollAnim_handleEvent(event) { + sample: function scrollAnim_handleEvent(timeStamp) { if (!this.started) { // We've been stopped return; } - const timePassed = event.timeStamp - this.startTime; + const timePassed = timeStamp - this.startTime; const pos = timePassed >= this.duration ? 1 : 1 - Math.pow(1 - timePassed / this.duration, 4); @@ -656,14 +656,14 @@ stop: function arrowSmoothScroll_stop() { this.started = false; }, - sample: function arrowSmoothScroll_handleEvent(event) { + sample: function arrowSmoothScroll_handleEvent(timeStamp) { if (!this.started) { // We've been stopped return; } const scrollIndex = this.scrollbox._scrollIndex; - const timePassed = event.timeStamp - this.lastFrameTime; - this.lastFrameTime = event.timeStamp; + const timePassed = timeStamp - this.lastFrameTime; + this.lastFrameTime = timeStamp; const scrollDelta = 0.5 * timePassed * scrollIndex; this.scrollbox.scrollPosition += scrollDelta;