diff options
Diffstat (limited to '')
-rw-r--r-- | testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-transition-left.html | 41 |
1 files changed, 41 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-transition-left.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-transition-left.html new file mode 100644 index 0000000000..2b8e04b26e --- /dev/null +++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-transition-left.html @@ -0,0 +1,41 @@ +<!DOCTYPE html> +<title>Node.moveBefore should preserve CSS transition state (left)</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> + #item { + width: 100px; + height: 100px; + background: green; + transition: left 10s; + position: absolute; + left: 0; + } + + section { + position: relative; + } + + body { + margin-left: 0; + } + </style> + <script> + promise_test(async t => { + const item = document.querySelector("#item"); + assert_equals(item.getBoundingClientRect().x, 0); + item.style.left = "400px"; + await new Promise(resolve => item.addEventListener("transitionstart", resolve)); + document.querySelector("#new-parent").moveBefore(item, null); + await new Promise(resolve => requestAnimationFrame(() => resolve())); + assert_less_than(item.getBoundingClientRect().x, 399); + }); + </script> +</body> |