OLD | NEW |
1 <!DOCTYPE HTML> | 1 <!DOCTYPE HTML> |
2 <html> | 2 <html> |
3 <head> | 3 <head> |
4 <meta charset=utf8> | 4 <meta charset=utf8> |
5 <script src="../resources/js-test.js"></script> | 5 <script src="../resources/js-test.js"></script> |
6 <style> | 6 <style> |
7 @supports (width: 0) { | 7 @supports (width: 0) { |
8 s { width: 0; } | 8 s { width: 0; } |
9 @supports (width: 1) { | 9 @supports (width: 1) { |
10 s { color: #000; } | 10 s { color: #000; } |
(...skipping 69 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
80 evalAndLog("rules[0].deleteRule(2)"); | 80 evalAndLog("rules[0].deleteRule(2)"); |
81 shouldEvaluateTo("rules[0].cssRules.length", 2); | 81 shouldEvaluateTo("rules[0].cssRules.length", 2); |
82 | 82 |
83 evalAndLog("rules[0].cssRules[1].insertRule('@supports (display: rainbow) {}
', 1)"); | 83 evalAndLog("rules[0].cssRules[1].insertRule('@supports (display: rainbow) {}
', 1)"); |
84 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 2); | 84 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 2); |
85 shouldBe("rules[0].cssRules[1].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); | 85 shouldBe("rules[0].cssRules[1].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); |
86 evalAndLog("rules[0].cssRules[1].deleteRule(1)"); | 86 evalAndLog("rules[0].cssRules[1].deleteRule(1)"); |
87 shouldEvaluateTo("rules[0].cssRules.length", 2); | 87 shouldEvaluateTo("rules[0].cssRules.length", 2); |
88 | 88 |
89 debug("\n@charset, @namespace, @import rules are not allowed inside @support
s.") | 89 debug("\n@charset, @namespace, @import rules are not allowed inside @support
s.") |
90 shouldThrow("rules[0].insertRule('@charset \"UTF-8\"', 2)", '"SyntaxError: F
ailed to execute \'insertRule\' on \'CSSGroupingRule\': the rule \'@charset \\"U
TF-8\\"\' is invalid and cannot be parsed."'); | 90 shouldThrow("rules[0].insertRule('@charset \"UTF-8\"', 2)", '"SyntaxError: F
ailed to execute \'insertRule\' on \'CSSSupportsRule\': the rule \'@charset \\"U
TF-8\\"\' is invalid and cannot be parsed."'); |
91 shouldThrow("rules[0].insertRule('@namespace \"\"', 2)", '"SyntaxError: Fail
ed to execute \'insertRule\' on \'CSSGroupingRule\': the rule \'@namespace \\"\\
"\' is invalid and cannot be parsed."'); | 91 shouldThrow("rules[0].insertRule('@namespace \"\"', 2)", '"SyntaxError: Fail
ed to execute \'insertRule\' on \'CSSSupportsRule\': the rule \'@namespace \\"\\
"\' is invalid and cannot be parsed."'); |
92 shouldThrow("rules[0].insertRule('@import url(\"../fast/cssom/resources/impo
rt.css\")', 2)", '"HierarchyRequestError: Failed to execute \'insertRule\' on \'
CSSGroupingRule\': \'@import\' rules cannot be inserted inside a group rule."'); | 92 shouldThrow("rules[0].insertRule('@import url(\"../fast/cssom/resources/impo
rt.css\")', 2)", '"HierarchyRequestError: Failed to execute \'insertRule\' on \'
CSSSupportsRule\': \'@import\' rules cannot be inserted inside a group rule."'); |
93 | 93 |
94 | 94 |
95 debug("\nWhitespace and formatting should be preserved within the condition,
whitespace outside the condition should be trimmed."); | 95 debug("\nWhitespace and formatting should be preserved within the condition,
whitespace outside the condition should be trimmed."); |
96 shouldBeEqualToString("rules[1].conditionText", "(( ( padding: 0) an
d (display: none)) or (display: rainbow))"); | 96 shouldBeEqualToString("rules[1].conditionText", "(( ( padding: 0) an
d (display: none)) or (display: rainbow))"); |
97 | 97 |
98 | 98 |
99 debug("\n@supports rule nested inside a media rule."); | 99 debug("\n@supports rule nested inside a media rule."); |
100 shouldBe("rules[2].type", "CSSRule.MEDIA_RULE"); | 100 shouldBe("rules[2].type", "CSSRule.MEDIA_RULE"); |
101 shouldEvaluateTo("rules[2].cssRules.length", 1); | 101 shouldEvaluateTo("rules[2].cssRules.length", 1); |
102 shouldBe("rules[2].cssRules[0].type", "CSSRule.SUPPORTS_RULE"); | 102 shouldBe("rules[2].cssRules[0].type", "CSSRule.SUPPORTS_RULE"); |
(...skipping 19 matching lines...) Expand all Loading... |
122 shouldEvaluateTo("rules[0].cssRules.length", 2); | 122 shouldEvaluateTo("rules[0].cssRules.length", 2); |
123 shouldBe("rules[0].cssRules[0].type", "CSSRule.STYLE_RULE"); | 123 shouldBe("rules[0].cssRules[0].type", "CSSRule.STYLE_RULE"); |
124 shouldBe("rules[0].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); | 124 shouldBe("rules[0].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); |
125 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 1); | 125 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 1); |
126 shouldBe("rules[0].cssRules[1].cssRules[0].type", "CSSRule.STYLE_RULE"); | 126 shouldBe("rules[0].cssRules[1].cssRules[0].type", "CSSRule.STYLE_RULE"); |
127 | 127 |
128 </script> | 128 </script> |
129 </body> | 129 </body> |
130 </html> | 130 </html> |
131 | 131 |
OLD | NEW |