Upstream version 9.38.198.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / LayoutTests / fast / media / mq-pointer.html
1 <html>
2 <head>
3 <title>Test CSS4 media query "pointer" and "hover" features.</title>
4 <style type="text/css">
5
6 </style>
7 <script type="text/javascript" charset="utf-8">
8     if (window.testRunner)
9         testRunner.dumpAsText();
10
11     function log(m) {
12         document.getElementById('results').innerHTML += m + '<br>';
13     }
14
15     function testQueries()
16     {
17         var queries = [
18             "(pointer)",
19             "(Pointer)",
20             "(pointer:none)",
21             "(pointer:coarse)",
22             "(pointer:coARse)",
23             "(pointer:bogusvalue)",
24             "(pointer:fine)",
25             "(hover)",
26             "(hover:none)",
27             "(hover:hover)",
28             "(hover:on-demand)",
29             "(hover:bogusvalue)" ];
30         for (var index=0; index < queries.length; index++) {
31             log("Query &quot;" + queries[index] + "&quot: " +
32                 window.matchMedia(queries[index]).matches);
33         }
34     }
35
36     function runTests()
37     {
38         log("------------- default configuration -------------");
39         testQueries();
40
41         if (window.internals) {
42             internals.settings.setDeviceSupportsTouch(true);
43
44             log("------------- with touch screen -------------");
45             testQueries();
46         }
47     }
48
49 </script>
50 </head>
51 <body onload="runTests()">
52     <p>Test the <a href="http://dev.w3.org/csswg/css4-mediaqueries/#pointer">(pointer)</a> and
53     <a href="http://dev.w3.org/csswg/css4-mediaqueries/#hover">(hover)</a> media features.
54     See <a href="https://bugs.webkit.org/show_bug.cgi?id=87403">Bug 87403</a> for details.</p>
55
56     <div id="results">
57     </div>
58 </body>
59 </html>