Refactoring: Pull all fullscreen code out of Document and into its own helper class
[WebKit-https.git] / LayoutTests / transitions / transition-end-event-nested.html
1 <html>
2 <head>
3   <style>
4     .box {
5       position: relative;
6       left: 0;
7       height: 100px;
8       width: 100px;
9       margin: 10px;
10       background-color: blue;
11       -webkit-transition-property: width, left, background-color, height, top;
12       -webkit-transition-duration: 0.2s;
13     }
14     
15     .box1 {
16       left: 50px;
17     }
18     
19     .box2 {
20       background-color: red;
21     }
22     
23     .box3 {
24       width: 150px;
25       -webkit-transition-duration: 0.3s;
26     }
27     
28   </style>
29   <script src="transition-end-event-helpers.js"></script>
30   <script type="text/javascript">
31     
32     var expectedEndEvents = [
33       // [property-name, element-id, elapsed-time, listen]
34       ["background-color", "box2", 0.2, false],
35       ["left", "box1", 0.2, false],
36       ["width", "box3", 0.3, false],
37     ];
38     
39     function handleEndEvent2(event)
40     {
41       recordTransitionEndEvent(event);
42     }
43
44     function startTransition2()
45     {
46       var box = document.getElementById("box3");
47       box.addEventListener("webkitTransitionEnd", handleEndEvent2, false);
48       box.className = "box box3";
49     }
50
51     function handleEndEvent1(event)
52     {
53       recordTransitionEndEvent(event);
54       
55       setTimeout(startTransition2, 100);
56     }
57
58     function startTransition1()
59     {
60       var box = document.getElementById("box2");
61       box.addEventListener("webkitTransitionEnd", handleEndEvent1, false);
62       box.className = "box box2";
63     }
64
65     function handleEndEvent(event)
66     {
67       recordTransitionEndEvent(event);
68       
69       setTimeout(startTransition1, 100);
70     }
71
72     function setupTest()
73     {
74       var box = document.getElementById("box1");
75       box.addEventListener("webkitTransitionEnd", handleEndEvent, false);
76       box.className = "box box1";
77     }
78     
79     runTransitionTest(expectedEndEvents, setupTest);
80   </script>
81 </head>
82 <body>
83
84 <p>Initiating transitions on various properties of all boxes.</p>
85
86 <div id="container">
87   <div id="box1" class="box"></div>
88   <div id="box2" class="box"></div>
89   <div id="box3" class="box"></div>
90 </div>
91
92 <div id="result"></div>
93
94 </body>
95 </html>