You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
a11y style reader: a page over a limit goes all-unknown too broadly; count only rules that can hide #1027
Since #1020, an a11y style reader that gives up (over the 5,000-rule cap, over the 256 KB style-text cap, an over-long selector, the entry cap, a non-ASCII space, or a nested rule) reads EVERY element as unknown. That is sound but too broad: caps count things that cannot hide anything, so harmless pages go all-unknown.
Observed in review of #1020: a 300 KB comment plus one .gone{display:none}, or 5,100 colour-only rules, makes every element unknown. Visible unnamed controls then go from a fail to a -unconfirmed warning, and scores go up.
Narrow the caps to what matters:
Count the style characters after stripping comments and url(data:...) blobs (inlined fonts and images), not before.
Cap only rules that can set display, visibility or an animation (the reader's existing MAY_SET relevance), not every rule. parseRules is linear, so its own rule cap can rise.
Keep a give-up sound: when it still has to give up, an element stays unknown, never shown.
Related: per packages/core-contracts/src/resolution.ts (~:204, pub#935) a <check>-unconfirmed row counts as evaluated, so a prior real failure on a page that newly crosses a cap shows as resolved. Narrowing the caps makes that case rarer; whether an over-cap -unconfirmed should carry a prior failure instead is worth deciding here.
Acceptance Criteria
A page with a 300 KB comment or a base64 font blob plus real hiding rules reads like the same page without them.
A page with 5,100 colour-only rules (no display, visibility or animation) does not make any element unknown.
A page with more than the cap of rules that CAN set display or visibility still reads every element unknown, never shown (test at 4,900, 5,000 and 5,100 hiding rules).
The decision on a prior failure under a newly crossed cap is documented and tested.
Reading time stays flat on the over-cap page (no quadratic work); CHANGELOG entry and the "What squirrel can see" docs updated.
Prior art for the nested-rule part: #1014 (by @dbdefault) takes a narrower approach, marking only the outer-selector subjects unconfirmed when a nested body sets display or visibility, instead of reading every element unknown. That is the direction to follow for nested rules here: nested style rules can also reach descendants and siblings of the outer subject, so the outer subject is a floor, not the whole reach, and the narrowing needs a sound bound on what & and the nested combinators can reach before it can replace the all-unknown give-up.
Activity
nc9 commentedon Oct 22, 2026
Prior art for the nested-rule part: #1014 (by @dbdefault) takes a narrower approach, marking only the outer-selector subjects unconfirmed when a nested body sets
displayorvisibility, instead of reading every element unknown. That is the direction to follow for nested rules here: nested style rules can also reach descendants and siblings of the outer subject, so the outer subject is a floor, not the whole reach, and the narrowing needs a sound bound on what&and the nested combinators can reach before it can replace the all-unknown give-up.fix(rules): a page past the style reader's limits reads every element…
nc9 commentedon Oct 26, 2026
Fixed in #1015 (main f4152b3): a page past the style reader's limits reads every element as unknown, never shown.