Bug 1502010 - Fix a pending TODO that has been resolved. r=botond
authorKartikaya Gupta <kgupta@mozilla.com>
Tue, 27 Nov 2018 00:43:57 +0000
changeset 504588 ab2123e59f8aa5b9bcd2e0d5ebec393813938aed
parent 504587 bc5e971423389dce27a9ad5978f3efec79c4c8ac
child 504589 51e713e72d92e869657be2b17d556d6ca71b3749
push id10290
push userffxbld-merge
push dateMon, 03 Dec 2018 16:23:23 +0000
treeherdermozilla-beta@700bed2445e6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbotond
bugs1502010
milestone65.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 1502010 - Fix a pending TODO that has been resolved. r=botond Differential Revision: https://phabricator.services.mozilla.com/D12825
gfx/layers/apz/src/AsyncPanZoomController.cpp
gfx/layers/apz/test/gtest/TestPinching.cpp
--- a/gfx/layers/apz/src/AsyncPanZoomController.cpp
+++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp
@@ -985,27 +985,24 @@ AsyncPanZoomController::ArePointerEvents
     pannable = pannableY;
   } else if (panDirection == Some(ScrollDirection::eHorizontal)) {
     pannable = pannableX;
   } else {
     // If we don't have a guessed pan direction, err on the side of returning true.
     pannable = pannableX || pannableY;
   }
 
+  if (touchPoints == 1) {
+    return pannable;
+  }
+
   bool zoomable = mZoomConstraints.mAllowZoom;
   zoomable &= (aBlock->TouchActionAllowsPinchZoom());
 
-  // XXX once we fix bug 1031443, consumable should be assigned
-  // pannable || zoomable if touchPoints > 1.
-  bool consumable = (touchPoints == 1 ? pannable : zoomable);
-  if (!consumable) {
-    return false;
-  }
-
-  return true;
+  return pannable || zoomable;
 }
 
 nsEventStatus AsyncPanZoomController::HandleDragEvent(const MouseInput& aEvent,
                                                       const AsyncDragMetrics& aDragMetrics,
                                                       CSSCoord aInitialThumbPos)
 {
   if (!gfxPrefs::APZDragEnabled()) {
     return nsEventStatus_eIgnore;
--- a/gfx/layers/apz/test/gtest/TestPinching.cpp
+++ b/gfx/layers/apz/test/gtest/TestPinching.cpp
@@ -233,17 +233,17 @@ TEST_F(APZCPinchGestureDetectorTester, P
   behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM);
   behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM);
   DoPinchTest(true, &behaviors);
 }
 
 TEST_F(APZCPinchGestureDetectorTester, Pinch_UseGestureDetector_TouchActionNotAllowZoom) {
   SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
   nsTArray<uint32_t> behaviors;
-  behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::VERTICAL_PAN);
+  behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::NONE);
   behaviors.AppendElement(mozilla::layers::AllowedTouchBehavior::PINCH_ZOOM);
   DoPinchTest(false, &behaviors);
 }
 
 TEST_F(APZCPinchGestureDetectorTester, Pinch_UseGestureDetector_TouchActionNone_NoAPZZoom) {
   SCOPED_GFX_PREF(TouchActionEnabled, bool, true);
   SCOPED_GFX_PREF(APZAllowZooming, bool, false);