2008-09-01 Dean Jackson <dino@apple.com>
[WebKit-https.git] / LayoutTests / transitions / transition-end-event-multiple-01.html
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;
14     }
15   </style>
16   <script src="end-event-helpers.js" type="text/javascript" charset="utf-8"></script>
17   <script type="text/javascript" charset="utf-8">
18     if (window.layoutTestController) {
19         layoutTestController.dumpAsText();
20         layoutTestController.waitUntilDone();
21     }
22     
23     var expected = [
24       ["background-color", "box1", "webkitTransitionEnd", 0.5],
25       ["height", "box1", "webkitTransitionEnd", 0.5],
26       ["left", "box1", "webkitTransitionEnd", 0.5],
27       ["width", "box1", "webkitTransitionEnd", 0.5],
28     ];
29     
30     function startTransition()
31     {
32       var boxes = document.body.getElementsByClassName('box');
33       for (var i = 0; i < boxes.length; ++i) {
34         boxes[i].addEventListener("webkitTransitionEnd", recordEvent, false);
35         boxes[i].style.width = "150px";
36         boxes[i].style.left = '200px';
37         boxes[i].style.backgroundColor = 'red';
38         boxes[i].style.height = '80px';
39       }
40       
41       window.setTimeout(cleanup, 700);
42     }
43     
44     window.addEventListener('load', startTransition, false);
45   </script>
46 </head>
47 <body>
48
49 <p>Initiating a 500ms transition on the left, background-color, width and height properties of box1.</p>
50
51 <div id="container">
52   <div id="box1" class="box"></div>
53 </div>
54
55 <div id="result"></div>
56
57 </body>
58 </html>