blob: 34ca9d4e61a5d6c4bf65c30d6627148a18c78d2e [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquireDisplayLock, which appends a child.
-->
<style>
#parent {
contain: paint;
width: 150px;
height: 150px;
background: lightblue;
}
#child {
width: 50px;
height: 50px;
background: lightgreen;
}
</style>
<div id="log"></div>
<div id="parent"></div>
<script>
if (window.testRunner)
window.testRunner.waitUntilDone();
function modifyDom(context) {
let child = document.createElement("div");
child.id = "child";
document.getElementById("parent").appendChild(child);
}
function finishTest(status_string) {
document.getElementById("log").innerHTML = status_string;
if (window.testRunner)
window.testRunner.notifyDone();
}
function acquire() {
document.getElementById("parent").acquireDisplayLock(modifyDom).then(
() => { finishTest("PASS"); },
() => { finishTest("FAIL"); });
}
window.onload = acquire;
</script>