Bug 1341992 - Only do hit-testing with the ignore-root-scroll-frame flag on zoomable platforms. r=tnikkel a=jcristau
authorKartikaya Gupta <kgupta@mozilla.com>
Wed, 24 May 2017 16:23:03 -0400
changeset 396429 6e7be87923b6f10aae7de08345239ab3ce7d6af9
parent 396428 befb19ed674f441caf07c85c0fff5f168af8c14a
child 396430 1e504e2b22218ea1dabdae39d4b17c870389551b
push id1468
push userasasaki@mozilla.com
push dateMon, 05 Jun 2017 19:31:07 +0000
treeherdermozilla-release@0641fc6ee9d1 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewerstnikkel, jcristau
bugs1341992
milestone54.0
Bug 1341992 - Only do hit-testing with the ignore-root-scroll-frame flag on zoomable platforms. r=tnikkel a=jcristau 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();
         }