chromium/third_party/blink/web_tests/fast/dom/Element/offsetLeft-offsetTop-html.html

<html>
<head>
    <script>
        function log(message)
        {
            var console = document.getElementById("console");
            console.appendChild(document.createTextNode(message + "\n"));
        }
        function testFrame(name)
        {
            frame = frames[name];
            var doc = frame.document;
            var target = doc.getElementById("target");
            log(name + ": (" + target.offsetLeft + ", " + target.offsetTop + ")");
        }
        function test()
        {
            if (window.testRunner)
                testRunner.dumpAsText();

            testFrame("control");
            testFrame("static");
            testFrame("absolute");
        }
    </script>
    <style>
        iframe { border: thin solid; height: 100px; }
    </style>
</head>
<body style="padding: 9px; margin: 10px" onload="test()">
    <pre id="console"></pre>

    <iframe name="control" srcdoc='
        <html id="target"></html>
    '>
    </iframe>

    <br>
    <iframe name="static" srcdoc='
        <html id="target" style="padding: 10px; margin: 10px; border: 10px solid blue;">
        </html>
    '>
    </iframe>

    <br>

    <iframe name="absolute" srcdoc='
        <html id="target" style="position: absolute; left: 20px; top: 10px; width: 40px; height: 40px; padding: 10px; margin: 0px; border: 10px solid blue">
        </html>
    '>
    </iframe>
</body>
</html>