Bug 1341992 - Only do hit-testing with the ignore-root-scroll-frame flag on zoomable platforms. r=tnikkel
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 24 May 2017 16:23:03 -0400
changeset 360545 e72ec95b6b62eb2a0365e3682cd792a78d7621e1
parent 360544 42e125f14c1ba6bfe5763c6df6fa3f4213a1da5a
child 360546 a9c56fc0ad1193e8c21500587f4dad40d98c105b
push id43358
push userkgupta@mozilla.com
push dateThu, 25 May 2017 02:11:01 +0000
treeherderautoland@e72ec95b6b62 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel
bugs1341992
milestone55.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 1341992 - Only do hit-testing with the ignore-root-scroll-frame flag on zoomable platforms. r=tnikkel The ignore-root-scroll-frame flag is generally needed on Fennec, or possibly other zoom-enabled platforms, when we have them. It allows hit-testing things outside the main thread's notion of what is visible, because that might occur when the user zooms out. For largely historical reasons, we are passing this flag around in other scenarios, such as when doing hit-tests for touch events, because in the past touch events and zooming only happened on Fennec, so it didn't matter. Now that we have touch events enabled on other platforms, such as Windows, we need to make the distinction clearer. MozReview-Commit-ID: BlHjtjFYgzv
layout/base/PresShell.cpp
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -7473,17 +7473,22 @@ PresShell::HandleEvent(nsIFrame* aFrame,
     // capturing and retargeting the event because the captured frame will
     // be used instead below. Also keep using the root frame if we're dealing
     // with a window-level mouse exit event since we want to start sending
     // mouse out events at the root EventStateManager.
     if (!captureRetarget && !isWindowLevelMouseExit) {
       nsPoint eventPoint;
       uint32_t flags = 0;
       if (aEvent->mMessage == eTouchStart) {
-        flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
+        if (gfxPrefs::APZAllowZooming()) {
+          // Setting this flag will skip the scrollbars on the root frame from
+          // participating in hit-testing, and we only want that to happen on
+          // zoomable platforms (for now).
+          flags |= INPUT_IGNORE_ROOT_SCROLL_FRAME;
+        }
         WidgetTouchEvent* touchEvent = aEvent->AsTouchEvent();
         // if this is a continuing session, ensure that all these events are
         // in the same document by taking the target of the events already in
         // the capture list
         nsCOMPtr<nsIContent> anyTarget;
         if (touchEvent->mTouches.Length() > 1) {
           anyTarget = TouchManager::GetAnyCapturedTouchTarget();
         }