4 https://bugzilla.mozilla.org/show_bug.cgi?id=887741
8 <title>Test for Bug
887741: at-rules in declaration lists
</title>
9 <script type=
"text/javascript" src=
"/MochiKit/MochiKit.js"></script>
10 <script src=
"/tests/SimpleTest/SimpleTest.js"></script>
23 content: counter(page);
28 @keyframes dummy-animation {
36 /* TODO: other at-rules that use declaration syntax? */
38 <link rel=
"stylesheet" type=
"text/css" href=
"/tests/SimpleTest/test.css"/>
41 <a target=
"_blank" href=
"https://bugzilla.mozilla.org/show_bug.cgi?id=887741">Mozilla Bug
887741</a>
43 <div id=
"content" style=
"display: none; color: red;
44 @invalid-rule{} /* No semicolon */ color: green;">
48 <script type=
"application/javascript">
50 /** Test for Bug
887741 **/
52 var style = document.getElementById('content').style;
53 is(style.display, 'none', 'Sanity check: we have the right element');
54 is(style.color, 'green', 'Support at-rules in style attributes');
56 style.cssText = 'display: none; color: red; @invalid-rule{} /* No semicolon */ color: lime;';
57 is(style.color, 'lime', 'Support at-rules in CSSStyleDeclaration.cssText');
59 var rules = document.styleSheets[
0].cssRules;
60 var style_rule = rules[
0];
61 is(style_rule.selectorText, '#foo', 'Sanity check: we have the right style rule');
62 is(style_rule.style.color, 'green', 'Support at-rules in style rules');
64 var page_rule = rules[
1];
65 is(page_rule.type, page_rule.PAGE_RULE, 'Sanity check: we have the right style rule');
66 is(page_rule.style.marginTop, '
5cm', 'Support at-rules in @page rules');
68 var keyframe_rule = rules[
2].cssRules[
0];
69 is(keyframe_rule.keyText, '
12%', 'Sanity check: we have the right keyframe rule');
70 is(keyframe_rule.style.color, 'green', 'Support at-rules in keyframe rules')