2008-12-18 Pierre-Olivier Latour <pol@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="transition-end-event-helpers.js" type="text/javascript" charset="utf-8"></script>
17   <script type="text/javascript" charset="utf-8">
18     
19     var expectedEndEvents = [
20       // [property-name, element-id, elapsed-time, listen]
21       ["left", "box1", 0.5, false]
22     ];
23     
24     function setupTest()
25     {
26       document.getElementById("container").addEventListener("webkitTransitionEnd", recordTransitionEndEvent, false);
27       
28       var box = document.getElementById('box1');
29       box.style.left = '200px';
30     }
31     
32     runTransitionTest(expectedEndEvents, 0.7, setupTest);
33   </script>
34 </head>
35 <body>
36
37 <p>Initiating a 500ms transition on the left property of box1 and catching it on the parent.</p>
38
39 <div id="container">
40   <div id="box1" class="box"></div>
41 </div>
42
43 <div id="result"></div>
44
45 </body>
46 </html>