Bug 1470504 - If zooming is enabled, mark mouse events passing through APZ as 'ignore root scroll frame' on all platforms. r=kats
authorBotond Ballo <botond@mozilla.com>
Fri, 28 Sep 2018 19:16:27 -0400
changeset 495313 a445a3af8ac47b1f7b8f2d274298561d90cae8d5
parent 495312 8242a2fda82f2bd9c1541f6d09be55a2e7878ffd
child 495314 7bd40fbd946faac9266c463c7aa46bf9340aa91f
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 - If zooming is enabled, mark mouse events passing through APZ as 'ignore root scroll frame' on all platforms. r=kats Differential Revision: https://phabricator.services.mozilla.com/D7346
gfx/layers/apz/src/APZInputBridge.cpp
--- a/gfx/layers/apz/src/APZInputBridge.cpp
+++ b/gfx/layers/apz/src/APZInputBridge.cpp
@@ -61,16 +61,25 @@ APZInputBridge::ReceiveInputEvent(
 
       WidgetMouseEvent& mouseEvent = *aEvent.AsMouseEvent();
 
       // Note, we call this before having transformed the reference point.
       if (mouseEvent.IsReal()) {
         UpdateWheelTransaction(mouseEvent.mRefPoint, mouseEvent.mMessage);
       }
 
+      // If zooming is enabled, mark the mouse event as "ignore root
+      // scroll frame". This ensures that the main-thread hit test the
+      // mouse event undergoes (in PositionedEventTargeting.cpp) uses
+      // the IGNORE_ROOT_SCROLL_FRAME flag, which is needed for correct
+      // hit testing in a zoomed-in or zoomed-out state.
+      if (gfxPrefs::APZAllowZooming()) {
+        mouseEvent.mIgnoreRootScrollFrame = true;
+      }
+
       if (WillHandleMouseEvent(mouseEvent)) {
 
         MouseInput input(mouseEvent);
         input.mOrigin = ScreenPoint(mouseEvent.mRefPoint.x, mouseEvent.mRefPoint.y);
 
         nsEventStatus status = ReceiveInputEvent(input, aOutTargetGuid, aOutInputBlockId);
 
         mouseEvent.mRefPoint.x = input.mOrigin.x;