Skip to content

docs: clarify aside complementary role mapping - #44629

Open
ishaanlabs-gg wants to merge 2 commits into
mdn:mainfrom
ishaanlabs-gg:docs-aside-conditional-role
Open

docs: clarify aside complementary role mapping#44629
ishaanlabs-gg wants to merge 2 commits into
mdn:mainfrom
ishaanlabs-gg:docs-aside-conditional-role

Conversation

@ishaanlabs-gg

Copy link
Copy Markdown

Description

Clarifies that <aside> maps to complementary only conditionally when nested in sectioning content.

Motivation

This matches the HTML-AAM mapping for <aside> and addresses reader confusion in the <aside> and complementary role pages.

Additional details

  • HTML-AAM maps <aside> scoped to body or main to complementary.
  • HTML-AAM maps <aside> scoped to sectioning content to complementary only when it has an accessible name; otherwise it maps to generic.

Validation:

  • git diff --check
  • source guard for the new conditional role wording

Related issues and pull requests

Fixes #40664

@ishaanlabs-gg
ishaanlabs-gg requested review from a team as code owners July 2, 2026 20:17
@ishaanlabs-gg
ishaanlabs-gg requested review from estelle and hamishwillee and removed request for a team July 2, 2026 20:17
@github-actions github-actions Bot added Content:HTML Hypertext Markup Language docs Content:Accessibility Accessibility docs size/s [PR only] 6-50 LoC changed labels Jul 2, 2026
@hamishwillee
hamishwillee removed their request for review July 2, 2026 23:10
@github-actions

github-actions Bot commented Jul 8, 2026

Copy link
Copy Markdown
Contributor


> [!NOTE]
> Using the {{HTMLElement('aside')}} element will automatically communicate a section has a role of `complementary`. Developers should always prefer using the correct semantic HTML element over using ARIA.
> Using the {{HTMLElement('aside')}} element will usually communicate a section has a role of `complementary`. When an `<aside>` is nested in sectioning content, it maps to `complementary` only if it has an accessible name. Developers should always prefer using the correct semantic HTML element over using ARIA.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

We can make it shorter. does this work?

Suggested change
> Using the {{HTMLElement('aside')}} element will usually communicate a section has a role of `complementary`. When an `<aside>` is nested in sectioning content, it maps to `complementary` only if it has an accessible name. Developers should always prefer using the correct semantic HTML element over using ARIA.
> Using the {{HTMLElement('aside')}} element will communicate a section has a role of `complementary` when the `<aside>` has an accessible name and is nested in sectioning content. Developers should always prefer using the correct semantic HTML element over using ARIA.

@Josh-Cena Josh-Cena Sep 1, 2026

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This changes the sentence's meaning. If you really want to shorten it this way, it would have to be:

Suggested change
> Using the {{HTMLElement('aside')}} element will usually communicate a section has a role of `complementary`. When an `<aside>` is nested in sectioning content, it maps to `complementary` only if it has an accessible name. Developers should always prefer using the correct semantic HTML element over using ARIA.
> Using the {{HTMLElement('aside')}} element will communicate a section has a role of `complementary` when the `<aside>` either isn't nested in sectioning content or has an accessible name. Developers should always prefer using the correct semantic HTML element over using ARIA.

But that's really a mouthful.

(Same for below.)

@estelle estelle left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks. a few suggestions for wording and linking

### Prefer HTML

Using the {{HTMLElement('aside')}} element will automatically communicate that the element has a role of `complementary`. If possible, prefer using the semantic `<aside>` element instead of the `complementary` role.
Using the {{HTMLElement('aside')}} element will usually communicate that the element has a role of `complementary`. If an `<aside>` is nested in sectioning content, it maps to `complementary` only if it has an accessible name. If possible, prefer using the semantic `<aside>` element instead of the `complementary` role.

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
Using the {{HTMLElement('aside')}} element will usually communicate that the element has a role of `complementary`. If an `<aside>` is nested in sectioning content, it maps to `complementary` only if it has an accessible name. If possible, prefer using the semantic `<aside>` element instead of the `complementary` role.
Using the {{HTMLElement('aside')}} element will communicate a section has a role of `complementary` when the `<aside>` has an accessible name and is nested in sectioning content. If possible, prefer using the semantic `<aside>` element instead of the `complementary` role.

Comment thread files/en-us/web/html/reference/elements/aside/index.md Outdated
Comment thread files/en-us/web/html/reference/elements/aside/index.md Outdated
Co-authored-by: Estelle Weyl <estelle@openwebdocs.org>
@Josh-Cena
Josh-Cena requested a review from a team as a code owner September 1, 2026 09:06
@Josh-Cena
Josh-Cena requested review from scottohara and removed request for a team September 1, 2026 09:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Content:Accessibility Accessibility docs Content:HTML Hypertext Markup Language docs size/s [PR only] 6-50 LoC changed

Projects

None yet

Development

Successfully merging this pull request may close these issues.

<aside> implicit role="complementary" is conditional

4 participants