<!DOCTYPE html> <!-- webkit-test-runner [ AsyncOverflowScrollingEnabled=true ] -->
<html>
<head>
    <style>
        body {
            height: 1000px;
        }

        .scroller {
            position: absolute;
            height: 300px;
            width: 300px;
            border: 2px solid gray;
            padding: 5px;
            overflow: scroll;
        }
        
        .inner-scroller {
            overflow-x: scroll;
            overflow-y: hidden;
            height: 400px;
            border: 1px solid black;
        }
        
        .stacking {
            opacity: 0.8;
        }

        .filler {
            height: 500px;
            width: 10px;
        }

        .wide {
            width: 200%;
            height: 10px;
        }
        
        .absolute {
            position: absolute;
            top: 100px;
            left: 50px;
            height: 200px;
            width: 200px;
            background-color: green;
        }
    </style>
    <script src="../../resources/ui-helper.js"></script>
    <script>
        if (window.testRunner)
            testRunner.waitUntilDone();

        async function doTest()
        {
            await UIHelper.ensurePresentationUpdate(); // Not sure why this is necessary, but it is.
            let scroller = document.querySelector('.scroller');
            scroller.scrollTo(0, 100);
            await UIHelper.ensurePresentationUpdate();

            if (window.testRunner)
                testRunner.notifyDone();
        }
        
        window.addEventListener('load', doTest, false);
    </script>
</head>
<body>
    <div class="scroller">
        <div class="inner-scroller">
            <div class="wide"></div>
            <div class="stacking">
                <div class="absolute"></div>
            </div>
        </div>
        <div class="filler"></div>
    </div>
</body>
</html>
