tor-browser

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

interactivity-inert-focus.html (915B)


      1 <!DOCTYPE html>
      2 <title>CSS Basic User Interface Test: interactivity:inert blocks focus()</title>
      3 <link rel="help" href="https://drafts.csswg.org/css-ui-4/#inertness">
      4 <script src="/resources/testharness.js"></script>
      5 <script src="/resources/testharnessreport.js"></script>
      6 <style>
      7  #inert { interactivity: inert; }
      8  #non-inert { interactivity: auto; }
      9 </style>
     10 <input id="inp_outer">
     11 <div id="inert">
     12  <input id="inp_inert">
     13  <div id="non-inert">
     14    <input id="inp_non_inert">
     15  </div>
     16 </div>
     17 <script>
     18  test(() => {
     19    inp_outer.focus();
     20    assert_equals(document.activeElement, inp_outer);
     21  }, "Focus outer input");
     22 
     23  test(() => {
     24    inp_inert.focus();
     25    assert_equals(document.activeElement, inp_outer);
     26  }, "Try focus inert input");
     27 
     28  test(() => {
     29    inp_non_inert.focus();
     30    assert_equals(document.activeElement, inp_non_inert);
     31  }, "Focus non-inert input inside inert ancestry");
     32 
     33 </script>