fix(core): motion blur no longer blacks out videos inside sub-compositions (#6252)

* fix(core): motion blur no longer blacks out videos inside sub-compositions

* chore(core): drop the explanatory comment from the motion blur isolate move
This commit is contained in:
Miguel Ángel
2026-10-24 22:35:57 +00:00
committed by GitHub
parent e586922cd1
commit b97de59c84
2 changed files with 16 additions and 1 deletions
@@ -705,6 +705,20 @@ describe("two-phase frames", () => {
expect(el.hasAttribute(MOVER)).toBe(false);
});
it("keeps the page visible until an engine frame is armed, so video frames inject into it", async () => {
installHtmlInCanvas();
const { root, h } = movingHost();
initCaptureMotionBlur(h);
const done = paintCaptureMotionBlur(0.5, { engineMode: true });
expect(root.hasAttribute(ONLY)).toBe(false);
releaseCaptureMotionBlurFrame();
expect(root.hasAttribute(ONLY)).toBe(true);
captureCanvas(root).dispatchEvent(new Event("paint"));
captureCanvas(root).dispatchEvent(new Event("paint"));
win.__hf_page_composite_resolve?.();
await done;
});
it("shows plain DOM, not a half frame, when the engine's step runs before the background capture", async () => {
installHtmlInCanvas();
const { root, el, h } = movingHost();
@@ -527,7 +527,7 @@ function createInstance(host: CaptureMotionBlurHost, config: Config, form: HtmlI
resolve();
},
};
if (pending.phase === "movers") isolate(pending);
if (pending.phase === "movers" && !engineMode) isolate(pending);
if (engineMode) return;
startTimer();
src.requestPaint();
@@ -576,6 +576,7 @@ function createInstance(host: CaptureMotionBlurHost, config: Config, form: HtmlI
arm: () => {
if (!pending || pending.armed) return;
pending.armed = true;
if (pending.phase === "movers") isolate(pending);
pending.startTimer();
src.requestPaint();
},