w3c / html-aria

ARIA in HTML
https://w3c.github.io/html-aria/
Other
179 stars 48 forks source link

Unclear interaction of "MUST NOT use opposing values" requirement with aria-checked and aria-hidden #339

Closed dd8 closed 3 years ago

dd8 commented 3 years ago

Potential Issue

In "3.1 Requirements for use of ARIA attributes in place of equivalent HTML attributes" the leading paragraph says:

However, authors SHOULD NOT use both the native HTML attribute and the aria-* attribute together, and MUST NOT use the these features together when their values are in opposition to each other https://www.w3.org/TR/html-aria/#docconformance-attr

This is an absolute prohibition on using opposing values per RFC 2119.

The 'Rules of ARIA attribute usage by HTML feature' table below this restates the "MUST NOT use these ... in opposition" requirement for aria-disabled, aria-readonly, aria-required and strengthens it for aria-valuemax, aria-valuemin

However the intent seems to be the "MUST NOT use these ... in opposition" is relaxed for aria-checked and aria-hidden, but the wording isn't explicit about this:

Possible Solutions

1) One way of resolving this would be adding "except as noted below" or similar to the "MUST NOT use the these features together when their values are in opposition to each other" in the leading paragraph, then add some explicit wording where the requirement is relaxed.

2) Alternatively, it might be better to remove the "MUST NOT use these ... in opposition" in the leading paragraph since the requirements seem very specific to each attribute - and https://github.com/w3c/html-aria/issues/338 may make these even more specific. If there's still a need for a generic "MUST NOT use opposing values" fallback that could be added as an "otherwise" row to the end of the table.

Edit: The second option is probably better since the requirements for each attribute are in one place (which makes implementation easier). Keeping stuff closer together also works better with Github diffs - when reviewing PRs it's easy to miss important lines that should have been changed because they're too far away from the changed lines to appear in the diff.

scottaohara commented 3 years ago

Hi @dd8. Thanks again for this issue. I agree that a revising the leading paragraph will be the best option here, as the wording for checked/aria-checked and hidden/aria-hidden was deliberate due to these being special cases that don't neatly align with the rest of the attributes.

e.g., there is no MUST NOT statement for checked/aria-checked since the checked attribute only indicates the initial state of the checkbox, but thereafter does not update to reflect when the user changes state. And regarding hidden/aria-hidden, you already linked to the issue that indicates why this is deliberate.

dd8 commented 3 years ago

@scottaohara - excellent.

Unrelated to this issue but I think I know the reason for the lazy loading problems outlined in your blog - they're due to a weird interaction with the acc-name calculation: https://www.scottohara.me/note/2019/08/08/lazy-images.html Ping me an email at mark dot rogers at powermapper dot com and I can explain the issue.