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

Create quick list of attributes with aria-* equivalents #492

Open
scottaohara opened this issue Jun 9, 2023 · 3 comments
Open

Create quick list of attributes with aria-* equivalents #492

scottaohara opened this issue Jun 9, 2023 · 3 comments
Assignees

Comments

@scottaohara
Copy link
Member

Per the ARIA spec, when authors specify both the native HTML attribute and the ARIA attribute with the same purpose, the HTML attribute is meant to win.

To help surface exactly which attributes need to be considered here, a quick list of these attributes could be surfaced to make it easier to identify - rather than having to comb through all the HTML attributes, many of which do not expose a11y properties.

@aleventhal
Copy link
Collaborator

aleventhal commented Jun 9, 2023

Does the HTML attribute win for cases like disabled/required/checked when the attribute is not present? I would have assumed no, but Firefox does this for checked (I guess clearly the input type=checkbox is unchecked when the attribute is not present). On the other hand, Firefox does not do it for disabled/required. Not sure that there's a clear rule here.
@jcsteh

@jcsteh
Copy link

jcsteh commented Jun 9, 2023

Checked is a tricky case. The absence of the attribute is in itself a value. I'm happy to change that in Firefox, but it seems confusing to me that an unchecked HTML checkbox with aria-checked=true becomes checked, but a checked HTML checkbox with aria-checked=false also becomes checked. We're biased towards checked there.

In contrast, disabled and required are more exceptional states that are generally only set in specific circumstances.

@JAWS-test
Copy link

Especially since the state of a checkbox depends only initially on the checked attribute, but changes during the operation of the checkbox, i.e. is completely independent of the attribute in the DOM.

That is why the sentence at "checked" is also a bit too complicated and misleading:

If an input element in the checkbox or radio state includes both the checked attribute and the aria-checked attribute with a valid value, User Agents MUST expose only the checked attribute value.

Clearer and simpler would be:

For HTML radio buttons and checkboxes, user agents must always ignore the aria-checked attribute.

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

5 participants