Repository navigation
fix(cli): check's overlap audit skips scenes the runtime hid - #5758
Merged
Merged
Conversation
5 tasks done
jrusso1020
approved these changes
Oct 17, 2026
jrusso1020
left a comment
Collaborator
There was a problem hiding this comment.
Approving at b73c7842. Skipping runtime-hidden clips changes no finding, because nothing inside such a clip can paint.
- Selector check.
RUNTIME_HIDDEN_CLIPis the same selector as core'sHIDE_HIDDEN_CLIP_CONTENTSintimedClipHide.ts:[data-hf-clip-hidden][style*="visibility: hidden"] * { visibility: hidden !important; }. That rule hides every descendant of such a clip. - Temporary unhide. The helper in the same file sets hidden clips to
visibility: visiblefor a moment. The attribute then no longer matches, so the walk still visits them during that window. That's consistent with what is actually on screen. - Author-hidden ancestors. One without the runtime marker is still walked, so
visibility_escapes_segmentkeeps its behaviour. - Traversal.
FILTER_REJECTskips the whole subtree. The walker never filters the root itself, which is right for a root that's an audit scope. - Test. It asserts both an empty result and that
getComputedStylenever sees#a, so it would catch the walk regressing to the whole page.
Non-blocking: a descendant with an inline visibility: visible !important inside a runtime-hidden clip beats the stylesheet !important, so it would paint and now go unaudited. That's an author-level edge case. The skip should still be right for every composition the runtime produces.
No live run.
— Rames
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What
check's content-overlap audit no longer walks inside scenes the runtime has hidden. On a long composition, almost every element sits in a scene that is off screen at any given sample, and the audit was reading styles and geometry for all of them on every sample.Why
The dense overlap pass seeks to up to 600 times and runs this audit at each one. The audit walked
root.querySelectorAll("*"), so its cost per sample grew with the length of the film, not with what was on screen. On a 9-minute composition with about 430 scenes, 7,348 of 7,806 elements were inside runtime-hidden clips at a typical sample, andcheckran past its deadline. In a CPU profile of 100 samples, the per-element visibility test in this audit was the largest single cost.The runtime hides an inactive clip with
data-hf-clip-hiddenplus inlinevisibility: hidden. Its rule[data-hf-clip-hidden][style*="visibility: hidden"] * { visibility: hidden !important; }(coretimedClipHide.ts) keeps every descendant hidden. So nothing inside such a clip can be on screen, and skipping the subtree changes no finding.Related work
Part of making
check's browser work independent of film length. Bounding the number of dense overlap samples follows in a separate PR.How
elementsOnScreenScenes(root)walks with aTreeWalkerthat rejects runtime-hidden clips, so their subtrees are never visited. It matches the same selector as the runtime rule.collectSolidTextBlocksuses it. That is the walk behind__hyperframesOverlapAudit(every dense sample) and the overlap part of the full layout audit.visibility_escapes_segmentbehaves as before (its existing test is unchanged and passes).Test plan
never reads inside a scene the runtime hid: the overlap audit returns nothing and never reads styles of an element inside a runtime-hidden clip. With the walk put back to the whole page, it fails (expected [ { …(9) } ] to deeply equal []).layout-audit.browser.test.tspasses 3 runs in a row. oxlint and oxfmt are clean.checkon the 9-minute composition, before and after, gives identical layout findings (80 of 80, same code, selector and time). The audit's share of the overlap pass dropped 2-3x. Wall times were taken on a loaded machine and are not quoted.