blob: cc6676448bb89f8af77d1808a53957b53ea25a81 [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire, then the element is shifted down by a div above.
-->
<style>
#container {
contain: style layout;
width: 150px;
height: 150px;
background: lightblue;
}
#spacer {
width: 100px;
height: 50px;
background: lightgreen;
}
#checker {
width: 100px;
height: 50px;
background: green;
}
</style>
<div id="log"></div>
<div id="spacer"></div>
<div id="container"></div>
<div id="checker"></div>
<script>
// TODO(vmpstr): In WPT this needs to be replaced with reftest-wait.
if (window.testRunner)
window.testRunner.waitUntilDone();
function finishTest(status_string) {
if (document.getElementById("log").innerHTML === "")
document.getElementById("log").innerHTML = status_string;
if (window.testRunner)
window.testRunner.notifyDone();
}
function runTest() {
let container = document.getElementById("container");
container.getDisplayLock().acquire({ timeout: Infinity }).then(() => {
document.getElementById("spacer").style.height = "100px";
finishTest("PASS");
});
}
window.onload = runTest;
</script>