tor-browser

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

moves-to-previous-item-and-skips-focusable-item.html (1302B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: focusgroup - Focus moves to previous item and skips non-focusable elements.</title>
      4 <link rel="author" title="Microsoft" href="http://www.microsoft.com/">
      5 <link rel="help" href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Focusgroup/explainer.md">
      6 <script src="/resources/testharness.js"></script>
      7 <script src="/resources/testharnessreport.js"></script>
      8 <script src="/resources/testdriver.js"></script>
      9 <script src="/resources/testdriver-vendor.js"></script>
     10 <script src="/resources/testdriver-actions.js"></script>
     11 <script src="../resources/focusgroup-utils.js"></script>
     12 
     13 <div focusgroup="toolbar">
     14  <span id=item1 tabindex=0>item1</span>
     15  <span id=item2>item2</span> <!--NOT FOCUSABLE-->
     16  <span id=item3 tabindex=0>item3</span>
     17 </div>
     18 
     19 <script>
     20 
     21  promise_test(async t => {
     22    var item1 = document.getElementById("item1");
     23    var item3 = document.getElementById("item3");
     24 
     25    await focusAndKeyPress(item3, kArrowUp);
     26    assert_equals(document.activeElement, item1);
     27 
     28    await focusAndKeyPress(item3, kArrowLeft);
     29    assert_equals(document.activeElement, item1);
     30  }, "When the focus is set on a focusgroup item, an arrow key press should move the focus to the previous item and skip non-focusable items.");
     31 
     32 </script>