Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / transitions / transition-end-event-multiple-04.html
blobc0210658e4c8e8f382f5f8aa0c8bc689656f216d
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-transform: translate(0);
13 -webkit-transition-property: -webkit-transform;
14 -webkit-transition-duration: 0.5s;
17 .box1 {
18 -webkit-transform: translate(50px);
21 .box2 {
22 -webkit-transform: translate(50px) scale(1.05);
23 -webkit-transition-duration: 0.55s;
26 .box3 {
27 -webkit-transform: translate(0); /* same as default */
28 -webkit-transition-duration: 0.3s;
31 .box4 {
32 -webkit-transform: translate(100px);
33 -webkit-transition-duration: 0.4s;
36 .box5 {
37 /* nothing */
40 </style>
41 <script src="transition-end-event-helpers.js" type="text/javascript" charset="utf-8"></script>
42 <script type="text/javascript" charset="utf-8">
44 var expectedEndEvents = [
45 // [property-name, element-id, elapsed-time, listen]
46 ["-webkit-transform", "box1", 0.5, false],
47 ["-webkit-transform", "box2", 0.55, false],
48 ["-webkit-transform", "box4", 0.4, false]
51 function transitionElement(index)
53 var boxes = document.body.getElementsByClassName('box');
54 boxes[index-1].className = "box box" + index;
57 function setupTest()
59 var boxes = document.body.getElementsByClassName('box');
60 for (var i = 0; i < boxes.length; ++i) {
61 boxes[i].addEventListener("webkitTransitionEnd", recordTransitionEndEvent, false);
64 window.setTimeout(function() { transitionElement(1); }, 100);
65 window.setTimeout(function() { transitionElement(2); }, 150);
66 window.setTimeout(function() { transitionElement(3); }, 200);
67 window.setTimeout(function() { transitionElement(4); }, 50);
68 window.setTimeout(function() { transitionElement(5); }, 150);
71 runTransitionTest(expectedEndEvents, 1.0, setupTest);
73 </script>
74 </head>
75 <body>
77 <p>Initiating transitions on transform properties of all boxes, starting at different times and with different durations and values.</p>
79 <div id="container">
80 <div id="box1" class="box"></div>
81 <div id="box2" class="box"></div>
82 <div id="box3" class="box"></div>
83 <div id="box4" class="box"></div>
84 <div id="box5" class="box"></div>
85 </div>
87 <div id="result"></div>
89 </body>
90 </html>