blob: 10e70a9c38a95982d730e08f7f075e5d1d87178b [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquireDisplayLock on an element that doesn't have containment.
The callback adds containment.
-->
<style>
.contained {
contain: content;
width: 100px;
height: 100px;
background: lightblue;
}
</style>
<div id="log"></div>
<script>
if (window.testRunner)
window.testRunner.waitUntilDone();
function addContainment(context) {
context.lockedElement.classList = "contained";
}
function finishTest(status_string) {
if (document.getElementById("log").innerHTML === "")
document.getElementById("log").innerHTML = status_string;
if (window.testRunner)
window.testRunner.notifyDone();
}
function acquire() {
let container = document.createElement("div");
container.acquireDisplayLock(addContainment).then(
() => { finishTest("PASS"); },
() => { finishTest("FAIL"); });
document.body.appendChild(container);
}
window.onload = acquire;
</script>