2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
6 from { background-color: blue; }
7 to { background-color: red; }
11 animation: anim
20s -
10s infinite linear paused;
15 background-color: green;
18 <div id=
"target"></div>
20 var test1
= async_test("Changing animation duration to current elapsed time should trigger an AnimationIteration event");
21 target
.addEventListener('animationend', function(event
) {
22 assert_equals(event
.elapsedTime
, 1, 'elapsed time');
28 target
.style
.animationIterationCount
= 'infinite';
29 target
.style
.animationDuration
= '4s';
30 assert_equals(getComputedStyle(target
).backgroundColor
, 'rgb(128, 0, 128)', 'background color');
32 target
.style
.animationDirection
= 'alternate';
33 target
.style
.animationDuration
= '10s';
34 assert_equals(getComputedStyle(target
).backgroundColor
, 'rgb(255, 0, 0)', 'background color');
36 target
.style
.animationIterationCount
= '2';
37 target
.style
.animationPlayState
= 'running';
38 assert_not_equals(getComputedStyle(target
).backgroundColor
, 'rgb(0, 128, 0)', 'background color');
40 target
.style
.animationPlayState
= 'paused';
41 target
.style
.animationIterationCount
= '1';
42 target
.style
.animationDuration
= '1s';
43 assert_equals(getComputedStyle(target
).backgroundColor
, 'rgb(0, 128, 0)', 'background color');
45 }, "Check that changes in the animation timing properties are reflected immediately");