3 <title>Destroy and Hide Element in Animation End Event</title>
4 <style type="text/css" media="screen">
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); }
19 <script type="text/javascript" charset="utf-8">
20 if (window.layoutTestController) {
21 layoutTestController.dumpAsText();
22 layoutTestController.waitUntilDone();
26 function animationIterated()
30 if (window.GCController)
31 GCController.collect();
33 document.getElementById('results').innerHTML = 'Did not crash, so PASSED';
35 if (window.layoutTestController)
36 layoutTestController.notifyDone();
42 var box1 = document.getElementById('box1');
43 box1.addEventListener('webkitAnimationIteration', function() {
44 box1.parentNode.removeChild(box1);
47 box1.style.webkitAnimationName = 'move';
49 var box2 = document.getElementById('box2');
50 box2.addEventListener('webkitAnimationIteration', function() {
51 box2.style.display = 'none';
54 box2.style.webkitAnimationName = 'move';
57 window.addEventListener('load', startTest, false);
62 <p>Tests element removal and hiding within the webkitAnimationIteration event handler. Should not crash.</p>
65 <div id="box1" class="box"></div>
66 <div id="box2" class="box"></div>
68 <div id="results"></div>