Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / third_party / WebKit / LayoutTests / fast / media / matchmedium-query-api.html
blobc91f57e5636c782541f9225a8cb266f5e91aeed2
1 <html>
2 <head>
3 <title>Test CSSOM View module: Media 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.styleMedia.matchMedium(query);
21 var message = '\"' + query + '\" evaluates to ' + (isTrue ? 'true' : 'false');
22 message += (isTrue == expected) ? ': PASS' : ': FAIL';
23 log(message);
26 function runTests()
28 testQuery('screen', true);
29 testQuery('projection', false);
31 testQuery('all and (color)', true);
32 testQuery('not projection and (color)', true);
33 testQuery('(color)', true);
34 testQuery('(color', true);
35 testQuery('color', false);
37 testQuery('garbage', false);
39 testQuery('(min-device-width: 100px)', true);
40 testQuery('(min-device-width: 50000px)', false);
43 </script>
44 </head>
45 <body onload="runTests()">
46 <p>Test the media interface: <a href="http://dev.w3.org/csswg/cssom-view/#the-media-interface" title="CSSOM View Module">http://dev.w3.org/csswg/cssom-view/#the-media-interface</a>.</p>
47 <div id="results">
49 </div>
50 </body>
51 </html>