Skip to content

Truly independent web browser

Tests/LibWeb: Wait for feImage resources before switching filters

Andreas Kling3f2a351643c0
diff --git a/Tests/LibWeb/Ref/input/css/filter-url-feimage-switch-without-relayout.html b/Tests/LibWeb/Ref/input/css/filter-url-feimage-switch-without-relayout.html
index 4aa3d81e173..3dce54a5315 100644
--- a/Tests/LibWeb/Ref/input/css/filter-url-feimage-switch-without-relayout.html
+++ b/Tests/LibWeb/Ref/input/css/filter-url-feimage-switch-without-relayout.html
@@ -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>