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/shadow-dom/focus-navigation/focus-navigation-slot-with-tabindex.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/shadow-dom/focus-navigation/focus-navigation-slot-with-tabindex.html')
-rw-r--r-- | testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slot-with-tabindex.html | 63 |
1 files changed, 63 insertions, 0 deletions
diff --git a/testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slot-with-tabindex.html b/testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slot-with-tabindex.html new file mode 100644 index 0000000000..d43085e984 --- /dev/null +++ b/testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slot-with-tabindex.html @@ -0,0 +1,63 @@ +<!DOCTYPE html> +<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/shadow-dom.js"></script> +<script src="resources/focus-utils.js"></script> +<div id='log'></div> +<p> + document tree: [i0 -> [x-foo]]<br> + x-foo's shadow tree: [j1 -> [s1] -> [s2] -> j2 ->[x-bar]]<br> + x-bar's shadow tree: [[s3] -> k1]<br> + slot #s1: [i1 -> i2]<br> + slot #s2: [i3]<br> + slot #s3: [l1 -> l2]<br><br> + <b>v1 ideal nav forward: [i0 -> j1 -> i1 -> i2 -> i3 -> j2 -> x-bar -> l1 -> l2 -> k1]</b><br> +</p> + +<input id='i0' tabindex=0 value='i0'> +<div id='x-foo'> + <input id='i2' slot='s1' tabindex=2 value='i2'> + <input id='i1' slot='s1' tabindex=1 value='i1'> + <input id='i3' slot='s2' tabindex=3 value='i3'> + <template data-mode='open'> + <div id='x-bar' tabindex=5> + <input id='l2' slot='s3' tabindex=2 value='l2'> + <input id='l1' slot='s3' tabindex=1 value='l1'> + <template data-mode='open'> + <slot id='s3' name='s3' tabindex=1></slot> + <input id='k1' tabindex=2 value='k1'> + </template> + </div> + <input id='j1' tabindex=1 value='j1'> + <slot id='s2' name='s2' tabindex=3></slot> + <slot id='s1' name='s1' tabindex=2></slot> + <input id='j2' tabindex=4 value='j2'> + </template> +</div> + +<script> +'use strict'; + +promise_test(async () => { + let xfoo = document.getElementById('x-foo'); + convertTemplatesToShadowRootsWithin(xfoo); + + let elements = [ + 'i0', + 'x-foo/j1', + 'i1', + 'i2', + 'i3', + 'x-foo/j2', + 'x-foo/x-bar', + 'x-foo/l1', + 'x-foo/l2', + 'x-foo/x-bar/k1', + ]; + + await assert_focus_navigation_bidirectional(elements); +}, 'Slots tabindex should be considred in focus navigation.'); +</script> |