diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-06-12 05:35:29 +0000 |
commit | 59203c63bb777a3bacec32fb8830fba33540e809 (patch) | |
tree | 58298e711c0ff0575818c30485b44a2f21bf28a0 /dom/base/test/test_focus_radio.html | |
parent | Adding upstream version 126.0.1. (diff) | |
download | firefox-59203c63bb777a3bacec32fb8830fba33540e809.tar.xz firefox-59203c63bb777a3bacec32fb8830fba33540e809.zip |
Adding upstream version 127.0.upstream/127.0
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'dom/base/test/test_focus_radio.html')
-rw-r--r-- | dom/base/test/test_focus_radio.html | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/dom/base/test/test_focus_radio.html b/dom/base/test/test_focus_radio.html index 8e97012745..9e14143143 100644 --- a/dom/base/test/test_focus_radio.html +++ b/dom/base/test/test_focus_radio.html @@ -2,7 +2,14 @@ <title>Test for input radio focus</title> <script src="/tests/SimpleTest/SimpleTest.js"></script> <script src="/tests/SimpleTest/EventUtils.js"></script> - +<style> +.visHidden { + visibility: hidden; +} +.dispNone { + display: none; +} +</style> <button id="before">before</button> <fieldset> <legend>a</legend> @@ -26,6 +33,27 @@ <label><input id="d3" type="radio" name="d" disabled>d3</label> <label><input id="d4" type="radio" name="d">d4</label> </fieldset> +<fieldset> + <legend>e</legend> + <label><input id="e1" type="radio" name="e" hidden>e1</label> + <label><input id="e2" type="radio" name="e">e2</label> + <label><input id="e3" type="radio" name="e" hidden>e3</label> + <label><input id="e4" type="radio" name="e">e4</label> +</fieldset> +<fieldset> + <legend>f</legend> + <label><input id="f1" type="radio" name="f" class="visHidden">f1</label> + <label><input id="f2" type="radio" name="f">f2</label> + <label><input id="f3" type="radio" name="f" class="visHidden">f3</label> + <label><input id="f4" type="radio" name="f">f4</label> +</fieldset> +<fieldset> + <legend>g</legend> + <label><input id="g1" type="radio" name="g" class="dispNone">g1</label> + <label><input id="g2" type="radio" name="g">g2</label> + <label><input id="g3" type="radio" name="g" class="dispNone">g3</label> + <label><input id="g4" type="radio" name="g">g4</label> +</fieldset> <button id="after">after</button> <script> @@ -51,8 +79,17 @@ expectFocusAfterKey("Tab", "c1"); // d1 is disabled, so d2 should get focus. expectFocusAfterKey("Tab", "d2"); + // e1 is hidden, so e2 should get focus. + expectFocusAfterKey("Tab", "e2"); + // f1 is hidden, so f2 should get focus. + expectFocusAfterKey("Tab", "f2"); + // g1 is hidden, so g2 should get focus. + expectFocusAfterKey("Tab", "g2"); expectFocusAfterKey("Tab", "after"); + expectFocusAfterKey("Shift+Tab", "g2"); + expectFocusAfterKey("Shift+Tab", "f2"); + expectFocusAfterKey("Shift+Tab", "e2"); expectFocusAfterKey("Shift+Tab", "d2"); expectFocusAfterKey("Shift+Tab", "c1"); expectFocusAfterKey("Shift+Tab", "b2"); @@ -85,6 +122,36 @@ // Up arrow should wrap at the top. expectFocusAfterKey("ArrowUp", "d4"); + expectFocusAfterKey("Tab", "e2"); + // e3 is hidden, so down arrow should focus e4. + expectFocusAfterKey("ArrowDown", "e4"); + expectFocusAfterKey("ArrowUp", "e2"); + expectFocusAfterKey("ArrowDown", "e4"); + // Down arrow should wrap at the bottom, skipping hidden. + expectFocusAfterKey("ArrowDown", "e2"); + // Up arrow should wrap at the top. + expectFocusAfterKey("ArrowUp", "e4"); + + expectFocusAfterKey("Tab", "f2"); + // f3 is hidden, so down arrow should focus f4. + expectFocusAfterKey("ArrowDown", "f4"); + expectFocusAfterKey("ArrowUp", "f2"); + expectFocusAfterKey("ArrowDown", "f4"); + // Down arrow should wrap at the bottom, skipping hidden. + expectFocusAfterKey("ArrowDown", "f2"); + // Up arrow should wrap at the top. + expectFocusAfterKey("ArrowUp", "f4"); + + expectFocusAfterKey("Tab", "g2"); + // g3 is hidden, so down arrow should focus g4. + expectFocusAfterKey("ArrowDown", "g4"); + expectFocusAfterKey("ArrowUp", "g2"); + expectFocusAfterKey("ArrowDown", "g4"); + // Down arrow should wrap at the bottom, skipping hidden. + expectFocusAfterKey("ArrowDown", "g2"); + // Up arrow should wrap at the top. + expectFocusAfterKey("ArrowUp", "g4"); + SimpleTest.finish(); }); </script> |