diff options
author | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
---|---|---|
committer | Daniel Baumann <daniel.baumann@progress-linux.org> | 2024-04-19 01:47:29 +0000 |
commit | 0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d (patch) | |
tree | a31f07c9bcca9d56ce61e9a1ffd30ef350d513aa /testing/web-platform/tests/css/css-toggle/toggle-trigger-focus.tentative.html | |
parent | Initial commit. (diff) | |
download | firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.tar.xz firefox-esr-0ebf5bdf043a27fd3dfb7f92e0cb63d88954c44d.zip |
Adding upstream version 115.8.0esr.upstream/115.8.0esr
Signed-off-by: Daniel Baumann <daniel.baumann@progress-linux.org>
Diffstat (limited to 'testing/web-platform/tests/css/css-toggle/toggle-trigger-focus.tentative.html')
-rw-r--r-- | testing/web-platform/tests/css/css-toggle/toggle-trigger-focus.tentative.html | 54 |
1 files changed, 54 insertions, 0 deletions
diff --git a/testing/web-platform/tests/css/css-toggle/toggle-trigger-focus.tentative.html b/testing/web-platform/tests/css/css-toggle/toggle-trigger-focus.tentative.html new file mode 100644 index 0000000000..bc93ba3631 --- /dev/null +++ b/testing/web-platform/tests/css/css-toggle/toggle-trigger-focus.tentative.html @@ -0,0 +1,54 @@ +<!DOCTYPE HTML> +<meta charset="UTF-8"> +<title>CSS Toggles: focusability of elements with toggle-trigger</title> +<link rel="author" title="L. David Baron" href="https://dbaron.org/"> +<link rel="author" title="Google" href="http://www.google.com/"> +<link rel="help" href="https://tabatkins.github.io/css-toggle/#toggle-trigger-property"> +<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="support/toggle-helpers.js"></script> + +<div id="test"></div> + +<script> + +// From shadow-dom/focus/resources/shadow-utils.js +function navigateFocusForward() { + // TAB = '\ue004' + return test_driver.send_keys(document.body, "\ue004"); +} + +let container = document.getElementById("test"); + +promise_test(async test => { + container.innerHTML = ` + <input id="input" type="text"> + <div id="e1" style="toggle-root: tab"></div> + <div id="e2" style="toggle-trigger: tab"></div> + <div id="e3" style="toggle-trigger: tab"></div> + <div id="e4" style="toggle-trigger: nonexistent"></div> + `; + + let input = document.getElementById("input"); + let e1 = document.getElementById("e1"); + let e2 = document.getElementById("e2"); + let e3 = document.getElementById("e3"); + let e4 = document.getElementById("e4"); + + await wait_for_toggle_creation(e1); + input.focus(); + assert_equals(document.activeElement, input); + + await navigateFocusForward(); + assert_equals(document.activeElement, e2); + + await navigateFocusForward(); + assert_equals(document.activeElement, e3); + + await navigateFocusForward(); + assert_equals(document.activeElement, e4); +}, "elements with toggle-trigger are tabbable"); + +</script> |