tor-browser

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

moves-to-previous-item.html (1200B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: focusgroup - Focus moves to previous focusgroup item.</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 tabindex=0>item2</span>
     16 </div>
     17 
     18 <script>
     19 
     20  promise_test(async t => {
     21    var item1 = document.getElementById("item1");
     22    var item2 = document.getElementById("item2");
     23 
     24    await focusAndKeyPress(item2, kArrowUp);
     25    assert_equals(document.activeElement, item1);
     26 
     27    await focusAndKeyPress(item2, kArrowLeft);
     28    assert_equals(document.activeElement, item1);
     29  }, "When the focus is set on a focusgroup item, an arrow key press should move the focus to the previous item.");
     30 
     31 </script>