wraps-successfully.html (1320B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTML Test: focusgroup - Focus wraps from first to last element when 'wrap' is specified.</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 <span id=item1 tabindex=0>item1</span> 15 <span id=item2 tabindex=0>item2</span> 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(item1, kArrowUp); 26 assert_equals(document.activeElement, item3); 27 28 await focusAndKeyPress(item1, kArrowLeft); 29 assert_equals(document.activeElement, item3); 30 }, "When the focus is set on the first item of a focusgroup that wraps, a backward arrow key press should move the focus to the last item within the focusgroup."); 31 32 </script>