tor-browser

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

wraps-successfully-complex-case.html (1660B)


      1 <!DOCTYPE html>
      2 <meta charset="utf-8">
      3 <title>HTML Test: focusgroup - Focus wraps from first to last focusgroup item, even though there are non items in the way.</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 wrap">
     14  <div>
     15    <span id=nonitem1>nonitem1</span>
     16    <span id=nonitem2>nonitem2</span>
     17  </div>
     18  <span id=item1 tabindex=0>item1</span>
     19  <span id=item2 tabindex=0>item2</span>
     20  <span id=item3 tabindex=0>item3</span>
     21  <div>
     22    <span id=nonitem3>nonitem3</span>
     23    <span id=nonitem4>nonitem4</span>
     24  </div>
     25 </div>
     26 
     27 <script>
     28 
     29  promise_test(async t => {
     30    var item1 = document.getElementById("item1");
     31    var item3 = document.getElementById("item3");
     32 
     33    await focusAndKeyPress(item1, kArrowUp);
     34    assert_equals(document.activeElement, item3);
     35 
     36    await focusAndKeyPress(item1, kArrowUp);
     37    assert_equals(document.activeElement, item3);
     38  }, "When the focus is set on the first item of an extending focusgroup while there are other non-item elements before, we should still be able to wrap to the last item. Also, if the last item has other non-item elements after itself, skipping these non-item elements shouldn't be an issue.");
     39 
     40 </script>