Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / transitions / transition-end-event-multiple-03.html
blob328bbe8fbe338a80aeb5d39b8b7b28bb16b5397a
1 <html>
2 <head>
3 <title>Transition End Events</title>
4 <style type="text/css" media="screen">
5 .box {
6 position: relative;
7 left: 0;
8 height: 100px;
9 width: 100px;
10 margin: 10px;
11 background-color: blue;
12 -webkit-transition-property: width, left, background-color, height, top;
13 -webkit-transition-duration: 0.5s;
16 .box1 {
17 left: 50px;
20 .box2 {
21 background-color: red;
22 left: 50px;
25 .box3 {
26 width: 150px;
27 background-color: green;
28 left: 50px;
29 height: 120px;
30 -webkit-transition-duration: 0.6s;
33 .box4 {
34 left: 100px;
35 height: 140px;
36 -webkit-transition-duration: 0.3s;
39 .box5 {
40 /* nothing */
43 </style>
44 <script src="transition-end-event-helpers.js" type="text/javascript" charset="utf-8"></script>
45 <script type="text/javascript" charset="utf-8">
47 var expectedEndEvents = [
48 // [property-name, element-id, elapsed-time, listen]
49 ["background-color", "box2", 0.5, false],
50 ["background-color", "box3", 0.6, false],
51 ["height", "box3", 0.6, false],
52 ["height", "box4", 0.3, false],
53 ["left", "box1", 0.5, false],
54 ["left", "box2", 0.5, false],
55 ["left", "box3", 0.6, false],
56 ["left", "box4", 0.3, false],
57 ["width", "box3", 0.6, false]
60 function transitionElement(index)
62 var boxes = document.body.getElementsByClassName('box');
63 boxes[index-1].className = "box box" + index;
66 function setupTest()
68 var boxes = document.body.getElementsByClassName('box');
69 for (var i = 0; i < boxes.length; ++i) {
70 boxes[i].addEventListener("webkitTransitionEnd", recordTransitionEndEvent, false);
73 window.setTimeout(function() { transitionElement(1); }, 100);
74 window.setTimeout(function() { transitionElement(2); }, 150);
75 window.setTimeout(function() { transitionElement(3); }, 200);
76 window.setTimeout(function() { transitionElement(4); }, 50);
77 window.setTimeout(function() { transitionElement(5); }, 150);
80 runTransitionTest(expectedEndEvents, 2.0, setupTest);
82 </script>
83 </head>
84 <body>
86 <p>Initiating transitions on various properties of all boxes, with different start times on the transitions.</p>
88 <div id="container">
89 <div id="box1" class="box"></div>
90 <div id="box2" class="box"></div>
91 <div id="box3" class="box"></div>
92 <div id="box4" class="box"></div>
93 <div id="box5" class="box"></div>
94 </div>
96 <div id="result"></div>
98 </body>
99 </html>