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

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

Issue 2416893002: CSSMediaRule and CSSSupportsRule inherit from CSSConditionRule (Closed)
Patch Set: Fix supports 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 side-by-side diff with in-line comments
Download patch
Index: third_party/WebKit/LayoutTests/css3/media-cssom.html
diff --git a/third_party/WebKit/LayoutTests/css3/media-cssom.html b/third_party/WebKit/LayoutTests/css3/media-cssom.html
new file mode 100644
index 0000000000000000000000000000000000000000..d783c6c14e4ae0118143da72e4bcf8c5bb3fc0d1
--- /dev/null
+++ b/third_party/WebKit/LayoutTests/css3/media-cssom.html
@@ -0,0 +1,52 @@
+<!DOCTYPE html>
+<html>
+<head>
meade_UTC10 2016/10/17 02:58:44 You can omit the <html>, <head> and <body> tags.
+<title>@media CSSOM - inherited from CSSConditionRule</title>
+<script src="../resources/testharness.js"></script>
+<script src="../resources/testharnessreport.js"></script>
+<style>
+ @media screen and (min-width: 480px) {
+ body { background-color: lightgreen; }
+ }
+ @media {
+ body { background-color: red; }
+ }
+</style>
+</head>
+<body>
+<p>Test for <a href="http://crbug.com/651792">bug 651792</a>.</p>
+<script>
+ var rules = document.styleSheets[0].cssRules;
+ test(function(){
+ assert_equals(CSSRule.STYLE_RULE,1);
+ assert_equals(CSSRule.MEDIA_RULE,4);
+ assert_equals(rules.length, 2);
+ assert_equals(rules[0].type, 4);
+ assert_equals(rules[0].cssRules.length, 1);
+ assert_equals(rules[0].cssRules[0].type, 1);
+ assert_equals(rules[0].media.mediaText, "screen and (min-width: 480px)");
+ assert_equals(rules[0].conditionText, "screen and (min-width: 480px)");
+ assert_equals(rules[0].media.mediaText,rules[0].conditionText);
+ assert_equals(rules[0].cssText,
+ "@media screen and (min-width: 480px) { \n" +
+ " body { background-color: lightgreen; }\n" +
+ "}");
+ }, "@media inherited from CSSConditionRule.");
meade_UTC10 2016/10/17 02:58:44 Nit: It'd be nice to have newlines around the indi
+ test(function(){
+ assert_equals(CSSRule.STYLE_RULE,1);
+ assert_equals(CSSRule.MEDIA_RULE,4);
+ assert_equals(rules.length, 2);
+ assert_equals(rules[1].type, 4);
+ assert_equals(rules[1].cssRules.length, 1);
+ assert_equals(rules[1].cssRules[0].type, 1);
+ assert_equals(rules[1].media.mediaText, "");
+ assert_equals(rules[1].conditionText, "");
+ assert_equals(rules[1].media.mediaText,rules[1].conditionText);
+ assert_equals(rules[1].cssText,
+ "@media { \n" +
+ " body { background-color: red; }\n" +
+ "}");
+ }, "@media inherited from CSSConditionRule, empty media.");
+</script>
+</body>
+</html>

Powered by Google App Engine
This is Rietveld 408576698