<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true AsyncFrameScrollingEnabled=true ] -->
<html>
<head>
    <meta name="viewport" content="width=device-width">
    <style>
        iframe {
            position: relative;
            border: 1px solid black;
            width: 300px;
            height: 300px;
        }
    </style>
    <script>
        function doTest()
        {
            let iframe = document.getElementById('test-frame');
            iframe.contentDocument.scrollingElement.scrollTop = 300;
        }
        
        window.addEventListener('load', doTest, false);
    </script>
</head>
<body>
    <iframe id="test-frame" srcdoc="
        <style>
            body {
                height: 2000px;
                margin: 0;
            }
            .box {
                margin-top: 300px;
                width: 300px;
                height: 300px;
                background-color: green;
            }
        </style>
        <body>
            <div class='box'></div>
        </body>
    ">
</body>
</html>
