Summary: | Normalizing touch events mouse compatibility event bubbling | ||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
Product: | WebKit | Reporter: | Patrick H. Lauke <redux> | ||||||||
Component: | UI Events | Assignee: | Nobody <webkit-unassigned> | ||||||||
Status: | RESOLVED DUPLICATE | ||||||||||
Severity: | Enhancement | CC: | cdumez, dino, rbyers, rmondello, rniwa, simon.fraser, thorton, webkit-bug-importer | ||||||||
Priority: | P2 | Keywords: | InRadar | ||||||||
Version: | Safari 10 | ||||||||||
Hardware: | iPhone / iPad | ||||||||||
OS: | iOS 10 | ||||||||||
Attachments: |
|
Description
Patrick H. Lauke
2017-04-21 01:44:42 PDT
Any chance to at least document this on developer.apple.com? Ping to self Created attachment 330428 [details]
Testcase
In this simple testcase, bubbling of the synthetic click works fine.
Simon, that test case works because you already have a click handler attached to the elements. The issue does not manifest itself when you have: * target element is a link or form control * target or any ancestor (up to but not including body) has explicit mouse or click handler (even if only empty function) * target or any ancestor (up to and including document) has cursor:pointer https://patrickhlauke.github.io/getting-touchy-presentation/#221 The problem with bubbling/delegation happens when you don't have any of the above. For instance, user taps on a <div> but listens for click on the body (as many event delegation frameworks do). As an example, see https://patrickhlauke.github.io/touch/bubbling/div.html (attached as single file testcase here too) Created attachment 330463 [details]
Test case showing lack of event bubbling
There are more permutations I tested for this at https://patrickhlauke.github.io/touch/ (under the "iOS event bubbling" section) Created attachment 330475 [details]
Click handler on the body
This testcase shows the bug.
This happens because Frame::qualifyingNodeAtViewportLocation() doesn't include the body for some reason. And there's some crazy code that looks at CSS cursor styles to decide which nodes are clickable, which seems bizarre. This is a really old issue, covered by rdar://problem/5844416. It seems like we're trying to avoid having the tap highlight show up over the entire page, but I think we could fix that without breaking handlers on the body. *** This bug has been marked as a duplicate of bug 151933 *** |