feat(aria): add notRecommended standards flag for needs-review - #5257
Draft
chutchins25 wants to merge 1 commit into
Draft
feat(aria): add notRecommended standards flag for needs-review#5257chutchins25 wants to merge 1 commit into
chutchins25 wants to merge 1 commit into
Conversation
Add an additive notRecommended: true flag for ARIA roles and attributes, surfaced as needs-review (incomplete) via new not-recommended-role and not-recommended-attr checks on the aria-allowed-role and aria-allowed-attr rules. Existing deprecated handling is unchanged. No role or attribute is flagged notRecommended yet; this is reusable capability for future not-recommended-but-valid ARIA. Closes #5247 Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
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.
Adds a reusable
notRecommended: truestandards flag for ARIA roles and attributes that surfaces as needs review.What & why
Per the discussion on #3341 (@WilcoFiers / Steven Lambert), axe should have a general, data-driven way to return needs review for ARIA that is valid but not recommended — rather than handling each case ad hoc.
This is additive and changes no existing behavior:
notRecommended: trueflag can be set on any role (ariaRoles) or attribute (ariaAttrs).not-recommended-role(on thearia-allowed-rolerule) returns needs-review when the element's resolved role isnotRecommended.not-recommended-attr(on thearia-allowed-attrrule) returns needs-review when the element uses anotRecommendedattribute.aria-deprecated-attr, a needs-review outcome yields to a sibling check's failure (e.g. an unallowed attribute still fails the rule).Existing
deprecatedhandling (aria-deprecated-attr,aria-deprecated-role) is untouched —deprecatedandnotRecommendedremain distinct.No real data yet
No role or attribute is flagged
notRecommendedtoday — this PR provides the reusable capability Steve asked for. The checks are therefore verified data-driven viaaxe.configuremocks (same approach as the deprecated-attr tests), not integration fixtures.Tests
not-recommended-attr/not-recommended-rolecheck units — mocked flag viaaxe.configure, single + multiple, negative case, open Shadow DOM case.aria-allowed-attr/aria-allowed-rolevirtual-rules — mocked flag yieldsincomplete.locales/_template.jsongains exactly the two new check blocks;doc/rule-descriptions.mdunchanged (no new rule); full check/commons/integration/virtual-rule suites green.Closes #5247