Skip to content

Editorial: Add <header> (sectionheader) and <footer> (sectionfooter) html-aam mappings #2543

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

Open
wants to merge 3 commits into
base: main
Choose a base branch
from

Conversation

rahimabdi
Copy link
Contributor

Copy link

netlify bot commented Jun 6, 2025

Deploy Preview for wai-aria ready!

Name Link
🔨 Latest commit 58f038d
🔍 Latest deploy log https://app.netlify.com/projects/wai-aria/deploys/6852b9a03f252e0008ad3990
😎 Deploy Preview https://deploy-preview-2543--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.

@rahimabdi rahimabdi self-assigned this Jun 6, 2025
@jnurthen jnurthen requested review from Copilot and aardrian June 12, 2025 17:03
Copy link

@Copilot Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull Request Overview

This PR updates the HTML-AAM reference to map <header> and <footer> elements to new ARIA section roles when they have an accessible name, otherwise retaining the generic role.

  • Add conditional mapping text for <footer> to sectionfooter vs. generic
  • Add conditional mapping text for <header> to sectionheader vs. generic
Comments suppressed due to low confidence (2)

html-aam/index.html:2516

  • Consider adding automated tests to cover the new conditional mapping for <footer> when it has an accessible name, verifying that the sectionfooter role is applied and that it falls back to generic otherwise.
<td><a class="core-mapping" href="#role-map-sectionfooter">`sectionfooter`</a> role if the <a data-cite="html">`footer`</a> element has an <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>. Otherwise, the <a class="core-mapping" href="#role-map-generic">`generic`</a> role.</td>

html-aam/index.html:2821

  • Add tests for the <header> element to ensure the sectionheader role is correctly applied when an accessible name is present, and that the fallback to generic behaves as expected.
<td><a class="core-mapping" href="#role-map-sectionheader">`sectionheader`</a> role if the <a data-cite="html">`header`</a> element has an <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>. Otherwise, the <a class="core-mapping" href="#role-map-generic">`generic`</a> role.</td>

@jnurthen jnurthen requested a review from keithamus June 12, 2025 17:04
@@ -2513,7 +2513,7 @@ <h4 id="el-footer">`footer` (scoped to the `main` element,a sectioning content e
</tr>
<tr>
<th>[[wai-aria-1.2]]</th>
<td><a class="core-mapping" href="#role-map-generic">`generic`</a> role</td>
<td><a class="core-mapping" href="#role-map-sectionfooter">`sectionfooter`</a> role if the <a data-cite="html">`footer`</a> element has an <a data-cite="accname-1.2/#dfn-accessible-name">accessible name</a>. Otherwise, the <a class="core-mapping" href="#role-map-generic">`generic`</a> role.</td>
Copy link
Member

Choose a reason for hiding this comment

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

the intent of the role change would be to do away with generic all together, so i think that needs to be removed.

Copy link
Contributor

Choose a reason for hiding this comment

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

So the presence of an accName is not a factor?

Copy link
Contributor

Choose a reason for hiding this comment

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

I cannot agree more with Scott.
In a real-world scenario (e.g., article context) there's no need to assign an accessible name to these elements (and an author does not expect to do that), as the article context already conveys the meaning of the nested header and footer.
This also seems consistent with the ARIA specifications, which do not require an accessible name for such roles.

Copy link
Contributor Author

@rahimabdi rahimabdi Jun 18, 2025

Choose a reason for hiding this comment

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

@scottaohara @giacomo-petri Agreed, the computed role for <header> and <footer> should be sectionheader/sectionfooter in a sectioning element context in terms of mapping and for interop purposes so will remove the generic clause.

However, when <header>/<footer> are descendants of sectioning elements, my understanding is that they should be exposed as navigable containers only when they are supplied with accname (like role="region", which requires disambiguation). The Webkit and Chrome implementations both behave in this way so if this is incorrect, I can submit bugs to get this fixed.

Copy link
Contributor

Choose a reason for hiding this comment

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

@rahimabdi,

do you have a concrete example to illustrate your point? I'm having trouble seeing how <header> and <footer> could be descendants of other elements in the way you are suggesting.

From my understanding, and based on my testing, <header> and <footer> are either scoped to the nearest sectioning content (e.g. main, article, etc.), in which case they are mapped to sectionheader/sectionfooter, or they default to the page level, scoped to body, and get mapped to banner/contentinfo respectively.

Here’s what I mean with an example:

<body>
    <table>
        <tbody>
            <tr>
                <th>test</th>
                <th>test</th>
            </tr>
            <tr>
                <td><header>test</header></td>
                <td><footer>test</footer></td>
            </tr>
        </tbody>
    </table>
</body>

assuming it's somehow meaningful, hedaer and footer still retain the banner/contentinfo mapping, while in

<body>
    <main>
        <table>
            <tbody>
                <tr>
                    <th>test</th>
                    <th>test</th>
                </tr>
                <tr>
                    <td><header>test</header></td>
                    <td><footer>test</footer></td>
                </tr>
            </tbody>
        </table>
    </main>
</body>

they are mapped as sectionheader/sectionfooter

I don't see any other scenarios, unless we explicitly decide that, under certain conditions, these elements should instead map to a generic role.

Copy link
Contributor

Choose a reason for hiding this comment

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

Sorry, I think I misunderstood the comment. In my view, since <header> and <footer> elements used as descendants of sectioning elements (like <article>) usually have a well-defined context, IMO authors typically don't need to provide an accessible name. Doing so would often just repeat the context that's already implied. I don't think developers are likely to add aria-label/aria-labelledby to native <header> or <footer> elements within an article, because their meaning is already clear from the structure.

This is also why, in my opinion, we differentiate roles like banner/contentinfo from sectionheader/sectionfooter. We want to avoid placing extra burdens on authors.

Moreover, <header> and <footer> elements, when used within sectioning elements, carry a more specific contextual meaning than generic <section> elements. While sections are often used as generic containers and may not always represent regions (reason why we require acc name), headers and footers usually indicate a defined part of a sectioning element, and not a generic one. If their use doesn't carry that semantic weight, they are better replaced with more neutral containers.

Copy link
Member

Choose a reason for hiding this comment

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

This was discussed at length when these roles were created. That they are essentially role=group with platform localized role descriptions

So if they are named, the role is exposed by screen readers

if they are not named, then the role is treated the same as the group role and screen readers ignore it. BUT the role doesn’t change. It isn’t generic or none…

does this reminder of what these are supposed to act like ring any bells / squash any doubts?

Copy link
Member

Choose a reason for hiding this comment

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

Per the example of the header/footer in the table - further updates to when these elements map to the section* vs landmark roles is going to be handled in another pr

Copy link
Contributor Author

@rahimabdi rahimabdi Jun 18, 2025

Choose a reason for hiding this comment

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

Thanks @scottaohara. I've updated the PR so ready for another review.

@giacomo-petri Please let me know if there's any further changes, thanks!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

Update header/footer mappings for role=sectionheader/sectionfooter
4 participants