Source code

Revision control

Copy as Markdown

Other Tools

Test Info:

<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=author href="mailto:falken@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
Here is a text node you can't select while the dialog is open.
<dialog>I'm selectable.</dialog>
<script>
test(() => {
const dialog = document.querySelector('dialog');
dialog.showModal();
document.execCommand('SelectAll');
assert_equals(window.getSelection().toString(), "I'm selectable.");
}, 'Test that inert nodes cannot be selected. The test passes if the only text you can select is inside the dialog.');
</script>