blob: 65beb17103c14924703977b179af8c33af77ec21 [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<script src="../../../js-test-resources/js-test-pre.js"></script>
<script>
function runTest() {
description('Tests that loading a cross-origin frame with a URL that contains an anchor fragment does not scroll this frame.');
description('This prevents a cross-origin information leak sometimes know as framesniffing.');
// Check scroll position in a timeout to make sure that the anchor has not been scrolled to.
setTimeout(function() {
shouldBeTrue('document.scrollingElement.scrollTop == 0');
shouldBeTrue('document.scrollingElement.scrollLeft == 0');
finishJSTest();
}, 0);
}
var jsTestIsAsync = true;
</script>
</head>
<body>
<!-- large cross-origin grandchild frame -->
<iframe height="8000" width="8000" src="http://localhost:8000/navigation/resources/grandchild-with-anchor.html#anchor1" name="grandchild" onload="runTest()">
</iframe>
<script src="../../../js-test-resources/js-test-post.js"></script>
</body>
</html>