summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/transitions/transition-end-event-rendering.html
blob: ead97c52ee51a30faa6e1a1e8e4871cd8de9f8b9 (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
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
<!DOCTYPE html>

<html>
<head>
  <style>
    body {
      margin: 0;
    }
    
    #container {
      position: relative;
      width: 400px;
      height: 230px;
      border: 1px solid  black;
    }
    
    .box {
      position: relative;
      width: 100px;
      height: 100px;
      margin: 10px 0;
      background-color: green;
    }
    
    #container.moved .software {
      left: 300px;
    }

    #container.moved .hardware {
      -webkit-transform: translateX(300px);
    }

    .software {
      -webkit-transition: left 300ms linear;
    }

    .hardware {
      -webkit-transition: -webkit-transform 1s linear;
      -webkit-transform: translateX(0);
    }

   </style>
   <script src="../animations/resources/animation-test-helpers.js"></script>
   <script>

    function testEnded()
    {
      if (window.testRunner)
        testRunner.notifyDone();
    }
    
    function startTest()
    {
      if (window.testRunner)
        testRunner.waitUntilDone();
      document.getElementById('tester').addEventListener('webkitTransitionEnd', testEnded, false);
      document.getElementById('container').className = 'moved';
    }
    
    window.addEventListener('load', startTest, false);
   </script>
</head>
<body>

  <div id="container">
    <!-- <div class="software box"></div> -->
    <div id="tester" class="hardware box"></div>
  </div>

  <div id="result">
  </div>

</body>
</html>