w3c / html-aria

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

Allowed roles for header and footer #255

Open JAWS-test opened 3 years ago

JAWS-test commented 3 years ago

Allowed roles for header and footer (according to https://www.w3.org/TR/html-aria/#allowed-aria-roles-states-and-properties):

Roles: group, none or presentation

I guess that only applies if header and footer have an implicit ARIA role, otherwise all ARIA roles are allowed, right? If the context of header and footer is relevant for the allowed ARIA roles, there should be two separate rows each in the table.

This may also be true for all other HTML tags with an if-condition regarding the implicit ARIA role:

scottaohara commented 3 years ago

I think you raise a good point here, there may be a case for extending the allowed roles. However, even in situations where header, footer, section and form map to role=generic, i think allowing "any role" on those would provide little positive gain.

for instance, allowing "any role" means the following would be valid. and, while yes, the example is contrived, it's also flagged as an error now, and would not be with an "any role" allowance.

<article>
  <header role=button>
    <h1>title of article</h1>
  </header>
  ...
</article>

Specifically regarding section and form, these could allow for additional roles, however I'd be hesitant to allow any roles that are marked as name required in ARIA. That would create a situation that these limited role allowances are trying to avoid - authors overwriting important a11y mappings of native HTML elements.