Bug 1093686 - Ignore body-level touch/mouse listeners when assessing element clickability. r=roc
authorKartikaya Gupta <kgupta@mozilla.com>
Thu, 06 Nov 2014 08:05:51 -0500
changeset 214390 b1e482f69d96d2ca59e627eeb101d2f284efecb2
parent 214389 e25127d1ad196c638af12c5dfbca9bb43babe939
child 214391 0c95949fef141b5745d06eef4a377e0b774a94ca
push id27780
push userkwierso@gmail.com
push dateFri, 07 Nov 2014 02:25:05 +0000
treeherdermozilla-central@e6d47abb6a7b [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersroc
bugs1093686
milestone36.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 1093686 - Ignore body-level touch/mouse listeners when assessing element clickability. r=roc When walking up the content tree to assess if an element is contained inside a clickable element, we should stop before hitting the body element. This is a heuristic based on pages in the wild, because a lot of pages have mouse/touch listeners on the body. Without this patch all elements end up getting treated as clickable which makes the event retargeting code useless.
layout/base/PositionedEventTargeting.cpp
--- a/layout/base/PositionedEventTargeting.cpp
+++ b/layout/base/PositionedEventTargeting.cpp
@@ -330,17 +330,17 @@ GetClosest(nsIFrame* aRoot, const nsPoin
     }
 
     if (preservesAxisAlignedRectangles) {
       // Subtract from the exposed region if we have a transform that won't make
       // the bounds include a bunch of area that we don't actually cover.
       SubtractFromExposedRegion(&exposedRegion, region);
     }
 
-    if (!IsElementClickable(f)) {
+    if (!IsElementClickable(f, nsGkAtoms::body)) {
       continue;
     }
     // If our current closest frame is a descendant of 'f', skip 'f' (prefer
     // the nested frame).
     if (bestTarget && nsLayoutUtils::IsProperAncestorFrameCrossDoc(f, bestTarget, aRoot)) {
       continue;
     }
     if (!nsLayoutUtils::IsAncestorFrameCrossDoc(aRestrictToDescendants, f, aRoot)) {