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

elementRoleMaps includes conflicting mapping for complementary #526

Open
khiga8 opened this issue Jul 10, 2023 · 1 comment
Open

elementRoleMaps includes conflicting mapping for complementary #526

khiga8 opened this issue Jul 10, 2023 · 1 comment

Comments

@khiga8
Copy link

khiga8 commented Jul 10, 2023

Hi! I'm looking at tests/src/elementRoleMap-test.js, and I noticed that the entries for elementRoleMaps includes both:

[{"name": "aside"}, ["complementary"]],

and later

[{"name": "aside"}, ["generic"]],

These seem to conflict with each other.

Should [{"name": "aside"}, ["complementary"]] be removed? I think this is coming from complementaryRole.js.

Tangentially, which document should I be looking at as the source of truth? I saw both https://www.w3.org/TR/html-aam-1.0/ and https://www.w3.org/TR/wai-aria-1.2/#roles referenced, and wasn't sure which one. Thank you!

@jlp-craigmorten
Copy link
Contributor

jlp-craigmorten commented Feb 18, 2024

See below for some relevant references to specifications.

I've been known to get muddled between these specifications but my understanding is that:

  • HTML AAM indicates that the aside HTML element will be exposed by user agents to assistive technologies as one of two roles depending on it's scope:
    1. Role complementary if scoped to the body or a main element, or if scoped to sectioning content (aka scoped to a header or footer element) and it has an accessible name.
    2. Role generic if scoped to sectioning content (aka scoped to a header or footer element) and it does not have an accessible name.
  • HTML ARIA indicates that the aside HTML element has an implicit complementary role.

These don't appear to be quite aligned.

Assuming user agents are actually conforming to the HTML-AAM specification in how they expose the aside HTML element (and that this is the desired behaviour), it feels like HTML-ARIA needs an update to explain that the implicit role for the aside HTML element can also be generic depending on the scope (indeed the implicit ARIA semantics are stated to be defined in HTML AAM for this section of HTML ARIA).

There appears to be an open issue tracking this in the HTML ARIA repo already, so we can take the HTML AAM version of the truth reasonably confidently.

So afaik this project is documenting the dual element role mappings somewhat correctly. There is perhaps room for improvement as it appears to be missing the constraints for the scoped to the body or main element variation of aside being given a role of complementary.

See also:


HTML ARIA

This specification defines the authoring rules (author conformance requirements) for the use of Accessible Rich Internet Applications (WAI-ARIA) 1.2 and Digital Publishing WAI-ARIA Module 1.0 attributes on [HTML] elements.

4. Document conformance requirements for use of ARIA attributes in HTML

The following table provides normative per-element document conformance requirements for the use of ARIA markup in HTML documents. Additionally, it identifies the implicit ARIA semantics that apply to HTML elements. The implicit ARIA semantics of these elements are defined in HTML AAM.

HTML element Implicit ARIA semantics (explicitly assigning these in markup is NOT RECOMMENDED) ARIA role, state and property allowances
aside role=complementary Roles: feed, none, note, presentation, region or search. (complementary is also allowed, but NOT RECOMMENDED.)

DPub Roles: doc-dedication, doc-example, doc-footnote, doc-glossary, doc-pullquote or doc-tip

Global aria-* attributes and any aria-* attributes applicable to the allowed roles.

REF: https://www.w3.org/TR/html-aria/#docconformance

HTML AAM

HTML Accessibility API Mappings (HTML-AAM) defines how user agents map HTML [HTML] elements and attributes to platform accessibility application programming interfaces (APIs).

3.4.8 aside (scoped to the body or main element)

HTML Specification aside (scoped to the body or main element)
[wai-aria-1.2] complementary role

REF: https://www.w3.org/TR/html-aam-1.0/#el-aside-ancestorbodymain

3.4.9 aside (scoped to a sectioning content element)

HTML Specification aside (scoped to a sectioning content element)
[wai-aria-1.2] complementary role if the aside element has an accessible name. Otherwise, generic role.

REF: https://www.w3.org/TR/html-aam-1.0/#el-aside

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

No branches or pull requests

2 participants