2 <script src=
"../resources/testharness.js"></script>
3 <script src=
"../resources/testharnessreport.js"></script>
6 0% { background-color: red; }
7 50% { left:
50px; background-color: green; }
8 100% { background-color: red; }
17 <div id=
"target"></div>
20 var rules
= document
.styleSheets
[0].rules
;
21 for (var i
= 0; i
< rules
.length
; i
++) {
22 if (rules
[i
].type
== CSSRule
.KEYFRAMES_RULE
) {
23 rules
[i
].appendRule('50% { left: 0px; }');
25 assert_equals(rules
[i
].cssRules
.length
, 4);
26 assert_equals(rules
[i
].cssRules
[0].cssText
, '0% { background-color: red; }');
27 assert_equals(rules
[i
].cssRules
[1].cssText
, '50% { left: 50px; background-color: green; }');
28 assert_equals(rules
[i
].cssRules
[2].cssText
, '100% { background-color: red; }');
29 assert_equals(rules
[i
].cssRules
[3].cssText
, '50% { left: 0px; }');
33 target
.style
.animation
= 'anim 2s -1s paused';
34 assert_equals(getComputedStyle(target
).backgroundColor
, 'rgb(0, 128, 0)', 'background color');
35 assert_equals(getComputedStyle(target
).left
, '0px', 'left offset');
36 }, "Check that duplicate keyframe offsets are correctly merged");