servo/tests/wpt/web-platform-tests/scroll-to-text-fragment/scroll-to-text-fragment-target.html

27 lines
537 B
HTML

<!doctype html>
<title>Navigating to a text fragment anchor</title>
<script>
function checkScroll() {
let bc = new BroadcastChannel('scroll-to-text-fragment');
bc.postMessage({ didScrollToTarget: window.scrollY > 0 });
bc.close();
window.close();
}
</script>
<style>
body {
height: 3200px;
}
p {
position: absolute;
top: 3000px;
}
#element {
position: absolute;
top: 2000px;
}
</style>
<body onload="checkScroll()">
<div id="element">Element</div>
<p id="text">This is a test page</p>
</body>