4 <title>Tests that unprefixed animation events are correctly fired when using html event listeners.
</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 function recordAnimationStart() {
35 startEventReceived
= true;
38 function recordAnimationIteration() {
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 function recordAnimationEnd() {
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 Tests that unprefixed animation events are correctly fired when using html event listeners.
59 <pre id=
"result">FAIL: No animation events received
</pre>
60 <div id=
"box" onanimationstart=
"recordAnimationStart();" onanimationend=
"recordAnimationEnd();" onanimationiteration=
"recordAnimationIteration();" class=
"animate"></div>