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 0% { left: 0px; } | |
7 50% { left: 500px; } | |
8 100% { left: 100px; } | |
9 } | |
10 | |
11 #target1 { | |
12 animation: anim 10s -3s linear paused; | |
13 } | |
14 | |
15 #target2 { | |
16 animation: anim 10s -2s linear paused; | |
17 } | |
18 </style> | |
19 <div id="target1"></div> | |
20 <div id="target2"></div> | |
21 <script> | |
22 test(function() { | |
23 assert_equals(parseInt(getComputedStyle(target1).left), 300, 'left offset'); | |
24 assert_equals(parseInt(getComputedStyle(target2).left), 200, 'left offset'); | |
25 | |
26 var rules = document.styleSheets[0].rules; | |
dstockwell
2014/12/30 00:59:12
I think we need some more tests:
* can we use the
shend
2015/01/02 01:58:29
Done.
| |
27 for (var i = 0; i < rules.length; i++) { | |
28 if (rules[i].type == CSSRule.KEYFRAMES_RULE) { | |
29 rules[i].appendRule('20% { left: 500px; }'); | |
30 rules[i].deleteRule('50%'); | |
31 } | |
32 } | |
33 | |
34 assert_equals(parseInt(getComputedStyle(target1).left), 450, 'left offset'); | |
35 assert_equals(parseInt(getComputedStyle(target2).left), 500, 'left offset'); | |
36 | |
37 }, "Check that appendRule and deleteRule update paused animations"); | |
38 </script> | |
OLD | NEW |