Repository navigation
Conversation
NianJiuZst
left a comment
There was a problem hiding this comment.
LGTM, approving.
Putting the content-visibility: hidden check in the existing isSubtreeHidden ancestor walk is the right place. It covers text, links, discovery and explicit table/list targets in one spot, and the result is cached per element like the other hidden checks. The tests also cover two cases I'd have asked for: a descendant can't opt back in with content-visibility: visible / visibility: visible, and offscreen content-visibility: auto content stays extractable.
What I checked:
- Ran
src/tools/extract/withBSK_CLICK_CHROMEagainst Chromium 141: 42/42 pass, including the 3 new real-browser cases. - Swapped
main'scollector.tsback in with the new tests: 4 tests fail (3 real-browser plus the happy-domhiddencase), so the tests catch the bug. - Biome is clean on the changed files. CI already runs
extract.browser.test.tsin real Chrome, so the display-type exemptions will keep being checked against the browser.
Nit (non-blocking): the display-type regex is hard to read inline. Consider pulling it into a named constant with a short comment or a link to the CSS Containment spec section on which boxes it doesn't apply to, so future edits know where the list comes from.
Bug
bsk extractincludes text and links from subtrees hidden with CSScontent-visibility: hidden. Discovery also returns tables and lists inside those subtrees, and explicit extraction accepts them instead of returningextract_target_hidden.For example, extracting this table currently returns
Visible\nHidden text:Chrome renders only
Visible. The collector already excludes display-none and zero-opacity subtrees, but its cached ancestor check does not handle content visibility.Fix
Add the missing rule to that existing ancestor check. Preserve rendered content on display types where Chromium ignores the property, and keep offscreen
content-visibility: autocontent extractable. No protocol, dependencies or page mutations are added.Verification
d87ca6798b647107a3c7bbf79902397e72e90269with two workers; all 11 real-Chrome extraction tests also passed in a separate opt-in run.The browser suite serializes the production collector into an isolated renderer world; it is not an installed-extension CLI end-to-end run. Other opt-in browser suites and Rust tests were not run. The DSH runtime suite was subsequently checked: 536 passed, 2 failed. An isolated checkout of unchanged base
d9a78aed47874459ae1e44523a597e42dd9acf99, using the same dependencies and two workers, has the same 536 passed, 2 failed result. Both failures are the existing runner kill-grace cases (settles after the kill grace when neither exit nor close ever firesandsettles killAll and killFor children that never report back); this PR does not change the DSH package. This does not claim the fullpnpm lintcommand passed.Implemented and tested with assistance from OpenAI Codex. No independent human review is claimed.