blob: cc777c5c7a97f3be37d0b8a3a97940badfe276e6 [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire on an inline with containment, commit fails
since the containment isn't actually applied.
-->
<style>
#container {
contain: content;
}
</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 acquire() {
let container = document.createElement("span");
container.id = "container";
await container.getDisplayLock().acquire();
document.body.appendChild(container);
container.getDisplayLock().commit().then(
() => { finishTest("FAIL"); },
() => { finishTest("PASS"); });
}
window.onload = acquire;
</script>