Bug 1470504 - Use IGNORE_ROOT_SCROLL_FRAME in PrepareForSetTargetAPZCNotification() whenever zooming is enabled. r=kats
authorBotond Ballo <botond@mozilla.com>
Wed, 03 Oct 2018 15:04:45 -0400
changeset 495315 85dc90d04f3154cba25ac699314b96fdb4879eaf
parent 495314 7bd40fbd946faac9266c463c7aa46bf9340aa91f
child 495316 53d3165782b47d3a6753d12efc5664ab9cd1f603
push id9984
push userffxbld-merge
push dateMon, 15 Oct 2018 21:07:35 +0000
treeherdermozilla-beta@183d27ea8570 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerskats
bugs1470504
milestone64.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 1470504 - Use IGNORE_ROOT_SCROLL_FRAME in PrepareForSetTargetAPZCNotification() whenever zooming is enabled. r=kats Differential Revision: https://phabricator.services.mozilla.com/D7644
gfx/layers/apz/util/APZCCallbackHelper.cpp
--- a/gfx/layers/apz/util/APZCCallbackHelper.cpp
+++ b/gfx/layers/apz/util/APZCCallbackHelper.cpp
@@ -671,22 +671,23 @@ PrepareForSetTargetAPZCNotification(nsIW
                                     nsIFrame* aRootFrame,
                                     const LayoutDeviceIntPoint& aRefPoint,
                                     nsTArray<ScrollableLayerGuid>* aTargets)
 {
   ScrollableLayerGuid guid(aGuid.mLayersId, 0, FrameMetrics::NULL_SCROLL_ID);
   nsPoint point =
     nsLayoutUtils::GetEventCoordinatesRelativeTo(aWidget, aRefPoint, aRootFrame);
   uint32_t flags = 0;
-#ifdef MOZ_WIDGET_ANDROID
-  // On Android, we need IGNORE_ROOT_SCROLL_FRAME for correct hit testing
-  // when zoomed out. On desktop, don't use it because it interferes with
-  // hit testing for some purposes such as scrollbar dragging.
-  flags = nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME;
-#endif
+  if (gfxPrefs::APZAllowZooming()) {
+    // If zooming is enabled, we need IGNORE_ROOT_SCROLL_FRAME for correct
+    // hit testing. Otherwise, don't use it because it interferes with
+    // hit testing for some purposes such as scrollbar dragging (this will
+    // need to be fixed before enabling zooming by default on desktop).
+    flags = nsLayoutUtils::IGNORE_ROOT_SCROLL_FRAME;
+  }
   nsIFrame* target =
     nsLayoutUtils::GetFrameForPoint(aRootFrame, point, flags);
   nsIScrollableFrame* scrollAncestor = target
     ? nsLayoutUtils::GetAsyncScrollableAncestorFrame(target)
     : aRootFrame->PresShell()->GetRootScrollFrameAsScrollable();
 
   // Assuming that if there's no scrollAncestor, there's already a displayPort.
   nsCOMPtr<dom::Element> dpElement = scrollAncestor