Bug 1457743 - Fix check for entering momentum-scrolling codepath after both fingers are released in a two-finger pan. r=kats
authorBotond Ballo <botond@mozilla.com>
Sat, 28 Apr 2018 19:29:51 -0400
changeset 472458 f4ec7081819fb5cf196ba542292f8ea81ca6487c
parent 472457 6af6e0353487fca6a494b8315d9cf4637ef103f4
child 472459 3d562de35a8dc1f96e254165b94760c7b9a67695
push id1728
push userjlund@mozilla.com
push dateMon, 18 Jun 2018 21:12:27 +0000
treeherdermozilla-release@c296fde26f5f [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1457743
milestone61.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 1457743 - Fix check for entering momentum-scrolling codepath after both fingers are released in a two-finger pan. r=kats MozReview-Commit-ID: 587mYzBf2aB
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -1632,16 +1632,17 @@ nsEventStatus AsyncPanZoomController::On
     }
   } else {
     // Otherwise, handle the fingers being lifted.
 
     // Some of the code paths below, like ScrollSnap() or HandleEndOfPan(),
     // may start an animation, but otherwise we want to end up in the NOTHING
     // state. To avoid state change notification churn, we use a
     // notification blocker.
+    bool stateWasPinching = (mState == PINCHING);
     StateChangeNotificationBlocker blocker(this);
     SetState(NOTHING);
 
     if (mZoomConstraints.mAllowZoom) {
       RecursiveMutexAutoLock lock(mRecursiveMutex);
 
       // We can get into a situation where we are overscrolled at the end of a
       // pinch if we go into overscroll with a two-finger pan, and then turn
@@ -1658,17 +1659,17 @@ nsEventStatus AsyncPanZoomController::On
       }
       // Along with clearing the overscroll, we also want to snap to the nearest
       // snap point as appropriate.
       ScrollSnap();
     } else {
       // when zoom is not allowed
       mX.EndTouch(aEvent.mTime);
       mY.EndTouch(aEvent.mTime);
-      if (mState == PINCHING) {
+      if (stateWasPinching) {
         // still pinching
         if (HasReadyTouchBlock()) {
           return HandleEndOfPan();
         }
       }
     }
   }
   return nsEventStatus_eConsumeNoDefault;