simple-case-with-non-focusable-cell-in-the-center.html (2363B)
1 <!DOCTYPE html> 2 <meta charset="utf-8"> 3 <title>HTML Test: focusgroup - Simple case with grid focusgroup, but with the cell R2C2 not focusable.</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 <table focusgroup=grid> 14 <tr> 15 <td id=r1c1 tabindex=0>r1c1</td> 16 <td id=r1c2 tabindex=0>r1c2</td> 17 <td id=r1c3 tabindex=0>r1c3</td> 18 </tr> 19 <tr> 20 <td id=r2c1 tabindex=0>r2c1</td> 21 <td id=r2c2>r2c2</td> 22 <td id=r2c3 tabindex=0>r2c3</td> 23 </tr> 24 <tr> 25 <td id=r3c1 tabindex=0>r3c1</td> 26 <td id=r3c2 tabindex=0>r3c2</td> 27 <td id=r3c3 tabindex=0>r3c3</td> 28 </tr> 29 </table> 30 31 <script> 32 33 promise_test(async t => { 34 var r2c1 = document.getElementById("r2c1"); 35 var r2c3 = document.getElementById("r2c3"); 36 37 await focusAndKeyPress(r2c1, kArrowRight); 38 assert_equals(document.activeElement, r2c3); 39 }, "A right arrow press should move the focus to the next column, skipping the non-focusable cell."); 40 41 promise_test(async t => { 42 var r1c2 = document.getElementById("r1c2"); 43 var r3c2 = document.getElementById("r3c2"); 44 45 await focusAndKeyPress(r1c2, kArrowDown); 46 assert_equals(document.activeElement, r3c2); 47 }, "A down arrow press should move the focus to the next row, skipping the non-focusable cell."); 48 49 promise_test(async t => { 50 var r2c1 = document.getElementById("r2c1"); 51 var r2c3 = document.getElementById("r2c3"); 52 53 await focusAndKeyPress(r2c3, kArrowLeft); 54 assert_equals(document.activeElement, r2c1); 55 }, "A left arrow press should move to the previous column, skipping the non-focusable cell."); 56 57 promise_test(async t => { 58 var r1c2 = document.getElementById("r1c2"); 59 var r3c2 = document.getElementById("r3c2"); 60 61 await focusAndKeyPress(r3c2, kArrowUp); 62 assert_equals(document.activeElement, r1c2); 63 }, "An up arrow press should move the focus to the previous row, skipping the non-focusable cell."); 64 65 </script>