Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / media / media-query-list-syntax.html
blobd24f7110b3c207878600ed02e90345e70ffd93eb
1 <!DOCTYPE html>
2 <html>
3 <head>
4 <title>Media Query List syntax</title>
5 <link rel="author" title="Rune Lillesveen" href="mailto:rune@opera.com">
6 <link rel="help" href="http://www.w3.org/TR/css3-mediaqueries/#syntax">
7 <script type="text/javascript" src="../../resources/testharness.js"></script>
8 <script type="text/javascript" src="../../resources/testharnessreport.js"></script>
9 <style id="sheet">/**/</style>
10 <script>
12 var tests = [
13 [ "@media all, not,{}", "all, not all, not all" , "Media query error #1" ],
14 [ "@media screen, all and f() {}", "screen, not all", "Media query error #2" ],
15 [ "@media not and (color), #screen, screen {}", "not all, not all, screen", "Media query error #3" ],
16 [ "@media all; @media tv {}", "tv", "Media query error #4" ],
17 [ "@media ({ block, }), tv {}", "not all, tv", "Media query error #5" ],
18 [ "@media screen and(color), tv {}", "not all, tv", "Media query error #6" ],
19 [ "@media all and (color) and (f() {}), tv {}", "not all, tv", "Media query error #7" ],
20 [ "@media tv, all or (nothing) {}", "tv, not all", "Media query error #8" ],
21 [ "@media tv, all and (color) tv {}", "tv, not all", "Media query error #9" ]
23 var cdataNode = document.getElementById("sheet").firstChild;
24 for (var i=0; i < tests.length; i++) {
25 cdataNode.data = tests[i][0];
26 if (document.styleSheets[0].cssRules.length > 0 &&
27 document.styleSheets[0].cssRules[0].type == 4) {
28 result = document.styleSheets[0].cssRules[0].media.mediaText;
30 else {
31 result = "MEDIA RULE DROPPED!";
33 test(function() {
34 assert_equals(result, tests[i][1]);
35 }, tests[i][2]);
37 </script>
38 </head>
39 <body>
40 <div id="log"></div>
41 </body>
42 </html>