Tests/LibWeb: Wait for feImage resources before switching filters

Wait for load before the existing animation-frame sequence so fetching
and decoding finish before the repaint test runs. Keep its four frames
and completion behavior unchanged.
This commit is contained in:
Andreas Kling authored and Andreas Kling committed 2026-10-28 09:15:57 +01:00
1 parent ba8c812a72
commit 3f2a351643
1 file changed
+10 -7
Notes: github-actions[bot] 2026-10-28 08:18:06 +00:00
@@ -18,18 +18,21 @@
</filter>
</svg>
<script>
requestAnimationFrame(() => {
// NB: feImage fetching and decoding delay load; animation frames alone do not wait for those resources.
addEventListener("load", () => {
requestAnimationFrame(() => {
filtered.style.filter = "url(#green-image)";
requestAnimationFrame(() => {
filtered.style.filter = "url(#green-image)";
requestAnimationFrame(() => {
if (window.internals)
internals.signalTestIsDone("PASS");
else
document.documentElement.classList.remove("reftest-wait");
requestAnimationFrame(() => {
if (window.internals)
internals.signalTestIsDone("PASS");
else
document.documentElement.classList.remove("reftest-wait");
});
});
});
});
});
}, { once: true });
</script>
</html>