does-not-move-when-only-one-item.html (1134B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTML Test: focusgroup - Focus does not move when there is only one 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 </div> 16 17 <script> 18 19 promise_test(async t => { 20 var item1 = document.getElementById("item1"); 21 22 await focusAndKeyPress(item1, kArrowUp); 23 assert_equals(document.activeElement, item1); 24 25 await focusAndKeyPress(item1, kArrowLeft); 26 assert_equals(document.activeElement, item1); 27 }, "When the focus is set on the only focusgroup item, the focus shouldn't move and we shouldn't get stuck in an infinite loop."); 28 29 </script>