| OLD | NEW |
| 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 Loading... |
| 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> |
| OLD | NEW |