w3c / html-aria

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

Identify elements which support aria-roledescription without an explicit or implicit role #77

Open joanmarie opened 7 years ago

joanmarie commented 7 years ago

As described in https://github.com/w3c/aria/issues/500, there is a need to prohibit the exposure of the value of aria-roledescription for certain elements (e.g. div and span) when there is no explicit or implicit ARIA role. Alternatively, or in addition, the HTML AAM could explicitly allow the exposure of the value of aria-roledescription on certain elements (e.g. meter used without an explicit role).

(Edited to add note): The purpose/motivation behind this request is that we want to strongly discourage authors from using aria-roledescription on elements which lack useful semantic meaning, and we want to strongly encourage (and perhaps insist) that user agents do not expose the value of aria-roledescription when it is used on an element which lacks useful semantic meaning and also lacks an implicit or explicit ARIA role. But there's no way we can come up with a host-language-agnostic, universally-agreed-upon definition of "useful semantic meaning" or "generic element." If such elements are explicitly identified in the host-language-specific AAMs and/or related documents, we (ARIA spec and/or Core AAM) should be able to point authors and user agents to those specs to get the implementation and user experience desired and intended for aria-roledescription.

joanmarie commented 7 years ago

Tweaking the summary. I'm working on draft text for the ARIA spec. The current content is:

User agents MUST expose the aria-roledescription attribute if a valid value is applied to a host language interactive control.

If aria-roledescription is applied to a host language container element, user agents must not expose aria-roledescription unless the author also defines an explicit WAI-ARIA role value, or the host language has explicitly identified the element as supporting aria-roledescription.

(emphasis added)

scottaohara commented 3 years ago

To handle things like this, prohibited use of aria-label/labelledby on necessary elements, and that some of the remaining global aria-* attributes still make no sense on some HTML elements - e.g., <p aria-controls=foo> (what is a paragraph controlling?) - I want to address these with #266