tor-browser

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

does-not-move-when-on-non-focusgroup-item.html (1341B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: focusgroup - Focus does not move when initially set a focusable element that isn't a 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 <!-- Element outside focusgroup should not participate -->
     19 <span id=nonitem1 tabindex=0>nonitem1</span>
     20 
     21 <script>
     22 
     23  promise_test(async t => {
     24    var nonitem1 = document.getElementById("nonitem1");
     25 
     26    await focusAndKeyPress(nonitem1, kArrowUp);
     27    assert_equals(document.activeElement, nonitem1);
     28 
     29    await focusAndKeyPress(nonitem1, kArrowLeft);
     30    assert_equals(document.activeElement, nonitem1);
     31  }, "When the focus is set on a focusable element that isn't a focusgroup item, an arrow key press shouldn't move the focus at all.");
     32 
     33 </script>