summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/transitions/transition-end-event-all-properties.html
blob: 38c7fec785daa97b0a40c032b81255ccc44b334b (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
75
76
77
<html>
<head>
  <title>Transition End Events</title>
  <style type="text/css" media="screen">
    .box {
      position: relative;
      left: 0;
      height: 100px;
      width: 100px;
      margin: 10px;
      background-color: blue;
      -webkit-transition-duration: 0.5s;
    }
    
    .box1 {
      left: 50px;
    }
    
    .box2 {
      background-color: red;
      left: 50px;
    }
    
    .box3 {
      width: 150px;
      background-color: green;
      left: 50px;
      height: 120px;
      -webkit-transition-duration: 0.7s;
    }
    
  </style>
  <script src="end-event-helpers.js" type="text/javascript" charset="utf-8"></script>
  <script type="text/javascript" charset="utf-8">
    if (window.layoutTestController) {
        layoutTestController.dumpAsText();
        layoutTestController.waitUntilDone();
    }

    var expected = [
      ["background-color", "box2", "webkitTransitionEnd", 0.5],
      ["background-color", "box3", "webkitTransitionEnd", 0.7],
      ["height", "box3", "webkitTransitionEnd", 0.7],
      ["left", "box1", "webkitTransitionEnd", 0.5],
      ["left", "box2", "webkitTransitionEnd", 0.5],
      ["left", "box3", "webkitTransitionEnd", 0.7],
      ["width", "box3", "webkitTransitionEnd", 0.7]
    ];
    
    function startTransition()
    {
      var boxes = document.body.getElementsByClassName('box');
      for (var i = 0; i < boxes.length; ++i) {
        boxes[i].addEventListener("webkitTransitionEnd", recordEvent, false);
        boxes[i].className = "box box" + (i+1);
      }
      
      window.setTimeout(cleanup, 1000);
    }
    
    window.addEventListener('load', startTransition, false);
  </script>
</head>
<body>

<p>Initiating transitions on various properties of all boxes.</p>

<div id="container">
  <div id="box1" class="box"></div>
  <div id="box2" class="box"></div>
  <div id="box3" class="box"></div>
</div>

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

</body>
</html>