refactor(aria): share the none role definition with presentation - #5255
Merged
Conversation
chutchins25
force-pushed
the
chut/4656-role-image-synonym
branch
from
July 29, 2026 15:12
5e48786 to
eee05ae
Compare
chutchins25
force-pushed
the
chut/5249-none-presentation-synonym
branch
2 times, most recently
from
July 29, 2026 16:23
222cd8d to
8f8e17a
Compare
chutchins25
force-pushed
the
chut/4656-role-image-synonym
branch
from
July 29, 2026 16:42
54be348 to
eee05ae
Compare
chutchins25
force-pushed
the
chut/5249-none-presentation-synonym
branch
from
July 29, 2026 16:42
8f8e17a to
222cd8d
Compare
straker
reviewed
Jul 29, 2026
straker
left a comment
Contributor
There was a problem hiding this comment.
Per discussion in #5248 (review), the only thing this pr should do is extract the role defintion in aria-roles for none into it's own object and spread it to the none and presentation roles so they remain linked.
chutchins25
force-pushed
the
chut/4656-role-image-synonym
branch
from
July 29, 2026 17:00
eee05ae to
229e59f
Compare
chutchins25
force-pushed
the
chut/5249-none-presentation-synonym
branch
from
July 29, 2026 17:10
222cd8d to
b13d753
Compare
chutchins25
changed the base branch from
chut/4656-role-image-synonym
to
develop
July 29, 2026 17:10
chutchins25
marked this pull request as ready for review
July 29, 2026 17:43
Contributor
There was a problem hiding this comment.
Pull request overview
Refactors the ARIA standards role definitions to centralize the shared spec for the none and presentation roles, aiming to keep the two role entries consistent as the codebase moves toward treating them equivalently.
Changes:
- Introduces a shared
noneRoleobject for common role metadata. - Replaces duplicated inline definitions for
noneandpresentationwith spreads ofnoneRole.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
chutchins25
marked this pull request as draft
July 29, 2026 20:18
…sentation-synonym # Conflicts: # lib/standards/aria-roles.js
straker
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Models
presentationas a synonym ofnoneand removes the hardcoded['none', 'presentation']membership checks, per @WilcoFiers on #4656.What & why
Uses the
synonymmechanism from #4656:presentationrole getssynonym: 'none', sogetExplicitRole/getRoleresolve it to the canonicalnone.<img>) is also normalized tononeat the data level (implicit-html-roles.js), sogetRolenever returns'presentation'from either the explicit or implicit path.With role resolution always yielding
none, the scattered['none', 'presentation'].includes(role)checks that read fromgetRole/getExplicitRolecollapse to a singlerole === 'none'— 18 sites simplified.Intentionally left with both terms
fallbackrole-evaluate.js— reads rawroleattribute tokens (tokenList), so it needs the literalpresentationandnonetokens.presentation-role-conflict.json(CSS selector) andhtml-elms.jsallowedRolesarrays — raw/selector paths.lookup-table.jsevaluateRoleForElement— has no call sites, so its input couldn't be verified as normalized.Behavior note
getRole/getExplicitRolenow return'none'where they previously could return'presentation'(they're synonyms —noneis the canonical term). End-to-end rule results are unchanged (all integration + virtual-rule suites pass without expectation changes); only internalcommonsrole-resolution output and the corresponding unit-test expectations changed.Tests
implicit-role,get-role(13 inheritance cases),presentational-role,aria-allowed-role— result expectations updatedpresentation→none.commons/checks/ integration / virtual-rule suites green; no generated-file drift.Closes #5249