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.
The PositionedEventTargeting code allows input events to be dispatched to a
target not directly under the input event point. However, the coordinates of the
input event can then end up outside the bounding rect of the event target. This
state is generally unexpected by web content and may cause compatibility issues.
Fennec's front-end code used to deal with this by repositioning the input event
coordinates to be inside the bounding rect; now that Fennec is using the shared
C++ code we need to have that code here. This behaviour is guarded by a pref and
disabled by default (but enabled on Fennec).
The ignore-root-scroll-frame flag is used on mobile platforms in order to allow
hit-testing outside the viewport area. This is needed because the user can zoom
out and make visible an area larger than the viewport (i.e. the displayport) but
layout generally restricts hit-testing to the viewport. The code to retarget
events to nearby clickable elements also needs to respect this flag, otherwise
the retargeting fails to work outside the viewport area.
In bug 921928, the user places a call and then tries to do other actions
(calls, SMS, contacts, ...) with actions very close to the attention
screen. When trying to do those other actions, event fluffing is
prioritizing the attention screen rather than user apps.
---
layout/base/PositionedEventTargeting.cpp | 10 ++
layout/base/tests/Makefile.in | 2 +
.../bug921928_event_target_iframe_apps_oop.html | 8 +
.../base/tests/test_event_target_iframe_oop.html | 178 +++++++++++++++++++++
4 files changed, 198 insertions(+)
create mode 100644 layout/base/tests/bug921928_event_target_iframe_apps_oop.html
create mode 100644 layout/base/tests/test_event_target_iframe_oop.html
This patch does the following:
* Move nsIFrame::IntrinsicSize to mozilla::IntrinsicSize so that it can
be forward-declared.
* Move a number of templated inline nsLayoutUtils methods to nsIFrame.
* Use mozilla::layout::FrameChildListID instead of the
nsIFrame::ChildListID typedef in nsLayoutUtils.h.
* Move nsReflowFrameRunnable to its only user, nsProgressMeterFrame.cpp.
* Make a number of functions requiring nsIFrame.h out-of-line.
* Remove the nsIFrame.h #include from nsLayoutUtils.h and add it to the
places which require it implicitly.