summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/web-animations/crashtests
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/web-animations/crashtests')
-rw-r--r--testing/web-platform/tests/web-animations/crashtests/get-computed-timing-crash.html20
-rw-r--r--testing/web-platform/tests/web-animations/crashtests/infinite-active-duration.html68
-rw-r--r--testing/web-platform/tests/web-animations/crashtests/partially-overlapping-animations-one-not-current-001.html17
-rw-r--r--testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-001.html40
-rw-r--r--testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-002.html44
5 files changed, 189 insertions, 0 deletions
diff --git a/testing/web-platform/tests/web-animations/crashtests/get-computed-timing-crash.html b/testing/web-platform/tests/web-animations/crashtests/get-computed-timing-crash.html
new file mode 100644
index 0000000000..b666eea91f
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/crashtests/get-computed-timing-crash.html
@@ -0,0 +1,20 @@
+<!DOCTYPE html>
+<html>
+<title>GetComputedTiming on an animation without an execution context,
+timeline or playback rate</title>
+<link rel="author" title="Google" href="http://www.google.com/">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1318012">
+<meta name="assert" content="This should not crash.">
+<body>
+ <div id="target"></div>
+ <iframe id="iframe"></iframe>
+</body>
+<script type="text/javascript">
+ const keyframeEffect = new KeyframeEffect(target, { opacity: [1, 1] });
+ const anim = new iframe.contentWindow.Animation(keyframeEffect, null);
+ anim.play();
+ anim.playbackRate = 0;
+ document.body.removeChild(iframe);
+ anim.effect.getComputedTiming();
+</script>
+</html>
diff --git a/testing/web-platform/tests/web-animations/crashtests/infinite-active-duration.html b/testing/web-platform/tests/web-animations/crashtests/infinite-active-duration.html
new file mode 100644
index 0000000000..f92cd13942
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/crashtests/infinite-active-duration.html
@@ -0,0 +1,68 @@
+<!DOCTYPE html>
+<title>Various test cases producing infinite active duration</title>
+<link rel="help" href="https://drafts.csswg.org/css-animations-1/#animation-iteration-count" />
+<script>
+ let effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, delay: -17592186044416, iterations: Infinity });
+ effect.getComputedTiming();
+
+ // Infinity delay + Infinity active duration
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, delay: Number.MAX_VALUE, iterations: Infinity });
+ effect.getComputedTiming();
+
+ // Infinity end delay + Infinity active duration
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, endDelay: Number.MAX_VALUE, iterations: Infinity });
+ effect.getComputedTiming();
+
+ // Infinity delay + Infinity active duration + Infinity end delay
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1,
+ delay: Number.MAX_VALUE, endDelay: Number.MAX_VALUE,
+ iterations: Infinity });
+ effect.getComputedTiming();
+
+ // -Infinity delay + Infinity active duration
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, delay: -Number.MAX_VALUE, iterations: Infinity });
+ effect.getComputedTiming();
+
+ // -Infinity end delay + Infinity active duration
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, endDelay: -Number.MAX_VALUE, iterations: Infinity });
+ effect.getComputedTiming();
+
+ // -Infinity delay + Infinity active duration + -Infinity end delay
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1,
+ delay: -Number.MAX_VALUE, endDelay: -Number.MAX_VALUE,
+ iterations: Infinity });
+ effect.getComputedTiming();
+
+ // -Infinity delay + finite active duration
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, delay: -Number.MAX_VALUE, iterations: 1 });
+ effect.getComputedTiming();
+
+ // -Infinity end delay + finite active duration
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, endDelay: -Number.MAX_VALUE, iterations: 1 });
+ effect.getComputedTiming();
+
+ // very large iterations
+ effect = new KeyframeEffect(null,
+ { opacity: [0, 1] },
+ { duration: 1, delay: 281474976710655, iterations: 18014398509481984 });
+ effect.getComputedTiming();
+
+</script>
diff --git a/testing/web-platform/tests/web-animations/crashtests/partially-overlapping-animations-one-not-current-001.html b/testing/web-platform/tests/web-animations/crashtests/partially-overlapping-animations-one-not-current-001.html
new file mode 100644
index 0000000000..b943514f42
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/crashtests/partially-overlapping-animations-one-not-current-001.html
@@ -0,0 +1,17 @@
+<!DOCTYPE html>
+<html>
+<title>CSS Test (Animations): Reparenting an element with a web animation on the compositor</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/">
+<link rel="author" title="Google" href="http://www.google.com/">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1319304">
+<meta name="assert" content="This should not crash.">
+
+<script>
+window.onload = function(){
+ let div = document.querySelector("div");
+ let a1 = div.animate([{"transform": "translateX(10px)", "opacity": "0.4"}], { duration: 1000 });
+ a1.reverse();
+ let a2 = div.animate([{"transform": "translateY(10px)"}], { duration: 1000 });
+}
+</script>
+<div>X</div>
diff --git a/testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-001.html b/testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-001.html
new file mode 100644
index 0000000000..49ee9c433c
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-001.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html class="test-wait">
+<title>CSS Test (Animations): Reparenting an element with a web animation on the compositor</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/">
+<link rel="author" title="Google" href="http://www.google.com/">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1301838">
+<meta name="assert" content="This should not crash.">
+
+<style>
+#animate {
+ width: 100px;
+ height: 100px;
+ background: blue;
+}
+</style>
+<div id="animate"></div>
+<div id="newparent"></div>
+<script>
+
+document.getElementById("animate").animate(
+ [
+ { transform: "rotate(0deg)" },
+ { transform: "rotate(360deg)" }
+ ],
+ {
+ duration: 5000,
+ iterations: Infinity
+ }
+);
+
+requestAnimationFrame(function() {
+ requestAnimationFrame(function() {
+ document.getElementById("newparent").appendChild(document.getElementById("animate"));
+ requestAnimationFrame(function() {
+ document.documentElement.classList.remove("test-wait");
+ });
+ });
+});
+
+</script>
diff --git a/testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-002.html b/testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-002.html
new file mode 100644
index 0000000000..0d3549fc33
--- /dev/null
+++ b/testing/web-platform/tests/web-animations/crashtests/reparent-animating-element-002.html
@@ -0,0 +1,44 @@
+<!DOCTYPE html>
+<html class="test-wait">
+<title>CSS Test (Animations): Reparenting an element with a web animation on the compositor</title>
+<link rel="author" title="L. David Baron" href="https://dbaron.org/">
+<link rel="author" title="Google" href="http://www.google.com/">
+<link rel="help" href="https://bugs.chromium.org/p/chromium/issues/detail?id=1305487">
+<meta name="assert" content="This should not crash.">
+<!--
+
+The Chromium implementation of <marquee> essentially uses web animations
+underneath. However, I was unable to make a testcase for this crash
+that uses web animations directly. Despite that, it still seems worth
+adding this testcase here in WPT.
+
+-->
+
+<style>
+#animate {
+ width: 100px;
+ height: 100px;
+}
+#newparent {
+ display: none;
+}
+</style>
+<marquee id="animate">X</marquee>
+<div id="newparent"></div>
+<script>
+
+let a = document.getElementById("animate");
+
+requestAnimationFrame(function() {
+ // use setTimeout because the crash doesn't happen if we do this inside
+ // a requestAnimationFrame callback
+ setTimeout(function() {
+ a.remove();
+ document.getElementById("newparent").appendChild(a);
+ requestAnimationFrame(function() {
+ document.documentElement.classList.remove("test-wait");
+ });
+ }, 0);
+});
+
+</script>