summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-animation-left.html
diff options
context:
space:
mode:
Diffstat (limited to 'testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-animation-left.html')
-rw-r--r--testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-animation-left.html51
1 files changed, 51 insertions, 0 deletions
diff --git a/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-animation-left.html b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-animation-left.html
new file mode 100644
index 0000000000..8c7f73e3c9
--- /dev/null
+++ b/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-animation-left.html
@@ -0,0 +1,51 @@
+<!DOCTYPE html>
+<title>Node.moveBefore should preserve CSS animation 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>
+ @keyframes anim {
+ from {
+ left: 100px;
+ }
+
+ to {
+ left: 400px;
+ }
+ }
+
+ section {
+ position: absolute;
+ }
+
+ #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");
+ let num_events = 0;
+ await new Promise(resolve => addEventListener("animationstart", () => {
+ num_events++;
+ resolve();
+ }));
+
+ // Reparent item
+ document.body.querySelector("#new-parent").moveBefore(item, null);
+ await new Promise(resolve => requestAnimationFrame(() => resolve()));
+ assert_equals(num_events, 1);
+ assert_not_equals(getComputedStyle(item).left, "0px");
+ });
+ </script>
+</body>