Ver Fonte

LibWeb: Add tests for animating unresolved properties

Matthew Olsson há 1 ano atrás
pai
commit
6bf1a30bf5

+ 1 - 0
Tests/LibWeb/Text/expected/WebAnimations/misc/animating-unresolved-properties-crash.txt

@@ -0,0 +1 @@
+   PASS! (Didn't crash)

+ 1 - 0
Tests/LibWeb/Text/expected/css/animating-unresolved-properties-crash.txt

@@ -0,0 +1 @@
+   PASS! (Didn't crash)

+ 23 - 0
Tests/LibWeb/Text/input/WebAnimations/misc/animating-unresolved-properties-crash.html

@@ -0,0 +1,23 @@
+<!-- https://github.com/SerenityOS/serenity/issues/23609 -->
+<style>
+    :root {
+        --accent: #00f;
+    }
+</style>
+<div id="foo"></div>
+<script src="../../include.js"></script>
+<script>
+    asyncTest(done => {
+        document.getElementById("foo").animate({
+            borderTop: ['2px solid var(--accent)'],
+        }, {
+            duration: 1000,
+            iterations: Infinity,
+        });
+
+        requestAnimationFrame(() => {
+            println("PASS! (Didn't crash)");
+            done();
+        });
+    });
+</script>

+ 26 - 0
Tests/LibWeb/Text/input/css/animating-unresolved-properties-crash.html

@@ -0,0 +1,26 @@
+<!-- https://github.com/SerenityOS/serenity/issues/23609 -->
+<style>
+    :root {
+        --accent: #00f;
+    }
+
+    @keyframes myMove {
+        0% {
+            border-top: 2px solid var(--accent);
+        }
+    }
+
+    div {
+        animation: myMove 1s infinite;
+    }
+</style>
+<div></div>
+<script src="../include.js"></script>
+<script>
+    asyncTest(done => {
+        requestAnimationFrame(() => {
+            println("PASS! (Didn't crash)");
+            done();
+        });
+    });
+</script>