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

Expectations for aria-checked on HTML checkbox #1622

Closed
scottaohara opened this issue Sep 30, 2021 · 1 comment · Fixed by #1657
Closed

Expectations for aria-checked on HTML checkbox #1622

scottaohara opened this issue Sep 30, 2021 · 1 comment · Fixed by #1657
Assignees
Milestone

Comments

@scottaohara
Copy link
Member

I’ve been doing testing on the support of aria-checked on native checkboxes, specifically in regards to the mixed state, but it has uncovered some irregularities I wanted to pose to the WG.

The attribute is generally ignored (as it should be per section 8.5) on native HTML checkboxes since the implicit state/functionality of the checkbox overrides the aria-checked attribute. aria-checked=mixed is an odd duck here though because HTML conveys this by the indeterminate IDL attribute - not the checked attribute dirty checked state. Firefox/Webkit appear to strictly follow section 8.5 here and ignore aria-checked=mixed on a native checkbox (which makes sense because aria-checked generally equates to the checked/unchecked state, and this section indicates that a native attribute wins out over an aria-* one. Combining mixed into this attribute scoots around HTML having indeterminate as a separate IDL attribute to the checked state). Chromium appears to not follow section 8.5 for this attribute, exposing aria-checked regardless of the actual state of the checkbox.

Chromium is wrong to be exposing aria-checked=true|false instead of the actual state of the checkbox - but through this error Chromium will expose aria-checked=mixed on a native checkbox.

Firefox/Webkit do not expose aria-checked=true|false , and instead correctly expose the actual state of the native checkbox. But do not expose aria-checked=mixed.

Per all the above, I see a few different things that could occur here:

  1. add a note to ARIA indicating that if authors need to expose a native checkbox in the 'mixed' state, that they need to use the host language feature to do so (this is my preference).
  2. or, i would think that a special case for aria-checked needs to be made since it has this unique feature of combining two native states into one attribute.
  3. OR, create an aria-mixed (or similar) attribute, deprecating the mixed value from aria-checked to mitigate this special case.
@dylanb
Copy link

dylanb commented Nov 22, 2021

We should change the spec to make what Chromium does the specified behavior.

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

Successfully merging a pull request may close this issue.

3 participants