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
--- a/layout/base/PresShell.cpp
+++ b/layout/base/PresShell.cpp
@@ -7472,17 +7472,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();
}