diff --git a/gfx/layers/apz/src/APZCTreeManager.cpp b/gfx/layers/apz/src/APZCTreeManager.cpp index f4e279402fae..4aa794289c55 100644 --- a/gfx/layers/apz/src/APZCTreeManager.cpp +++ b/gfx/layers/apz/src/APZCTreeManager.cpp @@ -1648,7 +1648,7 @@ APZCTreeManager::GetTouchInputBlockAPZC( if (aOutTouchBehaviors) { aOutTouchBehaviors->AppendElement(ConvertToTouchBehavior(hitResult)); } - apzc = GetZoomableTarget(apzc, apzc2); + apzc = GetMultitouchTarget(apzc, apzc2); APZCTM_LOG("Using APZC %p as the root APZC for multi-touch\n", apzc.get()); // A multi-touch gesture will not be a scrollbar drag, even if the // first touch point happened to hit a scrollbar. @@ -2107,7 +2107,7 @@ void APZCTreeManager::SetTargetAPZC( } for (size_t i = 1; i < aTargets.Length(); i++) { RefPtr apzc = GetTargetAPZC(aTargets[i]); - target = GetZoomableTarget(target, apzc); + target = GetMultitouchTarget(target, apzc); } mInputQueue->SetConfirmedTargetApzc(aInputBlockId, target); } @@ -2790,11 +2790,6 @@ AsyncPanZoomController* APZCTreeManager::FindRootApzcForLayersId( return resultNode ? resultNode->GetApzc() : nullptr; } -already_AddRefed APZCTreeManager::FindZoomableApzc( - AsyncPanZoomController* aStart) const { - return GetZoomableTarget(aStart, aStart); -} - AsyncPanZoomController* APZCTreeManager::FindRootContentApzcForLayersId( LayersId aLayersId) const { mTreeLock.AssertCurrentThreadIn(); @@ -3022,7 +3017,7 @@ ScreenPoint APZCTreeManager::GetCurrentMousePosition() const { return mCurrentMousePosition; } -already_AddRefed APZCTreeManager::GetZoomableTarget( +already_AddRefed APZCTreeManager::GetMultitouchTarget( AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const { RecursiveMutexAutoLock lock(mTreeLock); RefPtr apzc; diff --git a/gfx/layers/apz/src/APZCTreeManager.h b/gfx/layers/apz/src/APZCTreeManager.h index f85b7583f028..2b6a923b7036 100644 --- a/gfx/layers/apz/src/APZCTreeManager.h +++ b/gfx/layers/apz/src/APZCTreeManager.h @@ -610,13 +610,6 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { uint32_t aEndTimestampMs, ScreenCoord aDeltaY); - /** - * Find the zoomable APZC in the same layer subtree (i.e. with the same - * layers id) as the given APZC. - */ - already_AddRefed FindZoomableApzc( - AsyncPanZoomController* aStart) const; - private: typedef bool (*GuidComparator)(const ScrollableLayerGuid&, const ScrollableLayerGuid&); @@ -650,7 +643,7 @@ class APZCTreeManager : public IAPZCTreeManager, public APZInputBridge { AsyncPanZoomController* FindRootContentApzcForLayersId( LayersId aLayersId) const; AsyncPanZoomController* FindRootContentOrRootApzc() const; - already_AddRefed GetZoomableTarget( + already_AddRefed GetMultitouchTarget( AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const; already_AddRefed CommonAncestor( AsyncPanZoomController* aApzc1, AsyncPanZoomController* aApzc2) const; diff --git a/gfx/layers/apz/src/AsyncPanZoomController.cpp b/gfx/layers/apz/src/AsyncPanZoomController.cpp index de936d6dc15f..4df228a4ec17 100644 --- a/gfx/layers/apz/src/AsyncPanZoomController.cpp +++ b/gfx/layers/apz/src/AsyncPanZoomController.cpp @@ -1169,9 +1169,6 @@ nsEventStatus AsyncPanZoomController::HandleInputEvent( break; } case PINCHGESTURE_INPUT: { - // The APZCTreeManager should take care of ensuring that only root-content - // APZCs get pinch inputs. - MOZ_ASSERT(IsRootContent()); PinchGestureInput pinchInput = aEvent.AsPinchGestureInput(); if (!pinchInput.TransformToLocal(aTransformToApzc)) { return rv; @@ -1207,18 +1204,6 @@ nsEventStatus AsyncPanZoomController::HandleGestureEvent( switch (aEvent.mInputType) { case PINCHGESTURE_INPUT: { - // This may be invoked via a one-touch-pinch gesture from - // GestureEventListener. In that case we want redirect it to the enclosing - // root-content APZC. - if (!IsRootContent()) { - if (APZCTreeManager* treeManagerLocal = GetApzcTreeManager()) { - if (RefPtr root = - treeManagerLocal->FindZoomableApzc(this)) { - rv = root->HandleGestureEvent(aEvent); - } - } - break; - } PinchGestureInput pinchGestureInput = aEvent.AsPinchGestureInput(); pinchGestureInput.TransformToLocal(GetTransformToThis()); switch (pinchGestureInput.mType) { diff --git a/gfx/layers/apz/test/mochitest/apz_test_utils.js b/gfx/layers/apz/test/mochitest/apz_test_utils.js index ff597f127d4f..6dc8fc4e841c 100644 --- a/gfx/layers/apz/test/mochitest/apz_test_utils.js +++ b/gfx/layers/apz/test/mochitest/apz_test_utils.js @@ -57,9 +57,6 @@ function convertTestData(testData) { return result; } -// Returns the last bucket that has at least one scrollframe. This -// is useful for skipping over buckets that are from empty transactions, -// because those don't contain any useful data. function getLastNonemptyBucket(buckets) { for (var i = buckets.length - 1; i >= 0; --i) { if (buckets[i].scrollFrames.length > 0) { @@ -129,9 +126,8 @@ function findRcdNode(apzcTree) { // element, and not in the content descriptions of other elements. function isLayerized(elementId) { var contentTestData = SpecialPowers.getDOMWindowUtils(window).getContentAPZTestData(); - var nonEmptyBucket = getLastNonemptyBucket(contentTestData.paints); - ok(nonEmptyBucket != null, "expected at least one nonempty paint"); - var seqno = nonEmptyBucket.sequenceNumber; + ok(contentTestData.paints.length > 0, "expected at least one paint"); + var seqno = contentTestData.paints[contentTestData.paints.length - 1].sequenceNumber; contentTestData = convertTestData(contentTestData); var paint = contentTestData.paints[seqno]; for (var scrollId in paint) { diff --git a/gfx/layers/apz/test/mochitest/helper_basic_onetouchpinch.html b/gfx/layers/apz/test/mochitest/helper_basic_onetouchpinch.html deleted file mode 100644 index 40f9ddb5ae6f..000000000000 --- a/gfx/layers/apz/test/mochitest/helper_basic_onetouchpinch.html +++ /dev/null @@ -1,94 +0,0 @@ - - - - - - Sanity check for one-touch pinch zooming - - - - - - - - Here is some text to stare at as the test runs. It serves no functional - purpose, but gives you an idea of the zoom level. It's harder to tell what - the zoom level is when the page is just solid white. - - diff --git a/gfx/layers/apz/test/mochitest/helper_onetouchpinch_nested.html b/gfx/layers/apz/test/mochitest/helper_onetouchpinch_nested.html deleted file mode 100644 index 6275b148af72..000000000000 --- a/gfx/layers/apz/test/mochitest/helper_onetouchpinch_nested.html +++ /dev/null @@ -1,109 +0,0 @@ - - - - - - One-touch pinch zooming while on a non-root scroller - - - - - - - - - Here is some text outside the scrollable div. -
- Here is some text inside the scrollable div. -
This div actually makes it overflow.
-
-
This div makes the body scrollable.
- - diff --git a/gfx/layers/apz/test/mochitest/test_group_zoom.html b/gfx/layers/apz/test/mochitest/test_group_zoom.html index b6b8bae3bef0..c5329a11c6a9 100644 --- a/gfx/layers/apz/test/mochitest/test_group_zoom.html +++ b/gfx/layers/apz/test/mochitest/test_group_zoom.html @@ -45,25 +45,13 @@ var doubletap_prefs = [ ["apz.max_tap_time", 10000], ]; -// Increase the tap timeouts so the one-touch-pinch gesture is still detected -// in case of random delays during testing. Also ensure that the feature is -// actually enabled (which it should be by default, but it's good to be safe). -var onetouchpinch_prefs = [ - ...prefs, - ["apz.one_touch_pinch.enabled", true], - ["ui.click_hold_context_menus.delay", 10000], - ["apz.max_tap_time", 10000], -]; - var subtests = [ {"file": "helper_bug1280013.html", "prefs": prefs}, {"file": "helper_basic_zoom.html", "prefs": prefs}, - {"file": "helper_basic_onetouchpinch.html", "prefs": onetouchpinch_prefs}, {"file": "helper_zoom_prevented.html", "prefs": prefs}, {"file": "helper_zoomed_pan.html", "prefs": prefs}, {"file": "helper_fixed_position_scroll_hittest.html", "prefs": prefs}, {"file": "helper_basic_doubletap_zoom.html", "prefs": doubletap_prefs}, - {"file": "helper_onetouchpinch_nested.html", "prefs": onetouchpinch_prefs}, ]; if (isApzEnabled()) {