summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/transitions/remove-accelerated-transition.html
blob: a6fe5efb9b91ab323b04b721dfe83841b8091902 (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
<html>
  <head>
    <style>
      #a {
        background-color: red;
        height: 100px;
        width: 100px;
        -webkit-transition: height 0.5s linear;
        overflow: hidden;
      }

      #b {
        background-color: blue;
        height: 100px;
        width: 100px;
        -webkit-transition: -webkit-transform 0.5s linear;
      }
    </style>
    <script>
      if (window.testRunner) {
        testRunner.dumpAsText();
        testRunner.waitUntilDone();
      }

      function endTest() {
        if (window.testRunner) {
          testRunner.notifyDone();
        }
      }
      
      function startTest() {
        var a = document.getElementById("a");
        var b = document.getElementById("b");
        a.addEventListener("webkitTransitionEnd", endTest, false);
        
        // Trigger transitions.
        a.style.height = "0px";
        b.style.webkitTransform = "translateX(10px)";

        // Force layout.
        document.body.offsetHeight;

        // Remove the transform transition by hiding its div.
        b.style.display = "none";
      }
    </script>
  </head>
  <body onload="startTest()">
    <div id="a">FAIL</div>
    <div id="b"></div>
    PASS
  </body>

</html>