Skip to content

Commit 5addb18

Browse files
committed
chore(core): keep the comment share of the first-pass hide files at or under their base
The comment ratchet counts one added comment line each in entry.ts, init.ts and capture.ts, and a new file above its package's share. The three lines are gone, and the one note that has to stay (why the hide runs at script evaluation) now lives in the new module's shorter header.
1 parent 01202ed commit 5addb18

4 files changed

Lines changed: 4 additions & 7 deletions

File tree

‎packages/core/src/runtime/entry.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,6 @@ type HyperframeWindow = Window & {
2929
// at script evaluation time, while the document is still parsing.
3030
installAuthoredOpacityCapture();
3131

32-
// Also at evaluation time: the body is parsed, and may paint, before init runs at DOMContentLoaded.
3332
hideTimedClipsUntilFirstPass();
3433

3534
// Expose runtime helpers immediately so composition scripts can use them

‎packages/core/src/runtime/init.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2532,7 +2532,6 @@ export function initSandboxRuntimeModular(): void {
25322532
timedClipDisplayNoneApplied.add(rawNode);
25332533
}
25342534
}
2535-
// Grading registers only media it can see, and media inside a clip was hidden until now.
25362535
if (decidedTimedClip && revealTimedClipsAfterFirstPass()) colorGradingRuntime?.refresh();
25372536
// Only when a `data-hidden` mutation actually moved something: the skips
25382537
// this reschedule exists to re-run are what change the active set, so

‎packages/core/src/runtime/timedClipHide.ts‎

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
// Until the first visibility pass decides each timed clip, a paused page would paint every clip at once
2-
// (and decode every scene's images). Media is left out: init's media pass owns it.
3-
// The rule and its flag live on the page, not in this module: every runtime copy on the page shares them.
1+
// Hides timed non-media clips from script evaluation until the first visibility pass decides them;
2+
// before it, a paused page painted every clip at once. Media is left to init's media pass.
3+
// The rule and its flag live on the page, so every runtime copy shares them.
44
const HIDE_ATTR = "data-hf-first-pass-hide";
55
const HIDE_UNTIL_FIRST_PASS =
66
"[data-start]:not(video, audio, img) { visibility: hidden !important; }";
@@ -24,7 +24,7 @@ export function hideTimedClipsUntilFirstPass(): void {
2424
win.__hfFirstPassHidden = true;
2525
}
2626

27-
/** True when this call lifted the rule. */
27+
/** True when this call lifted the rule; callers then re-register what skipped hidden elements (grading). */
2828
export function revealTimedClipsAfterFirstPass(): boolean {
2929
const win = window as FirstPassWindow;
3030
if (!win.__hfFirstPassHidden) return false;

‎packages/shader-transitions/src/capture.ts‎

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,6 @@ export function forceSceneVisibleInClone(source: HTMLElement, cloneDoc: Document
5555
if (!(clone instanceof HTMLElement)) return;
5656

5757
clone.style.opacity = "1";
58-
// Important: the runtime hides timed clips with an !important rule until its first visibility pass.
5958
clone.style.setProperty("visibility", "visible", "important");
6059
clone.querySelectorAll<HTMLElement>("[data-start]").forEach((el) => {
6160
el.style.setProperty("visibility", "visible", "important");

0 commit comments

Comments
 (0)