blob: 0a7558c0da4a282e45e64c1774b54fb763687033 [file] [log] [blame]
<!doctype HTML>
<!--
Resizes the element and runs acquire, which should use the new size.
-->
<style>
.contained {
contain: style layout;
background: lightblue;
}
#small {
width: 50px;
height: 50px;
}
#large {
width: 150px;
height: 150px;
}
#spacer {
width: 50px;
height: 50px;
background: lightgreen;
}
</style>
<div id="log"></div>
<div id="small" class="contained"></div>
<div id="spacer">
<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("small");
container.id = "large";
container.displayLock.acquire({ timeout: Infinity }).then(
() => { finishTest("PASS"); },
(e) => { finishTest("FAIL " + e.message); });
}
window.onload = runTest;
</script>