blob: 83716393b9f8028a892bf8d526abfa913adb7832 [file] [log] [blame]
<html>
<head>
<style>
body {
height: 10000px;
}
#top-bar {
position: fixed;
width: 100%;
height: 200px;
background-color: green;
top: 0;
left: 0;
opacity: 0;
}
#bottom-bar {
position: fixed;
width: 100%;
height: 200px;
background-color: green;
bottom: 0;
left: 0;
opacity: 0;
}
</style>
<script src="../resources/js-test-pre.js"></script>
</head>
<body>
<div id="top-bar"></div>
<div id="bottom-bar"></div>
<script>
description("Test scrolling with page granularity by using the space bar. The fixed elements should be ignored because they are transparent.");
jsTestIsAsync = true;
var failTimeoutId;
function test() {
if (window.eventSender) {
// Force the first layout to avoid the suppressed scrollbar cases.
scratch = document.documentElement.offsetWidth;
// Avoid special cases for being "onload".
setTimeout(function() {
eventSender.keyDown(' ');
} , 0);
failTimeoutId = setTimeout(function() {
testFailed("The scrollview failed to scroll in response to the event.");
debug("window.scrollY = " + window.scrollY + " excepted value around " + (window.innerHeight - 40));
finishJSTest();
}, 1000);
}
}
window.addEventListener("scroll", function() {
if (window.scrollY == window.innerHeight - 40) {
testPassed("Scrolled to " + window.scrollY);
clearTimeout(failTimeoutId);
finishJSTest();
}
})
window.addEventListener("load", test);
</script>
<script src="../resources/js-test-post.js"></script>
</body>
</html>