Bug 1386742 - Fix a transcription error in the APZ autoscroll calculation. r=kats draft
authorBotond Ballo <botond@mozilla.com>
Wed, 02 Aug 2017 13:51:30 -0400
changeset 619838 45097a948b6a26cf1dbc1ed53741cd180d22b34a
parent 619804 80855ac7d3ae44c393dde96650b330cc737f69d6
child 640517 2ab91add1a566bbba7ae4ccefe3f4c18ba052ab9
push id71841
push userbballo@mozilla.com
push dateWed, 02 Aug 2017 17:53:14 +0000
reviewerskats
bugs1386742
milestone56.0a1
Bug 1386742 - Fix a transcription error in the APZ autoscroll calculation. r=kats MozReview-Commit-ID: DNVBRR6wucU
gfx/layers/apz/src/AutoscrollAnimation.cpp
--- a/gfx/layers/apz/src/AutoscrollAnimation.cpp
+++ b/gfx/layers/apz/src/AutoscrollAnimation.cpp
@@ -52,17 +52,17 @@ AutoscrollAnimation::DoSample(FrameMetri
   ScreenPoint mouseLocation = treeManager->GetCurrentMousePosition();
 
   // The implementation of this function closely mirrors that of its main-
   // thread equivalent, the autoscrollLoop() function in
   // toolkit/content/browser-content.js.
 
   // Avoid long jumps when the browser hangs for more than |maxTimeDelta| ms.
   static const TimeDuration maxTimeDelta = TimeDuration::FromMilliseconds(100);
-  TimeDuration timeDelta = TimeDuration::Max(aDelta, maxTimeDelta);
+  TimeDuration timeDelta = TimeDuration::Min(aDelta, maxTimeDelta);
 
   float timeCompensation = timeDelta.ToMilliseconds() / 20;
 
   // Notes:
   //   - The main-thread implementation rounds the scroll delta to an integer,
   //     and keeps track of the fractional part as an "error". It does this
   //     because it uses Window.scrollBy() or Element.scrollBy() to perform
   //     the scrolling, and those functions truncate the fractional part of