Prevent NVDA from announcing non-landmark <header> and <footer> as "grouping" #18217
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Link to issue number:
Fixes Issue #18186
Summary of the issue:
For the
<header>
and<footer>
elements that are children of the main element, but are unnamed, NVDA is correctly not announcing the role for the elements.For the header and footer elements that are children of the main element, and are named, NVDA is announcing their role as "grouping".
Description of user facing changes:
NVDA announces
<header>
and<footer>
elements as they are even when they are not ARIA landmarks.Description of developer facing changes:
Updated
findExtraOverlayClasses()
inNVDAObjects/IAccessible/chromium
to check for<header>
and<footer>
elements with the role grouping.If the IA2 attribute container-tag is main, and the element tag is header or footer, NVDA now prevents the default
Groupbox
class from being applied.Description of development approach:
Inspected NVDA’s object overlays to find where the incorrect “grouping” label was applied.
Used IA2 attributes like
"tag"
and"container-tag"
to identify structural<headers>
/<footers>
.Removed the
Groupbox
overlay class when the element matched conditions indicating a structural (not ARIA landmark)<header>
/<footer>
.Testing strategy:
Used NVDA’s Python Console and Speech Viewer to inspect how headers and footers are announced across several Chromium-based browsers.
Confirmed that unlabeled
<header>
and<footer>
elements no longer produce the misleading “grouping” announcement.Verified that actual ARIA landmarks and meaningful groupings continue to be read as expected.
Known issues with pull request:
This fix is specific to Chromium objects and may not apply to other rendering engines (like Firefox or EdgeHTML). As not all browers have
<sectionheader>
/<sectionfooter>
.Code Review Checklist:
@coderabbitai summary