Skip to content

fix(rules): nested CSS that hides reads as unknown, not shown - #1014

Closed
dbdefault wants to merge 1 commit into
squirrelscan:mainfrom
dbdefault:oss100-1013-fix
Closed

dbdefault wants to merge 1 commit into
squirrelscan:mainfrom
dbdefault:oss100-1013-fix

Conversation

@dbdefault

Copy link
Copy Markdown

Summary

Fixes #1013

A nested rule such as b { @media (min-width: 0) { display: none } } used
to empty the style index, so the element read as shown. Nested CSS is not
read: mark the sheet unread and leave the outer selector's subjects
unconfirmed when the nested body sets display or visibility.

Verification

Run on Linux with bun:

  • bun test packages/rules/tests/static-hidden.test.ts: 320 pass. With the page-styles.ts change reverted, the new test fails (319 pass, 1 fail).
  • bun test in packages/rules: 7306 tests, 0 fail.

Checklist

  • I added or updated tests for behavioral changes.
  • I did not include secrets, customer data, or incompatible third-party material.
  • Every commit includes a DCO Signed-off-by line (git commit -s).

Prepared with AI assistance; reviewed and tested by me before submitting.

A nested rule such as `b { @media (min-width: 0) { display: none } }` used
to empty the style index, so the element read as shown. Nested CSS is not
read: mark the sheet unread and leave the outer selector's subjects
unconfirmed when the nested body sets display or visibility.

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

nc9 commented Oct 22, 2026

Copy link
Copy Markdown
Contributor

Thanks for this, and for the Chromium-checked repro: it is exactly the case in #1013. Timing note: #1015 (the same reader giving up on a page and answering "shown") was being fixed at the same moment, and that fix (#1020) makes every give-up path, including a rule nested inside a style rule, read as unknown. Your repro and the Chromium rows from this PR are carried into the stacked #1022, which closes #1013.

Your approach is narrower than ours: it leaves only the outer selector's subjects unconfirmed instead of the whole page. That is the direction we want next (there is a follow-up issue for narrowing the over-cap and nested cases without losing soundness). Once #1020 and #1022 are in, would you like to rebase this PR as that narrowing step on top of them? If so, we will review it with the same Chromium invariant table. If not, no worries: we will credit you in the changelog for the repro.

@dbdefault

Copy link
Copy Markdown
Author

Thanks @nc9. I compared this PR against main after #1020 merged, and I'm closing it instead of rebasing it as the narrowing step.

A changelog credit for the repro, as you offered, would be appreciated. Thanks for the careful review.

@dbdefault dbdefault closed this Oct 22, 2026
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]>
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

2 participants