blob: c5888637c690da169003c9b1613bc9cbcee90c91 [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire on a container with no containment, then adds
containment and commits.
-->
<style>
.contained {
contain: content;
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.getDisplayLock().acquire();
container.classList = "contained";
document.body.appendChild(container);
container.getDisplayLock().commit().then(
() => { finishTest("PASS"); },
() => { finishTest("FAIL"); });
}
window.onload = runTest;
</script>