w3c / uievents

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

Require support for legacy events #366

Open zcorpan opened 5 months ago

zcorpan commented 5 months ago

https://w3c.github.io/uievents/#keypress

If supported by a user agent,

I think it's not great that support for the legacy keypress event is optional. It adds complexity to the specification to need to handle the chain of default actions (see #361) differently depending on whether keypress is supported or not, and if textInput (#353) is also supposed to be optional it becomes more complex still.

This complexity leaks to tests, or tests would need to be marked as "optional" if they test legacy events.

What is the benefit? As long as the events are needed for web compat, I think the spec should require support, even if it's marked as "legacy".

cc @masayuki-nakano

garykac commented 5 months ago

We still want to discourage its use, because there are accessibility issues with keypress that input has fixed. For example, speech input devices should create an input event rather have to create a sequence of keypress events appropriate for the current layout/locale. Sites that rely only on keypress would work fine for many people, but would effectively block (or require odd hacks for) users with non-standard input devices. This is why we wanted a stronger deprecation message for this event.

I don't think "legacy" is a strong enough phrasing for this since it implies that it's OK to use, but it might go away at some point. I think our position is closer to: "it's somewhat harmful to rely on this event, but we can't remove it".

zcorpan commented 4 months ago

Web content and user agents are different conformance classes, so you can have independent requirements for each.

You can also use "obsolete" instead of "legacy", and explain some of the issues to further discourage usage.

zcorpan commented 4 months ago

Related: https://github.com/w3c/uievents/issues/112