summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/html/semantics/interactive-elements/the-dialog-element/simulated-click-inert.html
blob: 8ff8a7e86cb2eb90e4b3015552d30c6551242056 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
<!DOCTYPE html>
<link rel=author href="mailto:jarhar@chromium.org">
<link rel=author href="mailto:falken@chromium.org">
<link rel=help href="https://html.spec.whatwg.org/multipage/interactive-elements.html#the-dialog-element">
<link rel=help href="https://bugs.chromium.org/p/chromium/issues/detail?id=241699">
<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>

<p>Ensure that simulated click is still dispatched to an inert node.
To test manually, click the CLICK ME label and verify it does change the value of the checkbox.</p>
<div>
</div>
<input type="checkbox" id="target">
<dialog><label for="target">CLICK ME</label></dialog>

<script>
promise_test(async () => {
  async function clickOn(element) {
    const actions = new test_driver.Actions()
      .pointerMove(0, 0, {origin: element})
      .pointerDown()
      .pointerUp()
    await actions.send();
  }

  document.querySelector('dialog').showModal();
  await clickOn(document.querySelector('label'));
  assert_true(document.getElementById('target').checked);
}, 'Ensure that simulated click is still dispatched to an inert node.');
</script>