blob: f0f358266514ae1ed7a1f9f18337eb452db8cbff [file] [log] [blame]
<!doctype HTML>
<html class="reftest-wait">
<meta charset="utf8">
<title>Display Locking: anchor links prevented</title>
<link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org">
<link rel="help" href="https://github.com/WICG/display-locking">
<link rel="match" href="spacer-and-container-ref.html">
<script src="/common/reftest-wait.js"></script>
<style>
.spacer {
width: 150px;
height: 3000px;
background: lightblue;
}
#container {
contain: style layout;
width: 150px;
height: 150px;
background: lightgreen;
}
#target {
width: 100px;
height: 100px;
background: green;
}
</style>
<div class="spacer"></div>
<div id="container"><div id="target"></div></div>
<script>
function runTest() {
const container = document.getElementById("container");
container.displayLock.acquire({ timeout: Infinity, size: [150, 150] }).then(() => {
location.href += "#target";
requestAnimationFrame(takeScreenshot);
});
}
window.onload = () => { requestAnimationFrame(runTest); };
</script>
</html>