Source code
Revision control
Copy as Markdown
Other Tools
Test Info: Warnings
- This test has a WPT meta file that expects 1 subtest issues.
- This WPT test may be referenced by the following Test IDs:
- /html/semantics/interactive-elements/the-dialog-element/dialog-light-dismiss-touch.html - WPT Dashboard Interop Dashboard
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<script src="/resources/testharness.js"></script>
<script src="/resources/testharnessreport.js"></script>
<script src="/resources/testdriver.js"></script>
<script src="/resources/testdriver-actions.js"></script>
<script src="/resources/testdriver-vendor.js"></script>
<div id=fullscreen></div>
<dialog closedby=any>
dialog
</dialog>
<style>
#fullscreen {
position: absolute;
inset: 0;
z-index: 1;
}
</style>
<script>
promise_test(async () => {
const fullscreen = document.getElementById('fullscreen');
const dialog = document.querySelector('dialog');
let fullscreenClicked = false;
fullscreen.addEventListener('click', () => {
fullscreenClicked = true;
});
dialog.showModal();
await (new test_driver.Actions()
.addPointer('finger', 'touch')
.pointerMove(1, 1)
.pointerDown()
.pointerUp())
.send();
assert_false(dialog.open, 'Dialog should be closed by light dismiss.');
assert_false(fullscreenClicked, 'Elements outside of the dialog should not receive a click.');
}, 'Dialog light dismiss should work with touch and not trigger a click event.');
</script>