<html id='iframe-root'>
<head>
    <style>
        div {
            width: 100px;
            height: 100px;
            border: 1px solid black;
        }

        #iframe-abs-div {
            position: absolute;
            background-color: red;
            left: 100px;
        }

        #iframe-fixed-div {
            position: fixed;
            background-color: blue;
            left: 200px;
        }
    </style>

    <script>
        if (window.testRunner)
            testRunner.dumpAsText();

        function doTest()
        {
            var pre = document.getElementById('iframe-console');
            var tosend = '';
            if(!window.internals)
                return;

            var divs = ['iframe-div', 'iframe-abs-div', 'iframe-fixed-div', 'iframe-root'];
            for (var i = 0; i < divs.length; i++) {
                var div1 = document.getElementById(divs[i]);
                for (var j = 0; j < divs.length; j++) {
                    var div2 = document.getElementById(divs[j]);
                    var scrollsWithRespectTo = window.internals.scrollsWithRespectTo(div1, div2);

                    var successText = scrollsWithRespectTo ? 'scrolls with respect to' : 'does not scroll with respect to';
                    var messageText = div1.id + ' ' + successText + ' ' + div2.id;
                    tosend += messageText + '\n';
                }
            }
            window.top.postMessage(tosend, '*');
        }

        window.onload = doTest;
    </script>
</head>

<body>
    <div id='iframe-div' style='overflow:scroll'></div>
    <div id='iframe-abs-div'></div>
    <div id='iframe-fixed-div'></div>
    <div></div>
    <div></div>
    <div></div>
    <div></div>
    <pre id='iframe-console'></pre>
</body>
</html>