4 <style type=
"text/css">
13 -webkit-animation: test
1s linear
;
14 animation: test
1s linear
;
17 -webkit-animation-delay: -500ms;
18 animation-delay: -500ms;
21 -webkit-animation-delay: 0ms;
25 -webkit-animation-delay: 500ms;
26 animation-delay: 500ms;
28 @
-webkit-keyframes test
{
37 <script type=
"text/javascript">
38 if (window
.testRunner
) {
39 testRunner
.dumpAsText();
40 testRunner
.waitUntilDone();
45 requestAnimationFrame(function(t
) {
46 ['negative-delay', 'zero-delay', 'positive-delay'].forEach(function(id
) {
47 var target
= document
.getElementById(id
);
48 target
.addEventListener('webkitAnimationStart', onStartEventFired
);
49 target
.classList
.add('animated');
51 requestAnimationFrame(function() {
57 function log(message
) {
58 var div
= document
.createElement('div');
59 div
.textContent
= message
;
60 document
.body
.appendChild(div
);
63 function onStartEventFired(e
) {
65 var pass
= immediate
|| id
== 'positive-delay';
66 log((pass
? 'PASS' : 'FAIL') + ': ' + id
+ ': Start event ' + (immediate
? 'fired' : 'did not fire') + ' immediately');
67 if (id
=== 'positive-delay' && window
.testRunner
) {
68 testRunner
.notifyDone();
74 <p>Tests that the start event is fired at the correct time with different start delays.
</p>
75 <div class=
"target" id=
"negative-delay"></div>
76 <div class=
"target" id=
"zero-delay"></div>
77 <div class=
"target" id=
"positive-delay"></div>
78 <div id=
"result"></div>