Rubber-stamped by Brady Eidson.
[webbrowser.git] / LayoutTests / animations / animation-iteration-event-destroy-renderer.html
blobd7074d5db7a735b2ec1688d91a162ed7dbfd4f3f
1 <html>
2 <head>
3 <title>Destroy and Hide Element in Animation End Event</title>
4 <style type="text/css" media="screen">
5 .box {
6 height: 100px;
7 width: 100px;
8 margin: 10px;
9 background-color: blue;
10 -webkit-animation-duration: 0.2s;
11 -webkit-animation-iteration-count: 2;
14 @-webkit-keyframes move {
15 from { -webkit-transform: translate(0px, 0px); }
16 to { -webkit-transform: translate(100px, 0px); }
18 </style>
19 <script type="text/javascript" charset="utf-8">
20 if (window.layoutTestController) {
21 layoutTestController.dumpAsText();
22 layoutTestController.waitUntilDone();
25 var numDone = 0;
26 function animationIterated()
28 ++numDone;
29 if (numDone == 2) {
30 if (window.GCController)
31 GCController.collect();
33 document.getElementById('results').innerHTML = 'Did not crash, so PASSED';
35 if (window.layoutTestController)
36 layoutTestController.notifyDone();
40 function startTest()
42 var box1 = document.getElementById('box1');
43 box1.addEventListener('webkitAnimationIteration', function() {
44 box1.parentNode.removeChild(box1);
45 animationIterated();
46 }, false);
47 box1.style.webkitAnimationName = 'move';
49 var box2 = document.getElementById('box2');
50 box2.addEventListener('webkitAnimationIteration', function() {
51 box2.style.display = 'none';
52 animationIterated();
53 }, false);
54 box2.style.webkitAnimationName = 'move';
57 window.addEventListener('load', startTest, false);
58 </script>
59 </head>
60 <body>
62 <p>Tests element removal and hiding within the webkitAnimationIteration event handler. Should not crash.</p>
64 <div id="container">
65 <div id="box1" class="box"></div>
66 <div id="box2" class="box"></div>
67 </div>
68 <div id="results"></div>
69 </body>
70 </html>