summaryrefslogtreecommitdiffstats
path: root/third_party/WebKit/LayoutTests/fast/viewport/viewport-legacy-xhtmlmp-remove-and-add.html
blob: d58fc164c7700c2d3248187e5e927157574312af (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
35
36
37
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//WAPFORUM//DTD XHTML Mobile 1.0//EN" "http://www.wapforum.org/DTD/xhtml-mobile10.dtd">
<head>
    <!--
    Related spec: http://www.w3.org/TR/css-device-adapt/

    XHTML-MP is used for mobile documents which are assumed to be designed for
    handheld devices, hence using the viewport size as the initial containing
    block size, so using XHTML-MP will give the same result as a viewport
    meta tag with the following parameters:

    width=device-width, height=device-height, initial-scale=1

    -->
    <title>Default viewport value changed by XHTML-MP</title>
    <script>
        function test() {
            if (window.layoutTestController)
                layoutTestController.dumpAsText();

            if (window.internals)
                alert(internals.configurationForViewport(document, 1, 320, 480, 320, 352));

            var originalDoctype = document.doctype;
            document.removeChild(originalDoctype);

            if (window.internals)
                alert(internals.configurationForViewport(document, 1, 320, 480, 320, 352));

            document.insertBefore(originalDoctype, document.firstChild);

            if (window.internals)
                alert(internals.configurationForViewport(document, 1, 320, 480, 320, 352));
        }
    </script>
</head>
<body onload="test();" />