3 <title>Transition End Events</title>
4 <style type="text/css" media="screen">
11 background-color: blue;
12 -webkit-transition-property: left;
13 -webkit-transition-duration: 0.5s;
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();
24 ["left", "box1", "webkitTransitionEnd", 0.5]
27 function startTransition()
29 var boxes = document.body.getElementsByClassName('box');
30 for (var i = 0; i < boxes.length; ++i) {
31 // we have to attach an empty handler here otherwise the event isn't
32 // fired (WebCore looks at the document to see if there are any listeners
33 // and ignores the one on Window) - this should be fixed
34 boxes[i].addEventListener("webkitTransitionEnd", function () {}, false);
35 boxes[i].style.left = '200px';
38 window.setTimeout(cleanup, 700);
41 window.addEventListener('load', startTransition, false);
42 window.onwebkittransitionend = recordEvent;
47 <p>Initiating a 500ms transition on the left property of box1 and catching it on the window.</p>
50 <div id="box1" class="box"></div>
53 <div id="result"></div>