diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 00:47:55 +0000 |
commit | 26a029d407be480d791972afb5975cf62c9360a6 (patch) | |
tree | f435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/col-wrap-only.html | |
parent | Initial commit. (diff) | |
download | firefox-26a029d407be480d791972afb5975cf62c9360a6.tar.xz firefox-26a029d407be480d791972afb5975cf62c9360a6.zip |
Adding upstream version 124.0.1.upstream/124.0.1
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/col-wrap-only.html')
-rw-r--r-- | testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/col-wrap-only.html | 58 |
1 files changed, 58 insertions, 0 deletions
diff --git a/testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/col-wrap-only.html b/testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/col-wrap-only.html new file mode 100644 index 0000000000..ff19b8778e --- /dev/null +++ b/testing/web-platform/tests/html/interaction/focus/focusgroup/tentative/grid-navigation/col-wrap-only.html @@ -0,0 +1,58 @@ +<!DOCTYPE html> +<meta charset="utf-8"> +<title>HTML Test: focusgroup - Validate that col-wrap allows only vertical wrapping.</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 col-wrap"> + <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 wrap the focus to the first column when only vertical wrap is supported by the focusgroup."); + + promise_test(async t => { + var r1c1 = document.getElementById("r1c1"); + var r2c1 = document.getElementById("r2c1"); + + await focusAndKeyPress(r2c1, kArrowDown); + assert_equals(document.activeElement, r1c1); + }, "When on the last row, a down arrow press should move the focus to first row if the focusgroup wraps vertically."); + + promise_test(async t => { + var r1c1 = document.getElementById("r1c1"); + + await focusAndKeyPress(r1c1, kArrowLeft); + assert_equals(document.activeElement, r1c1); + }, "A left arrow press should not wrap the focus to the last column when only vertical wrap is supported by the focusgroup."); + + promise_test(async t => { + var r1c1 = document.getElementById("r1c1"); + var r2c1 = document.getElementById("r2c1"); + + await focusAndKeyPress(r1c1, kArrowUp); + assert_equals(document.activeElement, r2c1); + }, "When on the first row, an up arrow press should move the focus to last row if the focusgroup wraps vertically."); + +</script>
\ No newline at end of file |