diff options
Diffstat (limited to 'testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/does-not-wrap-or-flow.html')
-rw-r--r-- | testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/does-not-wrap-or-flow.html | 56 |
1 files changed, 56 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/does-not-wrap-or-flow.html b/testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/does-not-wrap-or-flow.html new file mode 100644 index 0000000000..050dec3622 --- /dev/null +++ b/testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/does-not-wrap-or-flow.html @@ -0,0 +1,56 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: focusgroup - Simple case that validated we don't wrap or flow when these values aren't provided.</title> +<link rel="author" title="Microsoft" href="http://www.microsoft.com/"> +<link rel="help" href="https://github.com/MicrosoftEdge/MSEdgeExplainers/blob/main/Focusgroup/explainer.md"> +<script src="/resources/testharness.js"></script> +<script src="/resources/testharnessreport.js"></script> +<script src="/resources/testdriver.js"></script> +<script src="/resources/testdriver-vendor.js"></script> +<script src="/resources/testdriver-actions.js"></script> +<script src="../resources/focusgroup-utils.js"></script> + +<table focusgroup=grid> + <tr> + <td id=r1c1 tabindex=0>r1c1</td> + <td id=r1c2 tabindex=-1>r1c2</td> + <td id=r1c3 tabindex=-1>r1c3</td> + </tr> + <tr> + <td id=r2c1 tabindex=-1>r2c1</td> + <td id=r2c2 tabindex=-1>r2c2</td> + <td id=r2c3 tabindex=-1>r2c3</td> + </tr> +</table> + +<script> + + promise_test(async t => { + var r1c3 = document.getElementById("r1c3"); + + await focusAndKeyPress(r1c3, kArrowRight); + assert_equals(document.activeElement, r1c3); + }, "A right arrow press should not move the focus when it is at the last column and the focusgroup doesn't wrap or flow."); + + promise_test(async t => { + var r2c1 = document.getElementById("r2c1"); + + await focusAndKeyPress(r2c1, kArrowDown); + assert_equals(document.activeElement, r2c1); + }, "A down arrow press should not move the focus when it is at the last row and the focusgroup doesn't wrap or flow."); + + promise_test(async t => { + var r1c1 = document.getElementById("r1c1"); + + await focusAndKeyPress(r1c1, kArrowLeft); + assert_equals(document.activeElement, r1c1); + }, "A left arrow press should not move the focus when it is at the first column and the focusgroup doesn't wrap or flow."); + + promise_test(async t => { + var r1c1 = document.getElementById("r1c1"); + + await focusAndKeyPress(r1c1, kArrowUp); + assert_equals(document.activeElement, r1c1); + }, "An up arrow press should not move the focus when it is at the first row and the focusgroup doesn't wrap or flow."); + +</script>
\ No newline at end of file |