summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/media/invalid-lengths.html
blob: 50a933dfa79d81037465f5238c7cfea475335421 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
<!DOCTYPE html>
<pre id="console">
</pre>
<script>
    if (window.testRunner)
        testRunner.dumpAsText();
  
    function log(message)
    {
        document.getElementById('console').appendChild(document.createTextNode(message + "\n"));
    }
  
    function testQuery(query, expected)
    {
        var actual = window.styleMedia.matchMedium(query);
        var message = (actual === expected) ? 'PASS' : 'FAIL';
        message += ": \"" + query + "\" evaluates to " + (actual ? "true" : "false") + ".";
        log(message);
    }
  
    testQuery('(min-device-width: 0)', true);
    testQuery('(min-device-width: 1px)', true);
    testQuery('(min-device-width: 1deg)', false);
    testQuery('(min-device-width: 1)', false);
    testQuery('(min-device-width: solid)', false);
    testQuery('(min-device-width: "red")', false);
</script>