blob: 2ff1ffd434dcc41d4ca131da60e326273ba8a7bd [file] [log] [blame]
<!doctype HTML>
<!--
Runs an acquire, appends a child, and calls updateAndCommit.
-->
<style>
#container {
contain: style layout;
width: 150px;
height: 150px;
background: lightblue;
}
#child {
width: 50px;
height: 50px;
background: lightgreen;
}
</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();
}
function runTest() {
let container = document.createElement("div");
container.displayLock.acquire({ timeout: Infinity }).then(() => {
let child = document.createElement("div");
child.id = "child";
container.appendChild(child);
container.id = "container";
document.body.appendChild(container);
container.displayLock.updateAndCommit().then(
() => { finishTest("PASS"); },
() => { finishTest("FAIL"); });
});
}
window.onload = runTest;
</script>