From 265d540422fb5820b2e36f96027f331a84c1e92e Mon Sep 17 00:00:00 2001 From: Mike Conley Date: Wed, 8 Nov 2017 17:05:06 -0500 Subject: [PATCH] Bug 1403563 - Allow multiple wheel events to accelerate scrollbox scrolling. r=dao MozReview-Commit-ID: Lo7HxK6TGwd --HG-- extra : rebase_source : 342735b8c6d8fcd9de49ce2a713972082cab68e7 --- toolkit/content/widgets/scrollbox.xml | 30 +++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/toolkit/content/widgets/scrollbox.xml b/toolkit/content/widgets/scrollbox.xml index 55249e50840b..f11b5fdee1d0 100644 --- a/toolkit/content/widgets/scrollbox.xml +++ b/toolkit/content/widgets/scrollbox.xml @@ -150,6 +150,14 @@ ]]> + + + + @@ -404,6 +412,10 @@ }); ]]> + + false + 0 + 0 @@ -450,6 +462,17 @@ } if (doScroll) { + let direction = scrollAmount < 0 ? -1 : 1; + let startPos = this.scrollPosition; + + if (!this._isScrolling || this._direction != direction) { + this._destination = startPos + scrollAmount; + this._direction = direction; + } else { + // We were already in the process of scrolling in this direction + this._destination = this._destination + scrollAmount; + scrollAmount = this._destination - startPos; + } this.scrollByPixels(scrollAmount, instant); } @@ -536,8 +559,15 @@ ]]> + +