Bug 1450099 - Only enter the SCROLLBAR_DRAG state if the scrollbar thumb is clicked. r=kats
MozReview-Commit-ID: HkNvYQP0KqC
--- 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