Repository navigation
Description
On manifest-verified native v0.0.172 and v0.0.173, a11y/aria-required-parent evaluates implicit listitem roles inside presentational descendants of a progressbar.
Minimal HTML (inside a normal HTML document):
<ol role="progressbar" aria-label="Bundle progress" aria-valuemin="0" aria-valuemax="4" aria-valuenow="0">
<li>One</li><li>Two</li><li>Three</li><li>Four</li>
</ol>
<ul><li>Valid list control</li></ul>
<li>True orphan control</li>Both release binaries return 5 element(s) missing required parent role, with li (implicit role="listitem"): needs parent with role=list|group. The ordinary ul/li control passes, so only the genuine orphan should remain actionable after accounting for inherited presentational semantics.
Commands, with separate fresh HOME for each binary: audit http://127.0.0.1:<fixture>/ --http --offline --no-publish --passive --disable-discovery-probes --rule-include a11y/aria-required-parent -m 1 -f json -o out.json. Both exit 0, one audited page. No cloud or customer-site calls.
The case was minimized from two retained original HTML inputs: the same four li sit under ol[role=progressbar]. With scripts disabled and all network requests blocked, Chromium CDP Accessibility.getPartialAXTree reports those exact four nodes as ignored: true, role: none, ignoredReasons: presentationalRole, beneath a progressbar. DOM ancestry alone, and Playwright getByRole/ariaSnapshot, do not demonstrate the browser AX semantics here. The original customer inputs are not attached; the synthetic control above reproduces the same native count.
Expected: apply ancestor children-presentational semantics before asserting an implicit role has a required parent, retaining focusability exceptions and failures for genuine orphan listitems. This is not a request to ignore every li inside any arbitrary parent, or to treat progressbar as a list.
The tagged aria-required-parent implementation walks ancestors for explicit/implicit parent roles but assigns an implicit li/listitem without accounting for an ancestor's presentational-children semantics. An all-state issue search for aria-required-parent/progressbar and PR search for children-presentational found no matching report; #1276 concerns selector escaping instead.
Triage
Confirmed on current main. packages/rules/src/a11y/aria-required-parent.ts handles implicit li (and option, tr, td, th, rowgroup) by walking ancestors with getEffectiveRole, which returns the explicit role first. An ol[role=progressbar] therefore resolves to progressbar, never list, so every li beneath it fails hasRequiredParent. Nothing accounts for roles whose children are presentational (progressbar, img, button, checkbox, and similar), where descendants are removed from the accessibility tree.
Acceptance Criteria
- The reproduction HTML from this issue reports exactly 1 element (the true orphan
li), not 5 - Implicit-role elements (li, option, tr, td, th, rowgroup) inside an ancestor whose role has presentational children are not flagged
- A genuine orphan
lioutside any list or presentational-children ancestor still fails - A plain
ul > listill passes - Focusable descendants of a presentational-children ancestor keep their semantics and are still evaluated
- A test in the rule's test file covers the progressbar case, and the rule docs mention the exception
Generated by Claude Code
Activity
style(rules): format the squirrelscan#1640 test file with oxfmt
fix(rules): skip presentational descendants in aria-required-parent
style(rules): format the squirrelscan#1640 test file with oxfmt
fix(rules): skip presentational descendants in aria-required-parent (s…