4 <title>Tests that unprefixed animation events are correctly fired when using html event listeners (only unprefixed should be 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;
33 var prefixedEventReceived
= 0;
35 function recordPrefixedEvent() {
36 prefixedEventReceived
++;
39 function recordAnimationStart() {
40 startEventReceived
= true;
43 function recordAnimationIteration() {
44 if (startEventReceived
&& endEventReceived
&& prefixedEventReceived
== 0) {
45 document
.getElementById('result').innerHTML
= 'PASS: All events have been received as expected.';
46 if (window
.testRunner
)
47 testRunner
.notifyDone();
51 function recordAnimationEnd() {
52 endEventReceived
= true;
53 document
.getElementById('box').className
= '';
54 // Launch again the animation to catch the animation iteration events this time.
55 setTimeout(function () {
56 document
.getElementById('box').style
.animationIterationCount
= "infinite";
57 document
.getElementById('box').className
= 'animate';
63 Tests that unprefixed animation events are correctly fired when using html event listeners (only unprefixed should be fired).
64 <pre id=
"result">FAIL: No animation events received
</pre>
65 <div id=
"box" onwebkitanimationstart=
"recordPrefixedEvent();" onwebkitanimationend=
"recordPrefixedEvent();" onwebkitanimationiteration=
"recordPrefixedEvent();" onanimationstart=
"recordAnimationStart();" onanimationend=
"recordAnimationEnd();" onanimationiteration=
"recordAnimationIteration();" class=
"animate"></div>