tor-browser

The Tor Browser
git clone https://git.dasho.dev/tor-browser.git
Log | Files | Refs | README | LICENSE

dialog-light-dismiss-touch.html (1320B)


      1 <!DOCTYPE html>
      2 <link rel=author href="mailto:jarhar@chromium.org">
      3 <link rel=help href="https://issues.chromium.org/issues/425579196">
      4 <link rel=help href="https://github.com/w3c/pointerevents/issues/542">
      5 <script src="/resources/testharness.js"></script>
      6 <script src="/resources/testharnessreport.js"></script>
      7 <script src="/resources/testdriver.js"></script>
      8 <script src="/resources/testdriver-actions.js"></script>
      9 <script src="/resources/testdriver-vendor.js"></script>
     10 
     11 <div id=fullscreen></div>
     12 <dialog closedby=any>
     13  dialog
     14 </dialog>
     15 
     16 <style>
     17 #fullscreen {
     18  position: absolute;
     19  inset: 0;
     20  z-index: 1;
     21 }
     22 </style>
     23 
     24 <script>
     25 promise_test(async () => {
     26  const fullscreen = document.getElementById('fullscreen');
     27  const dialog = document.querySelector('dialog');
     28 
     29  let fullscreenClicked = false;
     30  fullscreen.addEventListener('click', () => {
     31    fullscreenClicked = true;
     32  });
     33  dialog.showModal();
     34 
     35  await (new test_driver.Actions()
     36    .addPointer('finger', 'touch')
     37    .pointerMove(1, 1)
     38    .pointerDown()
     39    .pointerUp())
     40    .send();
     41 
     42  assert_false(dialog.open, 'Dialog should be closed by light dismiss.');
     43  assert_false(fullscreenClicked, 'Elements outside of the dialog should not receive a click.');
     44 }, 'Dialog light dismiss should work with touch and not trigger a click event.');
     45 </script>