w3c / uievents

UI Events
https://w3c.github.io/uievents/
Other
145 stars 51 forks source link

Click targeting is inconsistent across different UAs and the spec #233

Open NavidZ opened 5 years ago

NavidZ commented 5 years ago

@smaug---- @rniwa Based on the current wording of the spec it seems that UA should send the click event to the first inclusive common ancestor of the down and up targets unconditionally. I added the following two wpt tests to cover this behavior:

http://w3c-test.org/uievents/click/click_event_target_child_parent.html http://w3c-test.org/uievents/click/click_event_target_siblings.html

It seems that different browsers are showing different behaviors on this on different scenarios and they don't seem to agree on all the tests. Chromium recently changed its behavior to match the spec exactly but we got some regressions. I have been working with library maintainers to fix the issues as much as I could but still wanted to bring this inconsistency issue up.

smaug---- commented 5 years ago

Gecko moved to Blink's old behavior late last year, common ancestor is looked up until nearest interactive content.

Webkit has some different model, IIRC. Does it depend on whether some form element is implemented in shadow DOM or some such?

rniwa commented 5 years ago

WebKit has a bunch of ad-hoc rules. It seems important for backwards compatibility unfortunately :(

NavidZ commented 5 years ago

@rniwa do you think it is possible to revisit those hacks and see whether it is possible to remove them as much as possible? Some of them might not be that useful anymore with the current web.

I would love to achieve a uniform predictable behavior across browsers hopefully sometime in the future.