summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/svg/animations/syncbase-remove-add-while-running.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/svg/animations/syncbase-remove-add-while-running.html')
-rw-r--r--testing/web-platform/tests/svg/animations/syncbase-remove-add-while-running.html45
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/svg/animations/syncbase-remove-add-while-running.html b/testing/web-platform/tests/svg/animations/syncbase-remove-add-while-running.html
new file mode 100644
index 0000000000..61b9604a7b
--- /dev/null
+++ b/testing/web-platform/tests/svg/animations/syncbase-remove-add-while-running.html
@@ -0,0 +1,45 @@
+<!DOCTYPE html>
+<meta charset="utf-8">
+<title>Remove/Add syncbase while animation is running</title>
+<link rel="help" href="https://www.w3.org/TR/SMIL3/smil-timing.html#q26">
+<link rel="author" title="Edvard Thörnros" href="mailto:edvardt@opera.com">
+<script src="/resources/testharness.js"></script>
+<script src="/resources/testharnessreport.js"></script>
+
+<svg>
+ <animate id="anim" attributeName="visibility" to="visible" begin="10s" dur="2s"/>
+ <rect x="0" y="0" width="0" height="100" fill="#0F0">
+ <set attributeName="width" fill="freeze" to="100" begin="anim.begin"/>
+ </rect>
+</svg>
+
+<script>
+ async_test(function(t) {
+ window.onload = t.step_func(function() {
+ let svg = document.querySelector("svg");
+ let rect = document.querySelector("rect");
+
+ window.requestAnimationFrame(t.step_func(function() {
+ window.requestAnimationFrame(t.step_func(function() {
+ var anim1 = document.getElementById("anim");
+ anim1.parentNode.removeChild(anim1);
+
+ var anim2 = document.createElementNS("http://www.w3.org/2000/svg", "animate");
+ anim2.setAttribute("id", "anim");
+ anim2.setAttribute("attributeName", "visibility");
+ anim2.setAttribute("to", "visible");
+ anim2.setAttribute("begin", "0s");
+ anim2.setAttribute("dur", "2s");
+ svg.appendChild(anim2);
+
+ window.requestAnimationFrame(t.step_func(function() {
+ window.requestAnimationFrame(t.step_func_done(function() {
+ svg.pauseAnimations();
+ assert_equals(rect.width.animVal.value, 100, "Sync base triggered");
+ }));
+ }));
+ }));
+ }));
+ });
+ });
+</script>