<!DOCTYPE html> <!-- webkit-test-runner [ useFlexibleViewport=true AsyncOverflowScrollingEnabled=true allowsLinkPreview=false ] -->
<html>
<head>
<meta name="viewport" content="width=device-width, initial-scale=1, user-scalable=no">
<script src="../../../resources/js-test.js"></script>
<script src="../../../resources/ui-helper.js"></script>
<script src="../../../resources/basic-gestures.js"></script>
<style>
html, body {
    width: 100%;
    height: 100%;
    margin: 0px;
    padding: 0px;
}

#scroller {
    width: 100%;
    height: 75%;
    overflow: scroll;
    border: 4px solid black;
    box-sizing: border-box;
}

#content {
    width: 100px;
    height: 5000px;
    box-sizing: border-box;
    padding: 20px;
    background: linear-gradient(to bottom, red 0%, green 50%, blue 100%);
}
</style>
<body onload="runTest()">
    <div id="scroller">
        <div id="content"></div>
    </div>
    <p id="description"></p>
    <p id="console"></p>
</body>
<script>
jsTestIsAsync = true;

let reachedMinimumScrollPosition = false;
const minimumExpectedScrollTop = 500;
const scroller = document.getElementById("scroller");

scroller.addEventListener("scroll", observeScrollEvent);
scroller.addEventListener("click", () => testFailed("Observed unexpected click event."), { once: true });

function noteTestProgress() {
    if (!window.progress)
        progress = 0;
    if (++progress == 2)
        finishJSTest();
}

async function observeScrollEvent() {
    if (!window.testRunner || scroller.scrollTop < minimumExpectedScrollTop || reachedMinimumScrollPosition)
        return;

    reachedMinimumScrollPosition = true;
    testPassed(`scroller.scrollTop passed ${minimumExpectedScrollTop}`);
    removeEventListener("scroll", observeScrollEvent);
    await longPressAtPoint(160, 250, 1);
    await UIHelper.waitForDoubleTapDelay();
    noteTestProgress();
}

async function runTest()
{
    description("Verifies that long pressing a subscrollable region during momentum scrolling does not dispatch click events. This test requires WebKitTestRunner.");

    if (!window.testRunner)
        return;

    await UIHelper.dragFromPointToPoint(160, 250, 160, 50, 0.1);
    noteTestProgress();
}
</script>
</html>
