| <!doctype HTML> |
| |
| <!-- |
| Runs an acquire on an inline with containment, commit fails |
| since the containment isn't actually applied. |
| --> |
| |
| <style> |
| #container { |
| contain: style layout; |
| } |
| </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.displayLock.acquire({ timeout: Infinity }); |
| document.body.appendChild(container); |
| container.displayLock.commit().then( |
| () => { finishTest("FAIL"); }, |
| (e) => { finishTest("PASS " + e.message); }); |
| } |
| |
| window.onload = acquire; |
| </script> |
| |