Repository navigation
Description
Independent review: PASS (2026-10-11), after reproducing all six variants on spark.
Summary. squirrel 0.0.108 in --http mode reports 1 focusable element(s) inside aria-hidden for a button inside a container hidden by display:none or visibility:hidden. The same button without hiding is correctly reported; HTML hidden, inert and disabled controls are not reported. This reproduction covers static CSS declared in the document, not JavaScript-driven visibility changes.
Live examples (2026-10-11). https://www.delife.bg/: reported a#geolocationModalAccept belongs to .modal.fade[aria-hidden=true]; in the loaded browser it has zero client rectangles because the closed modal has no layout. https://david-dorfmueller.de/: the reported scroll-up submit button has computed visibility:hidden. These examples show candidates for this defect, not proof that all findings on either site are false positives.
Repro. Save as hidden-focus-repro.cjs:
const http=require('node:http');const variants={'/bad.html':'<div aria-hidden="true"><button>Close</button></div>','/display-none.html':'<style>.modal{display:none}</style><div class="modal" aria-hidden="true"><button>Close</button></div>','/hidden.html':'<div hidden aria-hidden="true"><button>Close</button></div>','/visibility-hidden.html':'<style>.modal{visibility:hidden}</style><div class="modal" aria-hidden="true"><button>Close</button></div>','/inert.html':'<div inert aria-hidden="true"><button>Close</button></div>','/disabled.html':'<div aria-hidden="true"><button disabled>Close</button></div>'};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>Hidden focus fixture</title></head><body><h1>Fixture</h1>'+(variants[req.url]??'Fixture')+'</body></html>')}).listen(8768,'127.0.0.1');node hidden-focus-repro.cjsIn another terminal:
squirrel --version
for variant in bad display-none hidden visibility-hidden inert disabled; do
squirrel audit "http://127.0.0.1:8768/$variant.html" --http --refresh -m 1 -f json -o "$variant.json" --rule-include a11y/aria-hidden-focus
doneActual (spark-onedot, 2026-10-11): every fixture crawled 1 page on 0.0.108. bad, display-none, visibility-hidden each emit a11y/aria-hidden-focus, check aria-hidden-focus, status fail, message 1 focusable element(s) inside aria-hidden. hidden, inert, disabled each emit issues: [].
Expected: preserve the finding for bad. CSS-hidden controls cannot enter sequential focus navigation; do not present them as proven focusable. If HTTP mode cannot determine the applicable CSS, report that limitation or an unconfirmed candidate rather than a conformance failure. Do not suppress off-screen but focusable content or assume a closed dialog remains hidden after interaction.
Reference: W3C ACT rule 6cfa84, especially Passed Example 2 and the CSS Styling input aspect.
Acceptance Criteria
- In
--httpmode, a control inside anaria-hiddencontainer hidden by staticdisplay:noneorvisibility:hidden(inline style or a document<style>rule) is not reported as a focusable failure. - The visible
badfixture is still reported;hidden,inertanddisabledfixtures still pass. - When the applicable CSS cannot be determined in HTTP mode, the finding is marked unconfirmed (or skipped with a stated limitation), not a conformance failure.
- Off-screen but focusable content is still reported.
- The CSS-hidden check is shared with
a11y/button-name(a11y/button-name: hidden controls reported as unnamed buttons #665), not duplicated. - Tests cover the six fixtures from the repro.
Activity
nc9 commentedon Oct 11, 2026
Thanks Denis. Confirmed on current main:
a11y/aria-hidden-focusalready skipsinertandhiddenancestors, but nothing looks at static CSS, sodisplay:noneandvisibility:hiddencontainers are reported in HTTP mode. Triaged as a bug (P2), size M, area rules. I added acceptance criteria. #664 and #665 need the same "removed from the accessibility tree by static CSS" helper, so I'll queue them together and share it. Where HTTP mode cannot tell, the finding should say so rather than claim a failure.nc9 commentedon Oct 11, 2026
Reproduced on 0.0.108 with the repro script (port changed).
bad,display-noneandvisibility-hiddeneach givea11y/aria-hidden-focus, checkaria-hidden-focus, statusfail,1 focusable element(s) inside aria-hidden.hidden,inertanddisabledpass.origin/main still has this:
isOutOfFocusTreeinpackages/rules/src/a11y/aria-hidden-focus.tschecks onlyinertandhidden. There is already a markup-only helper,isHiddenFromMarkupinpackages/parser/src/hidden-markup.ts(used bya11y/empty-heading), but it reads inlinestyleonly, not<style>rules, so it would not clear thedisplay-noneorvisibility-hiddenfixtures as written.fix(rules): stop expanding CSS nesting, count pseudo arguments, keep …
fix(rules): read comment-led and semicolon-bearing at-rule preludes a…
fix(rules): check descendants of a focusable container CSS hides #664
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: aria-hidden-focus no longer reports controls hidden by markup (hidden attribute, closed dialog, popover, template) or by a plainly written inline display:none or visibility:hidden. Hiding by <style> rules and external stylesheets is not evaluated yet, so the display-none and visibility-hidden fixtures from this issue still report. That part 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 #678