w3c / html-aria

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

Define allowed ARIA attributes for div when a child of dl element #374

Closed scottaohara closed 2 years ago

scottaohara commented 2 years ago

Allowing div as a child of dl has introduced some oddities with AT understanding the contents of a dl element correctly. This seems mostly an issue for AT to resolve, and largely they have as far as I recall, Browsers generally appear to be exposing their accessibility trees appropriately (more testing needed).

However, as I was reminded by https://github.com/whatwg/html/issues/7347, I think we need to make it absolutely clear that if a div is acting as a styling/grouping container for dt and dd elements, it must not be allowed any ARIA roles outside of presentation/none, and no global aria-* attributes. Otherwise, this would break the already awkward mappings/user experience of the dl element.

scottaohara commented 2 years ago

Testing the following:

<dl>
  <div role=navigation>
    <dt>test</dt>
    <dd>...</dd>
  </div>
</dl>

only axe presently flags that this is incorrect. so seems a good idea to get this into the spec to get other checkers to correctly flag this error.

scottaohara commented 2 years ago

likely straight forward adding of a mention to the div allowances column stating that if a direct child of a dl then no allowed roles other than none/presentation.

scottaohara commented 2 years ago

this was closed by merging of https://github.com/w3c/html-aria/pull/403