skips-root-focusgroup.html (1559B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTML Test: focusgroup - Focus moves to previous item, skipping over a subtree that is a root focusgroup (unrelated to the one we're in).</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 <div> 16 <div focusgroup="toolbar"> 17 <span id=item2 tabindex=0>item2</span> 18 <span id=item3 tabindex=0>item3</span> 19 </div> 20 </div> 21 <span id=item4 tabindex=0>item4</span> 22 </div> 23 24 <script> 25 26 promise_test(async t => { 27 var item1 = document.getElementById("item1"); 28 var item4 = document.getElementById("item4"); 29 30 await focusAndKeyPress(item4, kArrowUp); 31 assert_equals(document.activeElement, item1); 32 33 await focusAndKeyPress(item4, kArrowLeft); 34 assert_equals(document.activeElement, item1); 35 }, "When the focus is set on the last item of a focusgroup and the previous item is located past an other focusgroup subtree, a backward arrow key press should move the focus to that previous item without getting stuck in the other focusgroup."); 36 37 </script>