diff options
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-animation-commit-styles.html')
-rw-r--r-- | testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-animation-commit-styles.html | 45 |
1 files changed, 45 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-animation-commit-styles.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-animation-commit-styles.html new file mode 100644 index 0000000000..86bb7c33e4 --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/css-animation-commit-styles.html @@ -0,0 +1,45 @@ +<!DOCTYPE html> +<title>Calling commitStyles after Node.moveBefore should commit mid-transition value</title> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> + +<body> + <section id="old-parent"> + <div id="item"></div> + </section> + <section id="new-parent"> + </section> + <style> + @keyframes anim { + from { + transform: translateX(100px); + } + + to { + transform: translateX(400px); + } + } + + #item { + position: relative; + width: 100px; + height: 100px; + background: green; + animation: 1s linear infinite alternate anim; + animation-delay: 100ms; + } + </style> + <script> + promise_test(async t => { + const item = document.querySelector("#item"); + await new Promise(resolve => item.addEventListener("animationstart", resolve)); + + // Reparent item + document.body.querySelector("#new-parent").moveBefore(item, null); + + item.getAnimations()[0].commitStyles(); + assert_true("transform" in item.style); + assert_not_equals(item.style.transform, "none"); + }); + </script> +</body> |