summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/css3/device-adapt/viewport-height-extend-to-zoom.html
blob: bf14c7f18106235500b476e8aefea28dc414f9f1 (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
28
29
30
31
32
33
34
<!DOCTYPE html>
<html>
<head>
    <title>Viewport 'height' descriptor has 'extend-to-zoom' value</title>
    <script src="../../resources/testharness.js"></script>
    <script src="../../resources/testharnessreport.js"></script>
    <style>
        html, body { width: 100%; height: 100%; margin: 0 }
        @viewport { height: -internal-extend-to-zoom; zoom: 2.0; }
    </style>
</head>
<body>
    <div id="log"></div>
    <script>
        test(function(){
            assert_true(window.internals instanceof Object);
        }, "Check that window.internals is present. Required to call viewportAsText.");

        var actualWidth;
        var actualHeight;

        var vpString = internals.viewportAsText(document, 1, 320, 352);
        var match = /viewport size (.+)x(.+) scale (.+ )/.exec(vpString);

        if (match) {
            actualHeight = parseFloat(match[2]);
        }

        test(function(){
            assert_equals(actualHeight, 176);
        }, "Check viewport height.");
    </script>
</body>
</html>