blob: d1eec045de765dca979e3a707ba2ae94d0abd4d9 [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire on a container with no containment, then adds
containment and commits.
-->
<style>
.contained {
contain: style layout;
width: 100px;
height: 100px;
background: lightblue;
}
</style>
<div id="log"></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();
}
async function runTest() {
let container = document.createElement("div");
await container.displayLock.acquire({ timeout: Infinity });
container.classList = "contained";
document.body.appendChild(container);
container.displayLock.commit().then(
() => { finishTest("PASS"); },
(e) => { finishTest("FAIL " + e.message); });
}
window.onload = runTest;
</script>