summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/css/media-rule-screenDepthPerComponent.html
blob: 41a13390fa9d027b1b3a56f9edaab63363d411b0 (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
<html>
    <head>
        <style id="style1">
            @media all and (min-color: 24) { .insane { color: green; } }
            @media all and (min-color: 2) { .sane { color: green; } }
        </style>
        <script>
            function runTest() {
                if (window.layoutTestController)
                    layoutTestController.dumpAsText();

                try {
                    document.getElementById('result').innerHTML += window.getComputedStyle(document.getElementById('result')).getPropertyValue("color");
                    document.getElementById('result2').innerHTML += window.getComputedStyle(document.getElementById('result2')).getPropertyValue("color");
                } catch (e) {
                    document.getElementById('result').innerHTML = 'EXCEPTION';
                }
            }
        </script>
    </head>
    <body onload="runTest();">
        <p> https://bugs.webkit.org/show_bug.cgi?id=20289 </p>
        Sanity check screenDepthPerComponent to ensure it is returning the number of bits per color rather than the screen depth (e.g. 24).
        <div class="insane" id="result">Should be rgb(0, 0, 0): </div>
        <div class="sane" id="result2">Should be rgb(0, 128, 0): </div>
    </body>
</html>