blob: 4368a30b3b5de4bfd340ddc8a69fe5d910413cad [file] [log] [blame]
<!DOCTYPE html>
<html dir="rtl">
<head>
<style>
.wide {
width: 2000px;
height: 10px;
background-color: silver;
}
.origin {
position: absolute;
top: 0;
left: 0;
width: 10px;
height: 10px;
background-color: blue;
}
</style>
<script>
if (window.testRunner) {
testRunner.dumpAsText();
testRunner.waitUntilDone();
}
if (window.internals)
internals.settings.setScrollAnimatorEnabled(false);
function checkForScroll()
{
var expectedScrollLeft = -120;
var scrollLeft = document.scrollingElement.scrollLeft;
if (scrollLeft != expectedScrollLeft)
document.getElementById('result').textContent = "FAIL: scrollLeft is " + scrollLeft + ", expected " + expectedScrollLeft;
else
document.getElementById('result').textContent = "PASS: scrollLeft is " + scrollLeft;
if (window.testRunner)
testRunner.notifyDone();
}
function doTest()
{
if (window.eventSender) {
eventSender.monitorWheelEvents();
eventSender.keyDown("leftArrow");
eventSender.keyDown("leftArrow");
eventSender.keyDown("leftArrow");
setTimeout(function() {
eventSender.callAfterScrollingCompletes(checkForScroll);
}, 0);
}
}
window.addEventListener('load', doTest, false);
</script>
</head>
<body>
<div class="wide"></div>
<div class="origin"></div>
<div id="result"></div>
</body>
</html>