fix(core): the filter tier's svg no longer changes which child is last in the root (#7293)

Co-authored-by: Claude Sonnet 5.5 <noreply@anthropic.com>
This commit is contained in:
Vance Ingalls
2026-11-06 04:33:20 +00:00
committed by GitHub
co-authored by Claude Sonnet 5.5
parent cd7e93baa0
commit 2066a2ff54
4 changed files with 20 additions and 8 deletions
@@ -163,7 +163,7 @@ export function createFilterTier(
defs.setAttribute("data-hf-ignore", "");
defs.style.cssText = "position:absolute;left:0;top:0;pointer-events:none";
node(defs, "defs", {});
root.append(defs);
document.documentElement.append(defs);
}
layer = buildLayer(defs.querySelector("defs") ?? defs, layers.size, el);
layers.set(el, layer);
@@ -2120,6 +2120,25 @@ describe("filter fallback", () => {
expect(h.seek.mock.calls.every(([, suppress]) => suppress === true)).toBe(true);
});
it("keeps the filter tier's svg out of the root and removes it on teardown", () => {
const { root, h } = movingHost();
const svgs = () => document.querySelectorAll("svg[data-hf-ignore]").length;
initCaptureMotionBlur(h);
void paintCaptureMotionBlur(0.5, PLAY);
expect(root.querySelector("svg[data-hf-ignore]")).toBeNull();
expect(svgs()).toBe(1);
initCaptureMotionBlur({ ...h, timeline: () => "tl2" });
void paintCaptureMotionBlur(0.6, PLAY);
expect(svgs()).toBe(1);
const next = movingHost();
initCaptureMotionBlur(next.h);
void paintCaptureMotionBlur(0.5, PLAY);
expect(next.root.querySelector("svg[data-hf-ignore]")).toBeNull();
expect(svgs()).toBe(1);
resetCaptureMotionBlurForTests();
expect(svgs()).toBe(0);
});
it("removes its filters and its SVG on teardown", () => {
const { el, h } = movingHost();
initCaptureMotionBlur(h);
@@ -58,7 +58,6 @@ export const SWEEP_SYMPTOMS = {
F_CAPTURE: 40.62,
F_FILTER: 126.54,
H: 135.67,
I: 53.63,
J: 25.79,
K: MEASURED_ORACLE_SMALLEST_SYMPTOM,
M: 18.31,
@@ -184,12 +184,6 @@ const CASES: readonly SweepCase[] = [
tier: "filter",
frame: 11,
check: "outside",
bug: {
finding: "I",
reason: "the filter tier's svg becomes the root's last child, so :last-child moves to it",
regions: [rect(0, 0, 0, 0), rect(494, 14, 112, 62)],
measuredMae: S.I,
},
},
{
fixture: "overflow-card",