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

Side by Side Diff: third_party/WebKit/LayoutTests/css3/condition-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
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/css3/device-adapt/viewport-at-rule-parsing.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
1 <!DOCTYPE html> 1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script> 2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script> 3 <script src="../resources/testharnessreport.js"></script>
4 <style> 4 <style>
5 @media screen and (min-width: 480px) { 5 @media screen and (min-width: 480px) {
6 body { background-color: lightgreen; } 6 body { background-color: lightgreen; }
7 } 7 }
8 @media { 8 @media {
9 body { background-color: red; } 9 body { background-color: red; }
10 } 10 }
(...skipping 13 matching lines...) Expand all
24 assert_equals(CSSRule.STYLE_RULE,1); 24 assert_equals(CSSRule.STYLE_RULE,1);
25 assert_equals(CSSRule.MEDIA_RULE,4); 25 assert_equals(CSSRule.MEDIA_RULE,4);
26 assert_equals(rules.length, 3); 26 assert_equals(rules.length, 3);
27 assert_equals(rules[0].type, 4); 27 assert_equals(rules[0].type, 4);
28 assert_equals(rules[0].cssRules.length, 1); 28 assert_equals(rules[0].cssRules.length, 1);
29 assert_equals(rules[0].cssRules[0].type, 1); 29 assert_equals(rules[0].cssRules[0].type, 1);
30 assert_equals(rules[0].media.mediaText, "screen and (min-width: 480px)") ; 30 assert_equals(rules[0].media.mediaText, "screen and (min-width: 480px)") ;
31 assert_equals(rules[0].conditionText, "screen and (min-width: 480px)"); 31 assert_equals(rules[0].conditionText, "screen and (min-width: 480px)");
32 assert_equals(rules[0].media.mediaText,rules[0].conditionText); 32 assert_equals(rules[0].media.mediaText,rules[0].conditionText);
33 assert_equals(rules[0].cssText, 33 assert_equals(rules[0].cssText,
34 "@media screen and (min-width: 480px) { \n" + 34 "@media screen and (min-width: 480px) {\n" +
35 " body { background-color: lightgreen; }\n" + 35 " body { background-color: lightgreen; }\n" +
36 "}"); 36 "}");
37 }, "@media inherited from CSSConditionRule."); 37 }, "@media inherited from CSSConditionRule.");
38 38
39 test(function(){ 39 test(function(){
40 assert_equals(rules.length, 3); 40 assert_equals(rules.length, 3);
41 assert_equals(rules[1].type, 4); 41 assert_equals(rules[1].type, 4);
42 assert_equals(rules[1].cssRules.length, 1); 42 assert_equals(rules[1].cssRules.length, 1);
43 assert_equals(rules[1].cssRules[0].type, 1); 43 assert_equals(rules[1].cssRules[0].type, 1);
44 assert_equals(rules[1].media.mediaText, ""); 44 assert_equals(rules[1].media.mediaText, "");
45 assert_equals(rules[1].conditionText, ""); 45 assert_equals(rules[1].conditionText, "");
46 assert_equals(rules[1].media.mediaText,rules[1].conditionText); 46 assert_equals(rules[1].media.mediaText,rules[1].conditionText);
47 assert_equals(rules[1].cssText, 47 assert_equals(rules[1].cssText,
48 "@media { \n" + 48 "@media {\n" +
49 " body { background-color: red; }\n" + 49 " body { background-color: red; }\n" +
50 "}"); 50 "}");
51 }, "@media inherited from CSSConditionRule, empty media."); 51 }, "@media inherited from CSSConditionRule, empty media.");
52 52
53 test(function(){ 53 test(function(){
54 assert_equals(rules.length, 3); 54 assert_equals(rules.length, 3);
55 assert_equals(rules[2].cssRules.length, 1); 55 assert_equals(rules[2].cssRules.length, 1);
56 assert_equals(rules[2].conditionText, "(width: 0)"); 56 assert_equals(rules[2].conditionText, "(width: 0)");
57 assert_equals(rules[2].cssText, 57 assert_equals(rules[2].cssText,
58 "@supports (width: 0) {\n" + 58 "@supports (width: 0) {\n" +
59 " s { width: 0px; }\n" + 59 " s { width: 0px; }\n" +
60 "}"); 60 "}");
61 }, "@supports inherited from CSSConditionRule."); 61 }, "@supports inherited from CSSConditionRule.");
62 </script> 62 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/css3/device-adapt/viewport-at-rule-parsing.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698