tor-browser

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

details-mutate.html (1329B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>Test selecting anonymous summary element inside details</title>
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <script src="/resources/testdriver.js"></script>
      7 <script src="/resources/testdriver-actions.js"></script>
      8 <script src="/resources/testdriver-vendor.js"></script>
      9 <link rel="stylesheet" href="/fonts/ahem.css">
     10 <style>
     11  details {
     12    font: 16px/1 Ahem;
     13  }
     14 </style>
     15 <details id="d"></details>
     16 <script>
     17  const selection = getSelection();
     18  d.addEventListener("DOMSubtreeModified", ev => {
     19    window.find("cthulu", true, false);
     20    selection.extend(document.body, document.body.childNodes.length);
     21  });
     22 
     23  window.onload = () => {
     24    promise_test(async () => {
     25      // This enables `.extend()`
     26      selection.collapse(document.body);
     27      // Clicking implicitly selects an anonymous summary element inside <details>
     28      await new test_driver.Actions()
     29        .pointerMove(0, 0, { origin: d })
     30        .pointerDown()
     31        .pointerUp()
     32        .send();
     33      // FIXME: Convert this to a crash test. Currently test_driver actions
     34      // do not work within crash tests.
     35      assert_true(true, "No crash");
     36    }, "Manipulating selection after clicking <details> shouldn't cause a crash");
     37  };
     38 </script>