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

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

Issue 2416893002: CSSMediaRule and CSSSupportsRule inherit from CSSConditionRule (Closed)
Patch Set: Refine variable's name and trace 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/supports-cssom.html » ('j') | no next file with comments »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
OLDNEW
(Empty)
1 <!DOCTYPE html>
2 <script src="../resources/testharness.js"></script>
3 <script src="../resources/testharnessreport.js"></script>
4 <style>
5 @media screen and (min-width: 480px) {
6 body { background-color: lightgreen; }
7 }
8 @media {
9 body { background-color: red; }
10 }
11 </style>
12 <p>Test for @media CSSOM <a href="http://crbug.com/651792">bug 651792</a>.</p>
13 <script>
14 var rules = document.styleSheets[0].cssRules;
15 test(function(){
16 assert_equals(CSSRule.STYLE_RULE,1);
17 assert_equals(CSSRule.MEDIA_RULE,4);
18 assert_equals(rules.length, 2);
19 assert_equals(rules[0].type, 4);
20 assert_equals(rules[0].cssRules.length, 1);
21 assert_equals(rules[0].cssRules[0].type, 1);
22 assert_equals(rules[0].media.mediaText, "screen and (min-width: 480px)") ;
23 assert_equals(rules[0].conditionText, "screen and (min-width: 480px)");
24 assert_equals(rules[0].media.mediaText,rules[0].conditionText);
25 assert_equals(rules[0].cssText,
26 "@media screen and (min-width: 480px) { \n" +
27 " body { background-color: lightgreen; }\n" +
28 "}");
29 }, "@media inherited from CSSConditionRule.");
foolip 2016/10/17 09:25:40 Can you add explicit tests for the prototype chain
30
31 test(function(){
32 assert_equals(CSSRule.STYLE_RULE,1);
33 assert_equals(CSSRule.MEDIA_RULE,4);
34 assert_equals(rules.length, 2);
35 assert_equals(rules[1].type, 4);
36 assert_equals(rules[1].cssRules.length, 1);
37 assert_equals(rules[1].cssRules[0].type, 1);
38 assert_equals(rules[1].media.mediaText, "");
39 assert_equals(rules[1].conditionText, "");
40 assert_equals(rules[1].media.mediaText,rules[1].conditionText);
41 assert_equals(rules[1].cssText,
42 "@media { \n" +
43 " body { background-color: red; }\n" +
44 "}");
45 }, "@media inherited from CSSConditionRule, empty media.");
46 </script>
OLDNEW
« no previous file with comments | « no previous file | third_party/WebKit/LayoutTests/css3/supports-cssom.html » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698