Skip to content

[html-aam] Set heading level based on HTML computed heading level#2720

Open
keithamus wants to merge 3 commits into
mainfrom
headingoffset
Open

[html-aam] Set heading level based on HTML computed heading level#2720
keithamus wants to merge 3 commits into
mainfrom
headingoffset

Conversation

@keithamus

@keithamus keithamus commented Jan 22, 2026

Copy link
Copy Markdown
Member

🚀 Netlify Preview:
🔄 this PR updates the following sspecs:

Refs whatwg/html#11086.

This wires up HTML-AAM to the headingoffset feature of the html spec which defines an algorithm for computing a heading level.

Test, Documentation and Implementation tracking

Once this PR has been reviewed and has consensus from the working group, tests should be written and issues should be opened on browsers. Add N/A and check when not applicable.

(Supersedes #2598)

@netlify

netlify Bot commented Jan 22, 2026

Copy link
Copy Markdown

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit 15b584a
🔍 Latest deploy log https://app.netlify.com/projects/wai-aria/deploys/697b90d954b04100083038ed
😎 Deploy Preview https://deploy-preview-2720--wai-aria.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@github-actions

github-actions Bot commented Jan 22, 2026

Copy link
Copy Markdown
Contributor

🚀 Deployed on https://deploy-preview-2720--wai-aria.netlify.app

@github-actions github-actions Bot temporarily deployed to pull request January 22, 2026 10:33 Inactive
@scottaohara scottaohara self-assigned this Jan 22, 2026

@scottaohara scottaohara 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.

just some minor things / question about if the note should be normative

Comment thread html-aam/index.html Outdated
Comment thread html-aam/index.html Outdated
Comment thread html-aam/index.html
<a class="core-mapping" href="#role-map-heading">`heading`</a> role, with the <a class="core-mapping" href="#ariaLevel">`aria-level`</a> property set to
<a data-cite="html/sections.html#get-an-element's-computed-heading-offset">the computed heading level</a>; this is the number from the element's tag name (e.g., 2 for `h2`), adjusted
by any <a href="#att-headingoffset">`headingoffset`</a> or <a href="#att-headingreset">`headingreset`</a> attributes in scope.
<div class="note">

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.

thinking about this more, i'm wondering if this should be normative?

HTML has one example that mentions aria-level, but not in a way that would demonstrate it taking priority.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree, I don't see any reason why this couldn't be a normative requirement.

Co-authored-by: Scott O'Hara <scottaohara@users.noreply.github.com>
@github-actions github-actions Bot temporarily deployed to pull request January 26, 2026 18:24 Inactive
@github-actions github-actions Bot temporarily deployed to pull request January 29, 2026 16:56 Inactive
@spectranaut spectranaut moved this to Waiting For Implementation in ARIA Normative PR Tracking Feb 12, 2026
Comment thread html-aam/index.html
<a class="core-mapping" href="#role-map-heading">`heading`</a> role, with the <a class="core-mapping" href="#ariaLevel">`aria-level`</a> property set to
<a data-cite="html/sections.html#get-an-element's-computed-heading-offset">the computed heading level</a>; this is the number from the element's tag name (e.g., 2 for `h2`), adjusted
by any <a href="#att-headingoffset">`headingoffset`</a> or <a href="#att-headingreset">`headingreset`</a> attributes in scope.
<div class="note">

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

I agree, I don't see any reason why this couldn't be a normative requirement.

Comment thread html-aam/index.html
<a data-cite="html/sections.html#get-an-element's-computed-heading-offset">the computed heading level</a>; this is the number from the element's tag name (e.g., 2 for `h2`), adjusted
by any <a href="#att-headingoffset">`headingoffset`</a> or <a href="#att-headingreset">`headingreset`</a> attributes in scope.
<div class="note">
If an explicit <a class="core-mapping" href="#ariaLevel">`aria-level`</a> attribute is specified on the element, it takes priority over the implicit `aria-level` value derived from

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

According to the computed heading level algorithm in HTML spec, it caps off at a heading level value of 9: https://html.spec.whatwg.org/multipage/sections.html#heading-levels-&-offsets.

However, core-aam doesn't note a maximum heading level: https://w3c.github.io/core-aam/#ariaLevelHeading. Should this be clarified in html-aam/core-aam?

@pkra pkra removed their request for review June 12, 2026 06:31
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Waiting For Implementation

Development

Successfully merging this pull request may close these issues.

5 participants