Repository navigation
Description
Summary: squirrel 0.0.108 in HTTP mode emits a11y/button-name failures for empty buttons inside CSS-hidden, hidden, and aria-hidden ancestors. A visible unnamed button correctly fails; visible buttons named by title or aria-label pass. This concerns rule applicability, not title-based naming.
Live example: https://david-dorfmueller.de/anschlagbuchse-din-55027/DIN55027ANSCHLAGBUCHSE. The fresh sweep reports button.btn on this page and 73 others. In the current browser DOM, .js-image-zoom-out, .js-image-zoom-reset, and .js-image-zoom-in have no text/name and zero client rectangles while the image zoom overlay is closed. This establishes a hidden-control candidate; the aggregated selector is too broad to prove that every live finding identifies these buttons. A wishlist button uses title="Zum Merkzettel hinzufügen"; the isolated title control below passes, so no title fallback bug is claimed.
Reproduction: save as button-name-repro.cjs. Each case has its own origin and is audited at /, avoiding ambiguity about the origin seed and the one-page limit.
const http = require('node:http');
const cases = {
bad: '<button></button>',
title: '<button title="Zoom in"></button>',
named: '<button aria-label="Zoom in"></button>',
css: '<style>.closed{display:none}</style><div class="closed"><button></button></div>',
hidden: '<div hidden><button></button></div>',
aria: '<div aria-hidden="true"><button></button></div>',
};
Object.values(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>Button name control</title></head><body><main>' + body + '</main></body></html>');
}).listen(8770 + index, '127.0.0.1');
});Start node button-name-repro.cjs; in another terminal:
squirrel --version
port=8770
for name in bad title named css hidden aria; do
squirrel audit "http://127.0.0.1:$port/" --http --refresh --offline -m 1 \
--rule-include a11y/button-name -f json -o "$name.json"
port=$((port + 1))
doneActual (spark, squirrel 0.0.108, 2026-10-11 16:57 UTC / 2026-10-12 +07): bad, css, hidden, aria each produce one failed check: rule a11y/button-name, check button-name, status fail, message Buttons without accessible names. title and named each produce one passed check and issues: []. Each origin serves the same single page for any requested path; no script changes the markup. Servers and temporary reports were removed after collecting results.
Expected: keep the failure for the visible unnamed bad control and keep title/aria-label controls passing. Do not emit a proven button-name failure for an element absent from the accessibility tree. Re-evaluate naming when a closed overlay opens; a button may need a name in that future state. Off-screen controls and merely disabled buttons must not be treated as hidden. The aria case may independently violate a11y/aria-hidden-focus because the button remains focusable; that does not establish applicability of the button-name rule.
Reference: W3C ACT rule 97a4e1, applicability and Inapplicable Example 2. Related: #664 concerns CSS-hidden descendants under a11y/aria-hidden-focus, whereas this report also reproduces ignored HTML hidden and aria-hidden ancestors in a11y/button-name. No local rule suppression added.
Acceptance Criteria
- A control with no accessible name inside a
display:none/visibility:hiddenancestor, an HTMLhiddenancestor, or anaria-hiddenancestor is not reported asButtons without accessible names. - The visible unnamed
badfixture still fails;titleandaria-labelfixtures still pass. - Off-screen controls and merely
disabledbuttons are not treated as hidden. - The hidden-ancestor helper is shared with
a11y/aria-hidden-focus(a11y/aria-hidden-focus: CSS-hidden descendants reported as focusable in HTTP mode #664). - Tests cover the six fixtures from the repro.
Activity
nc9 commentedon Oct 11, 2026
Thanks Denis. Confirmed on current main:
a11y/button-namehas no applicability check for hidden,aria-hiddenor CSS-hidden ancestors. Triaged as a bug (P2), size M, area rules. I added acceptance criteria. This shares a helper with #664 (static CSS,hidden,aria-hiddenancestors), so I'll queue them together. A visible unnamed button keeps failing, and title and aria-label controls keep passing.nc9 commentedon Oct 11, 2026
Reproduced on 0.0.108 with the repro script (ports changed).
bad,css,hiddenandariaeach givea11y/button-name, checkbutton-name, statusfail,Buttons without accessible names.titleandnamedpass. An extra case with an inlinestyle="display:none"ancestor also fails.origin/main still has this:
packages/rules/src/a11y/button-name.tschecks everybuttonand[role='button']with no hidden-ancestor test. The existingisHiddenFromMarkuphelper inpackages/parser/src/hidden-markup.tsalready covershidden,aria-hiddenand inlinestyleancestors; thecsscase (a class rule in<style>) needs stylesheet support it does not have yet.fix(rules): stop expanding CSS nesting, count pseudo arguments, keep …
fix(rules): read comment-led and semicolon-bearing at-rule preludes a…
fix(rules): read hiding CSS the way a browser tokenizes it, with pars…
perf(rules): linear trims and attribute parsing in static visibility #…
fix(rules): read blocks, url() and escapes the way a browser does in …
refactor(rules): cut static visibility to markup and strict inline st…
fix(rules): apply the user-agent hiding rules to HTML elements only, …
fix(rules): skip controls hidden by markup or plain inline styles in …
fix(rules): skip controls hidden by markup or plain inline styles in …
nc9 commentedon Oct 11, 2026
pub#675 merged: button-name no longer reports unnamed buttons inside markup-hidden or aria-hidden ancestors, or hidden by a plainly written inline display:none or visibility:hidden. The visible unnamed button still fails, and title and aria-label buttons still pass. The case hidden by a <style> block (the css fixture) is not evaluated yet and is tracked in #678. Leaving this open until #678 lands.
nc9 commentedon Oct 12, 2026
Release check 2026-10-12 (v0.0.109): the markup and inline-style paths shipped (pub#675/#676 in v0.0.109), but the criterion about hiding set by a document
<style>rule is not met: that part was deliberately deferred to #678. Leaving open until #678.fix(rules): a11y hidden-control checks read decidable <style> rules s…