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

Unified Diff: LayoutTests/fast/media/media-query-list-syntax.html

Issue 14620012: Improved parse error handling for CSSMQ. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@query-selector-performance
Patch Set: Let expected result for "and(" be the current implementation. Created 7 years, 6 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: LayoutTests/fast/media/media-query-list-syntax.html
diff --git a/LayoutTests/fast/media/media-query-list-syntax.html b/LayoutTests/fast/media/media-query-list-syntax.html
new file mode 100644
index 0000000000000000000000000000000000000000..d13faa71c4888d9369a069e815435e99eef299d3
--- /dev/null
+++ b/LayoutTests/fast/media/media-query-list-syntax.html
@@ -0,0 +1,40 @@
+<!DOCTYPE html>
+<html>
+<head>
+ <title>Media Query List syntax</title>
+ <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
+ <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#syntax">
+ <script type="text/javascript" src="../../resources/testharness.js"></script>
+ <script type="text/javascript" src="../../resources/testharnessreport.js"></script>
+ <style id="sheet">/**/</style>
+ <script>
+
+ var tests = [
+ [ "@media all, not,{}", "all, not all, not all" , "Media query error #1" ],
+ [ "@media screen, all and f() {}", "screen, not all", "Media query error #2" ],
+ [ "@media not and (color), #screen, screen {}", "not all, not all, screen", "Media query error #3" ],
+ [ "@media all; @media tv {}", "tv", "Media query error #4" ],
+ [ "@media ({ block, }), tv {}", "not all, tv", "Media query error #5" ],
+ [ "@media screen and(color), tv {}", "screen and (color), tv", "Media query error #6" ],
+ [ "@media all and (color) and (f() {}), tv {}", "not all, tv", "Media query error #7" ]
+ ];
+ var cdataNode = document.getElementById("sheet").firstChild;
+ for (var i=0; i < tests.length; i++) {
+ cdataNode.data = tests[i][0];
+ if (document.styleSheets[0].cssRules.length > 0 &&
+ document.styleSheets[0].cssRules[0].type == 4) {
+ result = document.styleSheets[0].cssRules[0].media.mediaText;
+ }
+ else {
+ result = "MEDIA RULE DROPPED!";
+ }
+ test(function() {
+ assert_equals(result, tests[i][1]);
+ }, tests[i][2]);
+ }
+ </script>
+</head>
+<body>
+ <div id="log"></div>
+</body>
+</html>
« no previous file with comments | « LayoutTests/fast/media/import-media-01-expected.html ('k') | LayoutTests/fast/media/media-query-list-syntax-expected.txt » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698