OLD | NEW |
| (Empty) |
1 <!DOCTYPE html> | |
2 <script src="../resources/testharness.js"></script> | |
3 <script src="../resources/testharnessreport.js"></script> | |
4 <style> | |
5 @keyframes anim { | |
6 from { left: 0px; } | |
7 to { left: 300px; } | |
8 } | |
9 | |
10 #target { | |
11 animation: anim 10s -5s paused linear; | |
12 width: 100px; | |
13 height: 100px; | |
14 left: -1px; | |
15 position: relative; | |
16 background-color: green; | |
17 } | |
18 </style> | |
19 <div id="target"></div> | |
20 <script> | |
21 test(function() { | |
22 target.style.animationPlayState = 'running'; | |
23 target.offsetTop; // Force style recalc | |
24 target.style.animationPlayState = 'paused'; | |
25 | |
26 target.style.animationDuration = '3s'; // Animation ends | |
27 assert_equals(parseInt(getComputedStyle(target).left), -1, 'left offset'); | |
28 | |
29 target.style.animationIterationCount = 2; // Box should be 2/3 of the way ac
ross | |
30 assert_equals(parseInt(getComputedStyle(target).left), 200, 'left offset'); | |
31 | |
32 target.style.animationDirection = 'reverse'; // Box should be 1/3 of the way
across | |
33 assert_equals(parseInt(getComputedStyle(target).left), 100, 'left offset'); | |
34 | |
35 target.style.animationDelay = '-4s'; // Box should be 2/3 of the way across | |
36 assert_equals(parseInt(getComputedStyle(target).left), 200, 'left offset'); | |
37 | |
38 target.style.animationIterationCount = 1; // Animation ends | |
39 target.style.animationFillMode = 'forwards'; | |
40 assert_equals(parseInt(getComputedStyle(target).left), 0, 'left offset'); | |
41 | |
42 }, "Changes to animation properties should be reflected immediately"); | |
43 </script> | |
OLD | NEW |