4 https://bugzilla.mozilla.org/show_bug.cgi?id=716226
8 <title>Test for Bug
716226</title>
9 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
10 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
16 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=716226">Mozilla Bug
716226</a>
18 <div id=
"content" style=
"display: none">
22 <script type=
"application/javascript">
24 /** Test for Bug
716226 **/
25 var sheet = $(
"s").sheet;
26 var rules = sheet.cssRules;
27 is(rules.length,
1,
"Should have one keyframes rule");
28 var keyframesRule = rules[
0];
29 var keyframeRules = keyframesRule.cssRules;
30 is(keyframeRules.length,
0,
"Should have no keyframe rules yet");
32 keyframesRule.appendRule('
0% { }');
33 is(keyframeRules.length,
1,
"Should have a keyframe rule now");
34 var keyframeRule = keyframeRules[
0];
35 is(keyframeRule.parentRule, keyframesRule,
36 "Parent of keyframe should be keyframes");
37 is(keyframeRule.parentStyleSheet, sheet,
38 "Parent stylesheet of keyframe should be our sheet");
40 is(keyframeRule.style.cssText,
"",
"Should have no declarations yet");
41 // Note: purposefully non-canonical cssText string so we can make sure we
42 // really invoked the CSS parser and serializer.
43 keyframeRule.style.cssText =
"color:green";
44 is(keyframeRule.style.cssText,
"color: green;",
45 "Should have the declarations we set now");