| <!doctype HTML> |
| <html class="reftest-wait"> |
| <meta charset="utf8"> |
| <title>Display Locking: activatable allows selections</title> |
| <link rel="author" title="Rakina Zata Amni" href="mailto:rakina@chromium.org"> |
| <link rel="help" href="https://github.com/WICG/display-locking"> |
| <link rel="match" href="selection-ref.html"> |
| <script src="/common/reftest-wait.js"></script> |
| <style> |
| div { |
| contain: style layout; |
| } |
| #userSelectNone { |
| user-select: none; |
| } |
| </style> |
| <div id="neighbor"> |
| neighbor |
| </div> |
| <div id="container"> |
| <div> |
| not locked! |
| </div> |
| <div id="nonActivatable"> |
| non-activatable locked |
| </div> |
| <div id="userSelectNone"> |
| activatable but user-select is none |
| </div> |
| <div id="nested"> |
| nested activatable locked |
| </div> |
| </div> |
| <script> |
| async function runTest() { |
| // TODO(rakina): make this use rendersubtree once sizing is implemented. |
| await container.displayLock.acquire({ timeout: Infinity, activatable: true, size: [100, 100] }); |
| await nonActivatable.displayLock.acquire({ timeout: Infinity, activatable: false, size: [20, 20] }); |
| await userSelectNone.displayLock.acquire({ timeout: Infinity, activatable: true, size: [30, 30] }); |
| await nested.displayLock.acquire({ timeout: Infinity, activatable: true, size: [40, 40] }); |
| window.getSelection().removeAllRanges(); |
| const selectionRange = document.createRange(); |
| selectionRange.setStart(neighbor.firstChild, 4); |
| selectionRange.setEnd(nested.firstChild, 7); |
| window.getSelection().addRange(selectionRange); |
| requestAnimationFrame(takeScreenshot); |
| } |
| window.onload = () => { requestAnimationFrame(runTest); }; |
| </script> |