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

        .scroller {
            position: absolute;
            left: 20px;
            top: 220px;
            height: 200px;
            width: 200px;
            border: 4px solid gray;
            padding: 5px;
            box-sizing: border-box;
            overflow: scroll;
        }
        .content {
            width: 200%;
            height: 300%;
        }
        
    </style>
    <script src="../../../resources/js-test-pre.js"></script>
    <script src="../../../resources/ui-helper.js"></script>
    <script>
        var jsTestIsAsync = true;

        const topContentInset = 55;
        var scroller;
        var overflowScrollEventCount = 0;
        var windowScrollEventCount = 0;

        async function resetScrollPositions()
        {
            window.scrollTo(0, 200);
            scroller.scrollTop = 0;
            
            // Wait for scroll events to fire.
            await UIHelper.animationFrame();

            overflowScrollEventCount = 0;
            windowScrollEventCount = 0;
        }

        async function testScrollOutsideTopLeft()
        {
            debug('');
            debug('Test scroll outside top left corner');
            await resetScrollPositions();
            await UIHelper.mouseWheelScrollAt(18, topContentInset + 18);

            shouldBe('overflowScrollEventCount', '0');
            shouldBe('windowScrollEventCount > 0', 'true');
        }

        async function testScrollInsideTopLeft()
        {
            debug('');
            debug('Test scroll inside top left corner');
            await resetScrollPositions();
            await UIHelper.mouseWheelScrollAt(25, topContentInset + 25);

            shouldBe('overflowScrollEventCount > 0', 'true');
            shouldBe('windowScrollEventCount', '0');
        }

        async function testScrollOutsideBottomRight()
        {
            debug('');
            debug('Test scroll outside bottom right corner');
            await resetScrollPositions();
            await UIHelper.mouseWheelScrollAt(220, topContentInset + 220);

            shouldBe('overflowScrollEventCount', '0');
            shouldBe('windowScrollEventCount > 0', 'true');
        }

        async function testScrollInsideBottomRight()
        {
            debug('');
            debug('Test scroll inside bottom right corner');
            await resetScrollPositions();
            await UIHelper.mouseWheelScrollAt(198, topContentInset + 198);

            shouldBe('overflowScrollEventCount > 0', 'true');
            shouldBe('windowScrollEventCount', '0');
        }

        async function scrollTest()
        {
            await testScrollOutsideTopLeft();
            await testScrollInsideTopLeft();
            await testScrollOutsideBottomRight();
            await testScrollInsideBottomRight();

            finishJSTest();
        }

        window.addEventListener('load', () => {
            
            if (window.internals)
                internals.setTopContentInset(topContentInset);
        
            scroller = document.querySelector('.scroller');
            scroller.addEventListener('scroll', () => {
                ++overflowScrollEventCount;
            }, false);

            window.addEventListener('scroll', () => {
                ++windowScrollEventCount;
            }, false);

            setTimeout(scrollTest, 0);
        }, false);

        var successfullyParsed = true;
    </script>
</head>
<body>
    <div class="scroller">
        <div class="content"></div>
    </div>
    <div id="console"></div>
    <script src="../../../resources/js-test-post.js"></script>
</body>
</html>
