4 <title>Tests that unprefixed animation events are correctly fired.
</title>
12 background-color: #
999;
16 animation-duration:
0.3s;
26 if (window
.testRunner
) {
27 testRunner
.dumpAsText();
28 testRunner
.waitUntilDone();
31 var startEventReceived
= false;
32 var endEventReceived
= false;
34 document
.addEventListener('animationstart', function() {
35 startEventReceived
= true;
38 document
.addEventListener('animationiteration', function() {
39 if (startEventReceived
&& endEventReceived
) {
40 document
.getElementById('result').innerHTML
= 'PASS: All events have been received as expected.';
41 if (window
.testRunner
)
42 testRunner
.notifyDone();
46 document
.addEventListener('animationend', function() {
47 endEventReceived
= true;
48 document
.getElementById('box').className
= '';
49 // Launch again the animation to catch the animation iteration events this time.
50 setTimeout(function () {
51 document
.getElementById('box').style
.animationIterationCount
= "infinite";
52 document
.getElementById('box').className
= 'animate';
58 // Animation begins once we append the DOM node to the document.
59 var boxNode
= document
.createElement('div');
61 boxNode
.className
= 'animate';
62 document
.body
.appendChild(boxNode
);
67 Tests that unprefixed animation events are correctly fired.
68 <pre id=
"result">FAIL: No animation events received
</pre>