From 644b166e78c40fa527715cb843adf1c0ddf9182c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Miguel=20=C3=81ngel?= Date: Thu, 5 Nov 2026 15:46:41 +0000 Subject: [PATCH] fix(cli): check sees an SVG stroke drawing on, so it no longer calls it a dead stretch (#7250) --- .../motion-signature.browser.chromium.test.ts | 15 +++++++++++++++ .../cli/src/commands/motion-signature.browser.js | 9 ++++++++- 2 files changed, 23 insertions(+), 1 deletion(-) diff --git a/packages/cli/src/commands/motion-signature.browser.chromium.test.ts b/packages/cli/src/commands/motion-signature.browser.chromium.test.ts index 54c8c4b9c0..6c2a680466 100644 --- a/packages/cli/src/commands/motion-signature.browser.chromium.test.ts +++ b/packages/cli/src/commands/motion-signature.browser.chromium.test.ts @@ -346,6 +346,21 @@ describe.skipIf(!RUNS_CHROMIUM)("motion-signature.browser in Chromium", () => { expect(after.liveness).not.toBe(before.liveness); }); + it("sees an SVG stroke drawing on, which moves no box and no color", async () => { + await load( + composition( + "", + '', + ), + ); + const before = await sample(); + await mutate('document.getElementById("line").style.strokeDashoffset = "300"'); + const after = await sample(); + + expect(after.sweep).not.toBe(before.sweep); + expect(after.liveness).not.toBe(before.liveness); + }); + it("sees an SVG shape's fill color change", async () => { await load( composition( diff --git a/packages/cli/src/commands/motion-signature.browser.js b/packages/cli/src/commands/motion-signature.browser.js index 9521ad8016..f69647b387 100644 --- a/packages/cli/src/commands/motion-signature.browser.js +++ b/packages/cli/src/commands/motion-signature.browser.js @@ -171,7 +171,14 @@ const values = STROKE_EDGES.map((edge) => drawnColor(ctx.style, edge)); return values.some(Boolean) ? hashFields(values) : ""; } - const contentPaintChannel = paintChannel(["color", "textShadow", "fill", "stroke"]); + const contentPaintChannel = paintChannel([ + "color", + "textShadow", + "fill", + "stroke", + "strokeDashoffset", + "strokeDasharray", + ]); // Direct text nodes only: descendants are signed separately, and a hidden // descendant's text mutation must not masquerade as visible motion.