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