3 <title>Test CSSOM View module: MediaQueryList 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.matchMedia(query).matches;
20 var message = '\
"' + query + '\" evaluates to ' + (isTrue ? 'true' : 'false');
21 message += (isTrue == expected) ? ': PASS' : ': FAIL';
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);
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>