fix(cli): check sees an SVG stroke drawing on, so it no longer calls it a dead stretch (#7250)

This commit is contained in:
Miguel Ángel
2026-11-05 15:46:41 +00:00
committed by GitHub
parent 0a6746e1d6
commit 644b166e78
2 changed files with 23 additions and 1 deletions
@@ -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(
"",
'<svg width="400" height="200"><path id="line" d="M10 150 C 100 10, 300 10, 390 150" fill="none" stroke="#111" stroke-width="8" stroke-dasharray="600" stroke-dashoffset="600" /></svg>',
),
);
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(
@@ -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.