blob: 1b3083a916a83aebb5cd17ff7fa3f6e09e93d5fb [file] [edit]
<!-- webkit-test-runner [ showsScrollIndicators=false useHardwareKeyboardMode=true ] -->
<!DOCTYPE html>
<html>
<head>
<meta name="viewport" content="width=device-width">
<script src="../../../resources/ui-helper.js"></script>
<style>
body {
margin: 0;
padding: 0;
}
</style>
<script>
if (window.testRunner)
testRunner.waitUntilDone();
let secondSquareMaxY;
function done()
{
if (window.testRunner)
testRunner.notifyDone();
}
function didEndScroll()
{
window.onscroll = null;
UIHelper.waitForZoomingOrScrollingToEnd().then(done);
}
window.onscroll = function (event) {
if (window.scrollY + window.innerHeight >= secondSquareMaxY)
didEndScroll();
}
function runTest()
{
let secondSquare = document.getElementById("secondSquare");
secondSquareMaxY = secondSquare.offsetTop + secondSquare.offsetHeight;
if (window.testRunner)
UIHelper.keyDown("downArrow", ["metaKey"]);
}
</script>
</head>
<body onload="runTest()">
<p id="description">Tests that pressing <key>Command</key> + <key>&#x2193;</key> scrolls to the bottom of the page. This test PASSED if you see a green square. Otherwise, it FAILED.</p>
<div style="width: 256px; height: 256px; background-color: red"></div>
<div style="height: 2000px"></div>
<div id="secondSquare" style="width: 256px; height: 256px; background-color: green"></div>
</body>
</html>