Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require support for legacy events #366

Open
zcorpan opened this issue Jan 11, 2024 · 3 comments
Open

Require support for legacy events #366

zcorpan opened this issue Jan 11, 2024 · 3 comments

Comments

@zcorpan
Copy link
Member

zcorpan commented Jan 11, 2024

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
Copy link
Member

garykac commented Jan 22, 2024

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
Copy link
Member Author

zcorpan commented Feb 14, 2024

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

  • UAs must support the keypress event
  • Authors should not (or must not) use the keypress event

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

@zcorpan
Copy link
Member Author

zcorpan commented Feb 23, 2024

Related: #112

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants