summaryrefslogtreecommitdiffstats
path: root/testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slots-in-slot.html
diff options
context:
space:
mode:
authorDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
committerDaniel Baumann <daniel.baumann@progress-linux.org>2024-04-19 00:47:55 +0000
commit26a029d407be480d791972afb5975cf62c9360a6 (patch)
treef435a8308119effd964b339f76abb83a57c29483 /testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slots-in-slot.html
parentInitial commit. (diff)
downloadfirefox-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-slots-in-slot.html')
-rw-r--r--testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slots-in-slot.html69
1 files changed, 69 insertions, 0 deletions
diff --git a/testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slots-in-slot.html b/testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slots-in-slot.html
new file mode 100644
index 0000000000..39b0806603
--- /dev/null
+++ b/testing/web-platform/tests/shadow-dom/focus-navigation/focus-navigation-slots-in-slot.html
@@ -0,0 +1,69 @@
+<!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>
+<p>Tests for moving focus by pressing tab key across nodes in slot scope.<br>
+
+<div id="b1" tabindex="0">outside</div>
+<div id='host'>
+ <template data-mode='open'>
+ <slot></slot>
+ </template>
+ <slot>
+ <div id="1A" tabindex="0">single nested slot</div>
+ <div id="1B" tabindex="0">single nested slot</div>
+ </slot>
+ <slot>
+ <div id="1C" tabindex="0">single nested slot</div>
+ </slot>
+ <slot>
+ <slot>
+ <div id="2A" tabindex="0">double nested slot</div>
+ <div id="2B" tabindex="0">double nested slot</div>
+ </slot>
+ </slot>
+ <slot>
+ <div id="3A" tabindex="0">single nested slot</div>
+ <slot>
+ <div id="3B" tabindex="0">double nested slot</div>
+ <slot>
+ <div id="3C" tabindex="0">Triple nested slot</div>
+ <div id="3D" tabindex="0">Triple nested slot</div>
+ </slot>
+ <div id="3E" tabindex="0">double nested slot</div>
+ </slot>
+ <div id="3F" tabindex="0">single nested slot</div>
+ </slot>
+</div>
+<div id="b2" tabindex="0">outside</div>
+
+<script>
+'use strict';
+
+promise_test(async () => {
+ convertTemplatesToShadowRootsWithin(host);
+
+ let elements = [
+ 'b1',
+ '1A',
+ '1B',
+ '1C',
+ '2A',
+ '2B',
+ '3A',
+ '3B',
+ '3C',
+ '3D',
+ '3E',
+ '3F',
+ 'b2',
+ ];
+
+ await assert_focus_navigation_bidirectional(elements);
+}, 'Focus should cover assigned nodes of slot, especially for nested slots in slot scope.');
+
+</script>