blob: 49f9c1b79a4efe9ea2ade0019f485b1fceb0a3be [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<style>
body {
height: 2000px;
width: 2000px;
}
.fixed {
position: fixed;
top: 50px;
left: 40px;
border: 1px solid black;
}
</style>
<script src="../../resources/js-test-pre.js"></script>
<script>
description("Tests scrolling to an anchor inside position:fixed after zooming doesn't try to scroll the page");
window.jsTestIsAsync = true;
function runTest()
{
if (window.eventSender)
eventSender.scalePageBy(2);
window.scrollTo(300, 800);
setTimeout(function() {
window.location='#anchor';
setTimeout(finishTest, 0);
}, 0);
}
function finishTest()
{
if (window.location.toString().indexOf("#") == -1) {
setTimeout(finishTest, 0);
return;
}
shouldBe('document.scrollingElement.scrollTop', '559');
shouldBe('document.scrollingElement.scrollLeft', '41');
finishJSTest();
}
</script>
</head>
<body onload="runTest()">
<div class="fixed">
<a name="anchor">Anchor is here</a>
</div>
<script src="../../resources/js-test-post.js"></script>
</body></html>