| <!doctype HTML> |
| <html class="reftest-wait"> |
| <meta charset="utf8"> |
| <title>Display Locking: acquire, commit</title> |
| <link rel="author" title="Vladimir Levin" href="mailto:vmpstr@chromium.org"> |
| <link rel="help" href="https://github.com/WICG/display-locking"> |
| <link rel="match" href="pass-container-with-child-ref.html"> |
| <script src="/common/reftest-wait.js"></script> |
| <script src="resources/utils.js"></script> |
| |
| <style> |
| #container { |
| contain: style layout; |
| width: 150px; |
| height: 150px; |
| background: lightblue; |
| } |
| #child { |
| width: 50px; |
| height: 50px; |
| background: lightgreen; |
| } |
| </style> |
| |
| <div id="log"></div> |
| <div id="container"></div> |
| |
| <script> |
| function finishTest(status_string) { |
| if (document.getElementById("log").innerHTML === "") |
| document.getElementById("log").innerHTML = status_string; |
| takeScreenshot(); |
| } |
| |
| function runTest() { |
| const container = document.getElementById("container"); |
| setInvisible(container).then(() => { |
| const child = document.createElement("div"); |
| child.id = "child"; |
| container.appendChild(child); |
| |
| setVisible(container).then( |
| () => { finishTest("PASS"); }, |
| (e) => { finishTest("FAIL " + e.message); }); |
| }); |
| } |
| |
| window.onload = runTest; |
| </script> |
| </html> |