Skip to content

fix(rules): a CSS-nesting rule that may hide an element reads unknown, with Chromium rows #1013 - #1030

Closed
nc9 wants to merge 2 commits into
mainfrom
fix/1013-css-nesting
Closed

nc9 wants to merge 2 commits into
mainfrom
fix/1013-css-nesting

Conversation

@nc9

@nc9 nc9 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Repro and the nesting shapes from #1014 by @dbdefault.

The reader code change for this issue landed with #1020: a rule nested inside a style rule made the reader give up, and giving up now reads every element as unknown, never shown. This PR adds what #1013 asks for on top: the Chromium evidence, the invariant test and the docs. (Replaces #1022, which GitHub closed when its stacked base branch was deleted on merge.)

  • packages/rules/tests/fixtures/static-hidden-chromium.json: 13 nesting: rows, each rendered in headless Chromium at 1024px (the repro, @supports, & with a descendant, implicit &, & alone, a hiding outer rule beside a nested one, a nested sibling combinator, nested visibility, nesting inside an at-rule, and the four shown cases: nested rule that sets neither property, &:hover, a nested rule reaching another element, a false nested @media).
  • packages/rules/tests/static-hidden.test.ts: a new invariant, never shown where Chromium hides a nesting: element (all 9 hidden rows; they fail without fix(rules): a page past the style reader's limits reads elements as unknown, not shown #1015 #1020), plus a nested rule that sets neither property keeps shown and an unnested rule keeps hidden. The existing "never hidden where Chromium shows" invariant covers the 4 shown rows.
  • Docs: the "What squirrel can see" section of the 7 a11y pages that carry it names CSS nesting explicitly; CHANGELOG bullet.

Tests: static-hidden 371 pass (11 fail with #1020's change reverted); tsgo clean in packages/rules; tangly check --strict clean. Rows were generated with headless Chromium (script kept in ops scratch, not committed).

Tradeoff, same as #1020: the reader does not narrow nested rules to the elements they reach, so a page with a nested display/visibility rule reads all its elements as unconfirmed.

Agent skill (squirrelscan/skills): not needed.

Closes #1013

@claude

claude Bot commented Oct 22, 2026

Copy link
Copy Markdown

Review of #1030. It adds tests, Chromium fixture rows and docs on top of the reader change that landed in #1020. I read the diff only and did not run the tests.

I found no correctness, security or performance problems. The diff touches no source files, so the risk is low.

  • (low) packages/rules/tests/static-hidden.test.ts: the new nesting: describe block only asserts the hidden rows. The four shown rows are covered by the existing "never hidden where Chromium shows" invariant, but only if that loop doesn't filter by name prefix. Please confirm it picks up the nesting: rows. If it doesn't, those four rows are unasserted.
  • (low) The docs, in all 7 pages, say a nested display/visibility rule leaves "the elements it could reach" unconfirmed. The PR description says the reader doesn't narrow nested rules, so every element on the page reads unconfirmed. Wording like "every element on the page" would match the behaviour and avoid suggesting scoping that doesn't exist.
  • (nit) The generator script for the Chromium rows is not committed ("ops scratch"). That makes it harder to regenerate or extend the fixtures later. Consider linking it or noting the Chromium version in the fixture header.
  • (nit) The same paragraph is copy-pasted across 7 mdx files. This follows the existing pattern, but a shared snippet would reduce drift.

nc9 added a commit that referenced this pull request Oct 22, 2026
…nt, skip reasons, link phrases (#1034)

Batch of six reviewed PRs landed through one branch and one CI run:
- #1032 Bun 1.4.4 pin (CA blocklist for the eight compromised eMudhra intermediates, NSS 3.131.1 roots)
- #1030 nested CSS evidence for the style reader (repro from #1014 by @dbdefault)
- #1025 page-intrinsic skips use a not-applicable reason so priors resolve
- #1019 generic link phrases in ten more languages for link-text and anchor-text
- #1021 content/word-count skips noindex pages
- #1023 retirement of abandoned crawls uses the crawl lease
Plus a test fix for the residency probe on Bun 1.4.4 linux-x64.

Closes #840
Closes #946
Closes #1011
Closes #1013
Refs #841

Signed-off-by: Nik Cubrilovic <[email protected]>
@nc9

nc9 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor Author

Landed through integration PR #1034 (squash merge 4dc22a9 on main), released in v0.0.128. Closing as superseded.

@nc9 nc9 closed this Oct 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

a11y style reader: a nested CSS rule that hides an element reads as shown, not unknown

1 participant