<html>
    <head>
        <style>
            div {
                height: 9999px;
                width: 9999px;
            }
        </style>
        <script src="../../../resources/js-test-pre.js"></script>
        <script>
            jsTestIsAsync = true;

            function runTest() {
                description('Tests that, for Quirks mode, changing the scrollTop property of a fake body element does not scroll the viewport');

                detachedBody = document.createElement('body');

                debug("");
                debug("Initial state.");
                shouldBe("detachedBody.scrollTop", "0");
                shouldBe("detachedBody.scrollLeft", "0");
                shouldBe("document.body.scrollTop = 0", "0");
                shouldBe("document.body.scrollLeft", "0");
                shouldBe("document.body.scrollTop", "0");
                shouldBe("document.documentElement.scrollLeft", "0");
                shouldBe("document.documentElement.scrollTop", "0");
                shouldBe("window.scrollX", "0");
                shouldBe("window.scrollY", "0");

                debug("");
                debug("Setting scrollTop on the detached body element should not change the main frame's scroll position.");
                shouldBe("detachedBody.scrollTop = 500", "500");
                shouldBe("document.body.scrollLeft", "0");
                shouldBe("document.body.scrollTop", "0");
                shouldBe("document.documentElement.scrollLeft", "0");
                shouldBe("document.documentElement.scrollTop", "0");
                shouldBe("window.scrollX", "0");
                shouldBe("window.scrollY", "0");
                shouldBe("detachedBody.scrollTop", "0");
                shouldBe("detachedBody.scrollLeft", "0");

                finishJSTest();
            }
        </script>
    </head>
    <body onload="runTest()">
        <div></div>
        <script src="../../../resources/js-test-post.js"></script>
    </body>
</html>
