Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / media / media-query-list-01.html
blob7e10193e9389aa098f5cc110b786439c8b4318a7
1 <html>
2 <head>
3 <title>Test CSSOM View module: MediaQueryList interface</title>
4 <style type="text/css">
6 </style>
7 <script type="text/javascript" charset="utf-8">
8 if (window.testRunner)
9 testRunner.dumpAsText();
11 function log(m)
13 var results = document.getElementById('results');
14 results.innerHTML += m + '<br>';
17 function testQuery(query, expected)
19 var isTrue = window.matchMedia(query).matches;
20 var message = '\"' + query + '\" evaluates to ' + (isTrue ? 'true' : 'false');
21 message += (isTrue == expected) ? ': PASS' : ': FAIL';
22 log(message);
25 function runTests()
27 testQuery('screen', true);
28 testQuery('projection', false);
30 testQuery('all and (color)', true);
31 testQuery('not projection and (color)', true);
32 testQuery('(color)', true);
33 testQuery('(color', true);
34 testQuery('color', false);
36 testQuery('garbage', false);
38 testQuery('(min-device-width: 100px)', true);
39 testQuery('(min-device-width: 50000px)', false);
42 </script>
43 </head>
44 <body onload="runTests()">
45 <p>Test the MediaQueryList interface: <a href="http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface" title="CSSOM View Module">http://dev.w3.org/csswg/cssom-view/#the-mediaquerylist-interface</a>.</p>
46 <div id="results">
47 </div>
48 </body>
49 </html>