Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(447)

Side by Side Diff: third_party/WebKit/LayoutTests/css3/supports-cssom.html

Issue 2428223002: Remove the trailing whitespace in CSSMediaRule::cssText (Closed)
Patch Set: Fix test case Created 4 years, 2 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 95 matching lines...) Expand 10 before | Expand all | Expand 10 after
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);
110 shouldBeType("rules[2].cssRules[0]", "CSSSupportsRule"); 110 shouldBeType("rules[2].cssRules[0]", "CSSSupportsRule");
111 shouldBe("rules[2].cssRules[0].type", "CSSRule.SUPPORTS_RULE"); 111 shouldBe("rules[2].cssRules[0].type", "CSSRule.SUPPORTS_RULE");
112 shouldBeEqualToString("rules[2].cssRules[0].conditionText", "( padding: 0)") ; 112 shouldBeEqualToString("rules[2].cssRules[0].conditionText", "( padding: 0)") ;
113 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 1); 113 shouldEvaluateTo("rules[0].cssRules[1].cssRules.length", 1);
114 shouldBe("rules[2].cssRules[0].cssRules[0].type", "CSSRule.PAGE_RULE"); 114 shouldBe("rules[2].cssRules[0].cssRules[0].type", "CSSRule.PAGE_RULE");
115 shouldBeEqualToString("rules[2].cssText", 115 shouldBeEqualToString("rules[2].cssText",
116 "@media all { \n" + 116 "@media all {\n" +
117 " @supports ( padding: 0) {\n" + 117 " @supports ( padding: 0) {\n" +
118 " @page :left { top: 0px; }\n" + 118 " @page :left { top: 0px; }\n" +
119 "}\n" + 119 "}\n" +
120 "}"); 120 "}");
121 121
122 122
123 debug("\nNo extra parens should be added to the conditionText."); 123 debug("\nNo extra parens should be added to the conditionText.");
124 shouldBeEqualToString("rules[3].conditionText", "(border: black) and (paddin g: 0) and (width: 0)"); 124 shouldBeEqualToString("rules[3].conditionText", "(border: black) and (paddin g: 0) and (width: 0)");
125 125
126 126
127 debug("\nDeleting a top-level rule should work correctly."); 127 debug("\nDeleting a top-level rule should work correctly.");
128 evalAndLog("document.styleSheets[1].deleteRule(3)"); 128 evalAndLog("document.styleSheets[1].deleteRule(3)");
129 shouldEvaluateTo("rules.length", 3); 129 shouldEvaluateTo("rules.length", 3);
130 shouldBe("rules[0].type", "CSSRule.SUPPORTS_RULE"); 130 shouldBe("rules[0].type", "CSSRule.SUPPORTS_RULE");
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
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698