blob: 1d6e8ff17725d60f73d65c10de762447e347d76e [file] [log] [blame]
<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gbk"/>
<script src="../../../js-test-resources/js-test-pre.js"></script>
<script>
function runTest() {
description('Tests that loading a frame with a URL that contains a fragment pointed at a named anchor actually scrolls to that anchor.');
// Check scroll position in a timeout to make sure that the anchor has
// been scrolled to.
setTimeout(function() {
// Make sure that the body is taller than the viewport (i.e. scrolling is
// required).
shouldBeTrue('document.body.offsetHeight > document.documentElement.clientHeight');
// We should be scrolled at least a little bit
shouldBeTrue('document.scrollingElement.scrollTop > 0');
// And the bottom of the viewable area should be at least 2000 pixels from the top, due to the spacer element above.
shouldBeTrue('document.scrollingElement.scrollTop + document.documentElement.clientHeight > 2000');
finishJSTest();
}, 0);
}
var jsTestIsAsync = true;
</script>
</head>
<body onload="runTest()">
<p id="description"></p>
<div id="console"></div>
<div style="height: 2000px">
<!-- Spacer to make sure that the named anchor below requires scrolling -->
</div>
<a name="&#x586f">This is an anchor point named as the Unicode equivalent of the GBK sequence %a9g (test trailing low byte)</a>.
<script src="../../../js-test-resources/js-test-post.js"></script>
</body>
</html>