3 <title>Test CSSOM View module: Media interface
</title>
4 <style type=
"text/css">
7 <script type=
"text/javascript" charset=
"utf-8">
9 testRunner.dumpAsText();
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';
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);
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>