4 <style type=
"text/css">
9 background-color: blue
;
12 -webkit-animation: test
1s linear
;
13 animation: test
1s linear
;
15 @
-webkit-keyframes test
{
24 <script type=
"text/javascript">
25 if (window
.testRunner
) {
26 testRunner
.dumpAsText();
27 testRunner
.waitUntilDone();
30 function log(message
) {
31 var div
= document
.createElement('div');
32 div
.textContent
= message
;
33 document
.body
.appendChild(div
);
38 target
= document
.getElementById('target');
39 target
.addEventListener('webkitAnimationStart', onStart
);
40 target
.classList
.add('animated');
44 log('INFO: Start event fired');
45 target
.removeEventListener('webkitAnimationStart', onStart
);
46 requestAnimationFrame(function() {
47 setTimeout(setDisplayNone
, 100);
51 var leftPropertyWhenSetDisplayNone
;
52 function setDisplayNone() {
53 leftPropertyWhenSetDisplayNone
= getComputedStyle(target
).left
;
54 target
.style
.display
= 'none';
55 requestAnimationFrame(function() {
56 setTimeout(setDisplayBlock
, 100);
60 function setDisplayBlock() {
61 target
.addEventListener('webkitAnimationStart', onRestart
);
62 target
.style
.display
= 'block';
65 function onRestart(e
) {
66 log('INFO: Start event fired again');
67 var pass
= leftPropertyWhenSetDisplayNone
> getComputedStyle(target
).left
;
68 log((pass
? 'PASS' : 'FAIL') + ': Left property was ' + (pass
? '' : 'not ') + 'reset correctly');
69 if (window
.testRunner
) {
70 testRunner
.notifyDone();
77 Tests that setting the display property of a running animation to 'none'
78 terminates the animation, and that setting it a value other than 'none'
79 causes it to re-start from the start.
81 <div id=
"target"></div>