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