5 <style type=
"text/css">
10 background-color: blue
;
14 -webkit-animation-duration: 0.1s;
15 -webkit-animation-name: animation
;
18 -webkit-animation-delay: 0.05s;
21 -webkit-animation-delay: -0.05s;
24 -webkit-animation-delay: -0.15s;
26 @
-webkit-keyframes animation
{
31 <script type=
"text/javascript">
32 if (window
.testRunner
) {
33 testRunner
.dumpAsText();
34 testRunner
.waitUntilDone();
37 var div
= document
.createElement('div');
39 document
.getElementById('log').appendChild(div
);
43 document
.addEventListener('webkitAnimationStart', function(event
) {
44 var pass
= event
.elapsedTime
=== [0, 0.05, 0.15][count
++];
45 log((pass
? 'PASS' : 'FAIL') + ': ' + event
.target
.id
+ ': Start event: elapsedTime=' + event
.elapsedTime
);
48 document
.addEventListener('webkitAnimationEnd', function(event
) {
49 var pass
= event
.elapsedTime
=== 0.1;
50 log((pass
? 'PASS' : 'FAIL') + ': ' + event
.target
.id
+ ': End event: elapsedTime=' + event
.elapsedTime
);
53 document
.getElementById('animation2').classList
.add('animation');
56 document
.getElementById('animation3').classList
.add('animation');
59 if (window
.testRunner
)
60 testRunner
.notifyDone();
66 <p>Tests animation events with a negative delay.
67 <div id=
"animation1" class=
"box animation"></div>
68 <div id=
"animation2" class=
"box"></div>
69 <div id=
"animation3" class=
"box"></div>