summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/dom/nodes/moveBefore/tentative/continue-css-transition-transform-pseudo.html
blob: d02c72561c1101ce9474cc60b9295e46c9e499df (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
<!DOCTYPE html>
<title>Node.moveBefore should preserve CSS transition state on pseudo-elements (transform)</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;
      position: absolute;
      left: 0;
    }

    #item::before {
      content: "Foo";
      width: 100px;
      height: 100px;
      background: green;
      transition: transform 60s steps(1, jump-both);
      transform: none;
      position: absolute;
    }

    #item.big::before {
      transform: translateX(400px);
    }

    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.classList.add("big");
      await new Promise(resolve => item.addEventListener("transitionstart", resolve));
      document.querySelector("#new-parent").moveBefore(item, null);
      await new Promise(resolve => requestAnimationFrame(() => resolve()));
      assert_not_equals(getComputedStyle(item, "::before").transform, "none");
    });
  </script>
</body>