Bug 1450099 - Only enter the SCROLLBAR_DRAG state if the scrollbar thumb is clicked. r=kats
authorBotond Ballo <botond@mozilla.com>
Wed, 04 Apr 2018 16:29:57 -0400
changeset 411753 2dc5471ebd4a119941db86cbec9ed7d413b9a851
parent 411752 16bec207dc418bac3bef71ae5c15ade76032d6e0
child 411754 b8847ae94ccf9e30af925ac10054c3416a1db9ed
push id33770
push usernerli@mozilla.com
push dateThu, 05 Apr 2018 10:01:08 +0000
treeherdermozilla-central@65e0fefdab51 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1450099
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 1450099 - Only enter the SCROLLBAR_DRAG state if the scrollbar thumb is clicked. r=kats MozReview-Commit-ID: HkNvYQP0KqC
gfx/layers/apz/src/AsyncPanZoomController.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -956,35 +956,36 @@ nsEventStatus AsyncPanZoomController::Ha
   if (!gfxPrefs::APZDragEnabled()) {
     return nsEventStatus_eIgnore;
   }
 
   if (!GetApzcTreeManager()) {
     return nsEventStatus_eConsumeNoDefault;
   }
 
-  if (aEvent.mType == MouseInput::MouseType::MOUSE_DOWN) {
-    SetState(SCROLLBAR_DRAG);
-  }
-
   if (aEvent.mType == MouseInput::MouseType::MOUSE_UP) {
     SetState(NOTHING);
     ScrollSnap();
-  }
-
-  if (aEvent.mType != MouseInput::MouseType::MOUSE_MOVE) {
     return nsEventStatus_eConsumeNoDefault;
   }
 
   RefPtr<HitTestingTreeNode> node =
     GetApzcTreeManager()->FindScrollThumbNode(aDragMetrics);
   if (!node) {
     return nsEventStatus_eConsumeNoDefault;
   }
 
+  if (aEvent.mType == MouseInput::MouseType::MOUSE_DOWN) {
+    SetState(SCROLLBAR_DRAG);
+  }
+
+  if (aEvent.mType != MouseInput::MouseType::MOUSE_MOVE) {
+    return nsEventStatus_eConsumeNoDefault;
+  }
+
   const ScrollThumbData& thumbData = node->GetScrollThumbData();
   MOZ_ASSERT(thumbData.mDirection.isSome());
   ScrollDirection direction = *thumbData.mDirection;
 
   bool isMouseAwayFromThumb = false;
   if (int snapMultiplier = gfxPrefs::SliderSnapMultiplier()) {
     // It's fine to ignore the async component of the thumb's transform,
     // because any async transform of the thumb will be in the direction of