Repository navigation
Description
Companion to #665, which covers a11y/button-name. Independently reviewed before filing.
Summary. squirrel 0.0.108 also reports inaccessible-name failures for elements excluded from the accessibility tree in five sibling rules:
a11y/aria-dialog-namea11y/aria-command-namea11y/aria-input-field-namea11y/aria-labelsa11y/form-labels
This is about rule applicability while a control is hidden. The same elements may need names when shown; a visible unnamed control must continue to fail. An aria-hidden subtree with focusable descendants can independently violate aria-hidden-focus; this report does not waive that rule.
Live context. On https://www.delife.de/esszimmerstuhl-greg-flex-taupe/a-13896 the fresh sweep reports dialog#configurator-modal as unnamed. It has role="dialog", aria-modal="true", aria-hidden="true" and aria-labelledby="configurator-modal-title"; browser inspection finds the configurator modal closed with display:none and zero layout rectangles. Delife BG and David Dorfmüller also contain closed, unnamed CSS modals, while their visible newsletter/cookie modals have aria-labelledby. That is a candidate-level example, not proof that every Shopware hit is false. The standalone fixtures below reproduce all five sibling rules without live-site dependencies.
Fixture server. Each case is the root document of a separate origin, because the one-page audit starts at the origin root. No DOM is altered after the crawl.
const http = require('node:http');
const bad = '<div role="dialog">Dialog body</div><span role="button" tabindex="0"></span><div role="textbox" tabindex="0"></div><input type="text"><button></button>';
const named = '<div role="dialog" aria-label="Example dialog">Dialog body</div><span role="button" tabindex="0" aria-label="Example command"></span><div role="textbox" tabindex="0" aria-label="Example textbox"></div><input type="text" aria-label="Example input"><button aria-label="Example button"></button>';
const cases = [
bad,
named,
'<style>.closed{display:none}</style><div class="closed">' + bad + '</div>',
'<div hidden>' + bad + '</div>',
'<div aria-hidden="true">' + bad + '</div>',
'<style>.closed{visibility:hidden}</style><div class="closed">' + bad + '</div>',
];
cases.forEach((body, index) => {
http.createServer((req, res) => {
res.setHeader('Content-Type', 'text/html; charset=utf-8');
res.end('<!doctype html><html lang="en"><head><meta charset="utf-8"><title>Applicability fixture</title></head><body><main><h1>Applicability fixture</h1>' + body + '</main></body></html>');
}).listen(8780 + index, '127.0.0.1');
});Commands. Run the server in the background; then audit ports 8780–8785 sequentially:
for port in 8780 8781 8782 8783 8784 8785; do
squirrel audit "http://127.0.0.1:$port/" --http --refresh --offline -m 1 \
--rule-include a11y/aria-dialog-name,a11y/aria-command-name,a11y/aria-input-field-name,a11y/form-labels,a11y/aria-labels \
-f json -o "applicability-$port.json"
doneActual (spark, squirrel 0.0.108, 2026-10-12 +07).
| Case | passed / failed | Result per rule |
|---|---|---|
| Visible unnamed, 8780 | 0 / 5 | All five fail (positive control). |
| Visible named, 8781 | 5 / 0 | All five pass (negative control). |
| CSS display:none ancestor, 8782 | 0 / 5 | All five fail. |
| HTML hidden ancestor, 8783 | 0 / 5 | All five fail. |
| aria-hidden=true ancestor, 8784 | 0 / 5 | All five fail. |
| CSS visibility:hidden ancestor, 8785 | 0 / 5 | All five fail. |
Warnings and skips are zero in all six cases. Failure messages remain identical across visible and hidden cases: two unnamed command elements, one unnamed dialog, two unnamed input fields, two unnamed buttons, one unlabelled form input. Counts can overlap because multiple rules cover native controls; this report does not request deduplication.
Expected. Exclude the hidden fixture descendants from these accessible-name/label checks while they are excluded from the accessibility tree. Retain visible unnamed failures and visible named passes. See WAI-ARIA 1.2: tree exclusion for display:none, visibility:hidden, HTML hidden and aria-hidden.
Local action. No suppression or template disable added.
Acceptance Criteria
-
a11y/aria-dialog-name,aria-command-name,aria-input-field-name,aria-labelsandform-labelsskip elements excluded from the accessibility tree: insidedisplay:none,visibility:hidden, thehiddenattribute, oraria-hidden="true"subtrees, evaluated the same way as the fix for a11y/button-name: hidden controls reported as unnamed buttons #665/a11y/aria-hidden-focus: CSS-hidden descendants reported as focusable in HTTP mode #664. - A visible unnamed control (dialog, command, input field, form field) still fails each rule (fixture "bad" stays red).
- The named variant of each fixture passes.
-
aria-hiddensubtrees with focusable descendants are still reported bya11y/aria-hidden-focus(not waived). - Reporter's closed-modal example (
dialog#configurator-modal: role=dialog, aria-modal, aria-hidden, aria-labelledby, display:none) produces no finding. - Shared hiding helper is reused from a11y/aria-hidden-focus: CSS-hidden descendants reported as focusable in HTTP mode #664/a11y/button-name: hidden controls reported as unnamed buttons #665, not re-implemented per rule; tests for each of the five rules.
Activity
nc9 commentedon Oct 13, 2026
Spec prep
Verdict: confirmed on current main for all five rules (
e95e0f5, v0.0.112). Read from source.None of the five rules consult a visibility helper. The shared resolver
createStaticVisibility(packages/rules/src/shared/static-hidden.ts, from pub#675/#676, shipped in v0.0.109) is used only bya11y/aria-hidden-focusanda11y/button-name:aria-dialog-name.ts:hasAccessibleNameandunnamedDialogItems, over[role=dialog],[role=alertdialog]and nativedialogaria-command-name.ts:commandRoles,buttonanda[href]aria-input-field-name.ts:inputRoles, inputs,textareaandselectaria-labels.ts: thearia-buttonsandaria-svgchecksform-labels.ts: inputs,textareaandselectDependency on #678 (affects the acceptance criteria)
Two of the six fixtures, 8782 (
display:none) and 8785 (visibility:hidden), hide through a class rule in a<style>block. By design the shared resolver does not read<style>blocks. That part is #678, still open, with the cascade attempt parked onwip/static-hidden-cascade-664-665.After this fix:
hidden), 8784 (aria-hidden) and inline-style hiding.dialog#configurator-modal: cleared, becausearia-hidden="true"is on the dialog itself and the resolver withariaHidden: truereads the element as well as its ancestors.It is reported today because its
aria-labelledbytarget is most likely empty in the server HTML: the rule reads the referenced element'stextContent.Suggest either rewording criterion 1 to "markup and inline-style hiding, as in #665;
<style>rules tracked in #678", or leaving this issue open until #678 lands, as #664 and #665 are.Change: apply the
button-name.tspattern to each rulerun():const visibility = createStaticVisibility({ ariaHidden: true }).hidden: count it, addhiddenWithoutNameto the pass details, and switch the pass message to the "in the accessibility tree" wordingbutton-nameuses.unknown: a<check>-unconfirmedwarnwithUNCONFIRMED_LABEL.shown: today's failure, unchanged.meta.solutionwith the hidden and unconfirmed sentence frombutton-name.aria-hidden-focusis untouched (it usesariaHidden: false), so criterion 4 holds by construction.Notes per rule:
aria-dialog-name: a native<dialog>withoutopenis hidden by the user-agent stylesheet, so the resolver sayshidden. Thedialog-namewarning then stops firing for closed dialogs, which is nearly every native dialog in static HTML. That matches ACT applicability (axe also skips hidden elements), but it makes that check close to inert. See open question 1.aria-labels(aria-svg): the resolver's comment says it does not reach SVG or MathML elements. Pin with a test what it returns for an interactive<svg>inside a hidden HTML ancestor.form-labelsandaria-input-field-name:input[type=hidden]is already excluded by their selectors.Tests
New
packages/rules/tests/a11y-name-rules-hidden.test.ts, onedescribeper rule, modelled onbutton-name-hidden.test.ts. BuildparsePagecontexts from the reporter's six cases. For each rule:badfails andnamedpasses.hiddenandaria-hiddenancestors are not reported, and neither is an inlinestyle="display:none"ancestor.<style>display:noneandvisibility:hiddencases still fail. Pin them so the test flips visibly when a11y/aria-hidden-focus, a11y/button-name: evaluate hiding by <style> rules without false hidden results #678 lands.role=dialog aria-modal aria-hidden aria-labelledbypointing at an empty title) is not reported.sr-onlyanddisabledcontrols are not treated as hidden.warn.Re-run
aria-dialog-name.test.ts,button-name-hidden.test.tsandaria-hidden-focus-css-hidden.test.tswith explicit paths.packages/rules/tests/fixtures/static-hidden-chromium.jsonis the Chromium-verified guard if any new reading is added (none should be).Docs, skills, completions
docs/rules/a11y/{aria-dialog-name,aria-command-name,aria-input-field-name,aria-labels,form-labels}.mdx:*-unconfirmedchecks with message templates;button-name.mdx).make validate. No skill or completion change.Risks
Open questions for the maintainer
infosaying "N hidden dialog(s) have no accessible name; they need one when opened"? I recommend theinfo: dialogs are hidden by design until opened.Recommended session
Sonnet, medium effort. The pattern exists, so this is five mechanical applications plus tests. Size M confirmed.
nc9 commentedon Oct 13, 2026
Triage note: per the spec prep,
<style>-block class rules still depend on #678 (also gating #664/#665). Criterion 1 is satisfied for inline-style,hidden,aria-hiddenanddisplay:noneattribute cases; the<style>rule fixtures (8782, 8785) clear with #678. Keeping this issue open until both land.fix(rules): five accessible-name rules skip controls out of the acces…
fix(rules): a closed native <dialog role=dialog> stays checked on the…
fix(rules): the five a11y name rules skip controls hidden from the ac…
nc9 commentedon Oct 16, 2026
Verified on main 8024e29 (pub#833 merged as 862709f):
packages/rules/tests/a11y-name-rules-hidden-671.test.ts47/47 pass.Met, ticked: visible unnamed control still fails each of the five rules; named variants pass;
aria-hidden-focusstill reports a visible focusable control in anaria-hiddensubtree (aria-hidden-focus-css-hidden.test.ts); the reporter'sconfigurator-modalproduces no finding; all five rules use the sharedshared/static-hidden.tshelper, with tests per rule.Not met: criterion 1 for hiding set by a
<style>block (the test pins it as "not read yet (pub#678): still fails"). Markup, thehiddenattribute,aria-hiddenand inline styles are covered. Leaving open until #678 lands, same as #664 and #665.fix(rules): a11y hidden-control checks read decidable <style> rules s…
deniskern commentedon Nov 8, 2026
Minimal HTML:
<dialog aria-labelledby="details-title"><h2 id="details-title"></h2><button></button></dialog>; code sets title text and button name immediately before showModal. .173 warns about the closed native dialog although its empty heading/button are excluded; a genuinely open unnamed dialog remains actionable. Tagged code explicitly setsclosedDialogsShown: truereferencing #462, so request a state/confidence distinction, not unconditional removal of native-dialog naming. Expected: do not call the inaccessible initial state a demonstrated unnamed open dialog; check name after the opener populates it or report a future-state/unverified recommendation. Reuse #671 discussion before filing any duplicate.