scrollbar-miss-mousemove.html 1.21 KB
Newer Older
treat@webkit.org's avatar
treat@webkit.org committed
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37
<html>
<body style="margin:0">
<script>
if (layoutTestController) {
    layoutTestController.dumpAsText();
    layoutTestController.waitUntilDone();
}
</script>
<div id="overflow" style="border:2px solid black;overflow:auto;height:400px;width:400px; position:absolute;">
<div style="background-color:green;height:1000px"></div>
<div style="background-color:red;height:1000px"></div>
</div>
<p>Test for <a href="https://bugs.webkit.org/show_bug.cgi?id=27289">bug
27289</a>: This tests that mouse clicks/releases on scrollbars are handled
properly even is there was no mouse move onto the scrollbar; this is the
enabled control case. On success, the offset should be 0.<p/>
<div id="console"></div>
<script>
if (eventSender) {
    document.getElementById('overflow').style.display = "none";
    eventSender.mouseMoveTo(390, 10);
    document.getElementById('overflow').style.display = "";
    eventSender.mouseDown();
    eventSender.mouseUp();
    eventSender.mouseMoveTo(390, 350);
    setTimeout(finished, 500);
}

function finished()
{
    document.getElementById('console').innerHTML
        = "Scroll offset is " + document.getElementById('overflow').scrollTop;
    window.layoutTestController.notifyDone();
}
</script>
</body>
</html>