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 78 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
89 | 89 |
90 evalAndLog("rules[0].cssRules[1].insertRule('@supports (display: rainbow) {}
', 1)"); | 90 evalAndLog("rules[0].cssRules[1].insertRule('@supports (display: rainbow) {}
', 1)"); |
91 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 2); | 91 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 2); |
92 shouldBeType("rules[0].cssRules[1].cssRules[1]", "CSSSupportsRule"); | 92 shouldBeType("rules[0].cssRules[1].cssRules[1]", "CSSSupportsRule"); |
93 shouldBe("rules[0].cssRules[1].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); | 93 shouldBe("rules[0].cssRules[1].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); |
94 evalAndLog("rules[0].cssRules[1].deleteRule(1)"); | 94 evalAndLog("rules[0].cssRules[1].deleteRule(1)"); |
95 shouldEvaluateTo("rules[0].cssRules.length", 2); | 95 shouldEvaluateTo("rules[0].cssRules.length", 2); |
96 | 96 |
97 debug("\n@charset, @namespace, @import rules are not allowed inside @support
s.") | 97 debug("\n@charset, @namespace, @import rules are not allowed inside @support
s.") |
98 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."'); | 98 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."'); |
99 shouldThrow("rules[0].insertRule('@namespace \"\"', 2)", '"SyntaxError: Fail
ed to execute \'insertRule\' on \'CSSSupportsRule\': the rule \'@namespace \\"\\
"\' is invalid and cannot be parsed."'); | 99 shouldThrow("rules[0].insertRule('@namespace \"\"', 2)", '"HierarchyRequestE
rror: Failed to execute \'insertRule\' on \'CSSSupportsRule\': \'@namespace\' ru
les cannot be inserted inside a group rule."'); |
100 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."'); | 100 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."'); |
101 | 101 |
102 | 102 |
103 debug("\nWhitespace and formatting should be preserved within the condition,
whitespace outside the condition should be trimmed."); | 103 debug("\nWhitespace and formatting should be preserved within the condition,
whitespace outside the condition should be trimmed."); |
104 shouldBeEqualToString("rules[1].conditionText", "(( ( padding: 0) and (displ
ay: none)) or (display: rainbow))"); | 104 shouldBeEqualToString("rules[1].conditionText", "(( ( padding: 0) and (displ
ay: none)) or (display: rainbow))"); |
105 | 105 |
106 | 106 |
107 debug("\n@supports rule nested inside a media rule."); | 107 debug("\n@supports rule nested inside a media rule."); |
108 shouldBe("rules[2].type", "CSSRule.MEDIA_RULE"); | 108 shouldBe("rules[2].type", "CSSRule.MEDIA_RULE"); |
109 shouldEvaluateTo("rules[2].cssRules.length", 1); | 109 shouldEvaluateTo("rules[2].cssRules.length", 1); |
(...skipping 21 matching lines...) Expand all Loading... |
131 shouldEvaluateTo("rules[0].cssRules.length", 2); | 131 shouldEvaluateTo("rules[0].cssRules.length", 2); |
132 shouldBe("rules[0].cssRules[0].type", "CSSRule.STYLE_RULE"); | 132 shouldBe("rules[0].cssRules[0].type", "CSSRule.STYLE_RULE"); |
133 shouldBe("rules[0].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); | 133 shouldBe("rules[0].cssRules[1].type", "CSSRule.SUPPORTS_RULE"); |
134 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 1); | 134 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 1); |
135 shouldBe("rules[0].cssRules[1].cssRules[0].type", "CSSRule.STYLE_RULE"); | 135 shouldBe("rules[0].cssRules[1].cssRules[0].type", "CSSRule.STYLE_RULE"); |
136 | 136 |
137 </script> | 137 </script> |
138 </body> | 138 </body> |
139 </html> | 139 </html> |
140 | 140 |
OLD | NEW |