2008-09-01 Dean Jackson <dino@apple.com>
[WebKit-https.git] / LayoutTests / transitions / transition-end-event-container.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: left;
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       ["left", "box1", "webkitTransitionEnd", 0.5]
25     ];
26     
27     function startTransition()
28     {
29       document.getElementById("container").addEventListener("webkitTransitionEnd", recordEvent, false);
30       var boxes = document.body.getElementsByClassName('box');
31       for (var i = 0; i < boxes.length; ++i) {
32         boxes[i].style.left = '200px';
33       }
34       
35       window.setTimeout(cleanup, 700);
36     }
37     
38     window.addEventListener('load', startTransition, false);
39   </script>
40 </head>
41 <body>
42
43 <p>Initiating a 500ms transition on the left property of box1 and catching it on the parent.</p>
44
45 <div id="container">
46   <div id="box1" class="box"></div>
47 </div>
48
49 <div id="result"></div>
50
51 </body>
52 </html>