Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / transitions / transition-end-event-nested.html
bloba49b5717c861554fc1a502b8f0e5f486443293f3
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.2s;
16 .box1 {
17 left: 50px;
20 .box2 {
21 background-color: red;
24 .box3 {
25 width: 150px;
26 -webkit-transition-duration: 0.3s;
29 </style>
30 <script src="transition-end-event-helpers.js" type="text/javascript" charset="utf-8"></script>
31 <script type="text/javascript" charset="utf-8">
33 var expectedEndEvents = [
34 // [property-name, element-id, elapsed-time, listen]
35 ["background-color", "box2", 0.2, false],
36 ["left", "box1", 0.2, false],
37 ["width", "box3", 0.3, false],
40 function handleEndEvent2(event)
42 recordTransitionEndEvent(event);
45 function startTransition2()
47 var box = document.getElementById("box3");
48 box.addEventListener("webkitTransitionEnd", handleEndEvent2, false);
49 box.className = "box box3";
52 function handleEndEvent1(event)
54 recordTransitionEndEvent(event);
56 setTimeout(startTransition2, 100);
59 function startTransition1()
61 var box = document.getElementById("box2");
62 box.addEventListener("webkitTransitionEnd", handleEndEvent1, false);
63 box.className = "box box2";
66 function handleEndEvent(event)
68 recordTransitionEndEvent(event);
70 setTimeout(startTransition1, 100);
73 function setupTest()
75 var box = document.getElementById("box1");
76 box.addEventListener("webkitTransitionEnd", handleEndEvent, false);
77 box.className = "box box1";
80 runTransitionTest(expectedEndEvents, 2.0, setupTest);
82 </script>
83 </head>
84 <body>
86 <p>Initiating transitions on various properties of all boxes.</p>
88 <div id="container">
89 <div id="box1" class="box"></div>
90 <div id="box2" class="box"></div>
91 <div id="box3" class="box"></div>
92 </div>
94 <div id="result"></div>
96 </body>
97 </html>