Bug 1386742 - Fix a transcription error in the APZ autoscroll calculation. r=kats, a=lizzard
authorBotond Ballo <botond@mozilla.com>
Wed, 02 Aug 2017 13:51:30 -0400
changeset 423452 6f5f957aa6dd36c0b4c51c3bd943ef3c9c5bdece
parent 423451 bb925de1a0f30951c0b3d028716cc9ee69ac0676
child 423453 b5abd699f37ba5836e281e67c8fd54dcc38576b5
push id1517
push userjlorenzo@mozilla.com
push dateThu, 14 Sep 2017 16:50:54 +0000
treeherdermozilla-release@3b41fd564418 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats, lizzard
bugs1386742
milestone56.0
Bug 1386742 - Fix a transcription error in the APZ autoscroll calculation. r=kats, a=lizzard 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