From 808281b67c5fd45f6e0cd7dd321dc9dd8cf14700 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Wed, 24 Jul 2019 22:22:18 +0900 Subject: [PATCH 1/9] HTML: Handle shadow host with delegatesFocus=true in Element.focus()/focusing steps --- .../focus/focus-method-delegatesFocus.html | 289 ++++++++++++++++++ 1 file changed, 289 insertions(+) create mode 100644 shadow-dom/focus/focus-method-delegatesFocus.html diff --git a/shadow-dom/focus/focus-method-delegatesFocus.html b/shadow-dom/focus/focus-method-delegatesFocus.html new file mode 100644 index 00000000000000..f667fd9ae7b9c9 --- /dev/null +++ b/shadow-dom/focus/focus-method-delegatesFocus.html @@ -0,0 +1,289 @@ + + +HTML Test: focus on shadow host with delegatesFocus + + + + + + +
+
slottedToSecondSlot
+
slottedToFirstSlot
+
+
outside
+ + + From 011642247b4520839ea74490caa424b86ddaf7c7 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Wed, 25 Sep 2019 17:17:24 +0900 Subject: [PATCH 2/9] Update focus() test, add sequential focus navigation tests --- .../focus/focus-method-delegatesFocus.html | 153 +++++------------- ...-order-shadow-negative-delegatesFocus.html | 34 ++++ ...x-order-shadow-varying-delegatesFocus.html | 36 +++++ ...ndex-order-shadow-zero-delegatesFocus.html | 34 ++++ 4 files changed, 142 insertions(+), 115 deletions(-) create mode 100644 shadow-dom/focus/focus-tabindex-order-shadow-negative-delegatesFocus.html create mode 100644 shadow-dom/focus/focus-tabindex-order-shadow-varying-delegatesFocus.html create mode 100644 shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html diff --git a/shadow-dom/focus/focus-method-delegatesFocus.html b/shadow-dom/focus/focus-method-delegatesFocus.html index f667fd9ae7b9c9..3c7f8afec69f6b 100644 --- a/shadow-dom/focus/focus-method-delegatesFocus.html +++ b/shadow-dom/focus/focus-method-delegatesFocus.html @@ -1,10 +1,11 @@ -HTML Test: focus on shadow host with delegatesFocus +HTML Test: focus() on shadow host with delegatesFocus +
@@ -48,32 +49,23 @@ //
//
-function setTabIndex(elements, value) { - for (const el of elements) { - el.tabIndex = value; - } -} function setAllTabIndex(value) { setTabIndex(elementsInFlatTreeOrder, value); } function removeAllTabIndex() { - for (const el of elementsInFlatTreeOrder) { - el.removeAttribute("tabindex"); - } + removeTabIndex(elementsInFlatTreeOrder); } -function resetFocus() { +function resetTabIndexAndFocus() { removeAllTabIndex(); - if (shadowRoot.activeElement) - shadowRoot.activeElement.blur(); - if (document.activeElement) - document.activeElement.blur(); + resetFocus(document); + resetFocus(shadowRoot); } test(() => { - resetFocus(); + resetTabIndexAndFocus(); setAllTabIndex(0); // Structure: //
(delegatesFocus=true) tabindex=0 @@ -85,65 +77,62 @@ // (slotted)
tabindex=0 //
tabindex=0 //
tabindex=0 - // flattened tabindex-ordered focus navigation scope of #host: - // [aboveSlots, slottedToFirstSlot, slottedToSecondSlot, belowSlots] + // First focusable = #aboveSlots host.focus(); assert_equals(shadowRoot.activeElement, aboveSlots); assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus, all tabindex=0"); test(() => { - resetFocus(); + resetTabIndexAndFocus(); setAllTabIndex(0); setTabIndex([host], -1); - // flattened tabindex-ordered focus navigation scope of #host: - // [aboveSlots, slottedToFirstSlot, slottedToSecondSlot, belowSlots] + // First focusable = #aboveSlots host.focus(); assert_equals(shadowRoot.activeElement, aboveSlots); assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus & tabindex =-1, all other tabindex=0"); test(() => { - resetFocus(); + resetTabIndexAndFocus(); setTabIndex([aboveSlots, slottedToFirstSlot, slottedToSecondSlot, belowSlots], 0); - // flattened tabindex-ordered focus navigation scope of #host: - // [aboveSlots, slottedToFirstSlot, slottedToSecondSlot, belowSlots] + // First focusable = #aboveSlots host.focus(); assert_equals(shadowRoot.activeElement, aboveSlots); assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus & no tabindex, all other tabindex=0"); test(() => { - resetFocus(); + resetTabIndexAndFocus(); setAllTabIndex(-1); setTabIndex([host], 0); - // flattened tabindex-ordered focus navigation scope of #host: [] + // First focusable = #aboveSlots host.focus(); - assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, null); + assert_equals(shadowRoot.activeElement, aboveSlots); + assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus & tabindex = 0, all other tabindex=-1"); test(() => { - resetFocus(); + resetTabIndexAndFocus(); removeAllTabIndex(); - // flattened tabindex-ordered focus navigation scope of #host: [] + // No focusable element under #host in the flat tree. host.focus(); assert_equals(shadowRoot.activeElement, null); assert_equals(document.activeElement, null); }, "focus() on host with delegatesFocus, all without tabindex"); test(() => { - resetFocus(); - // flattened tabindex-ordered focus navigation scope of #host: [] + resetTabIndexAndFocus(); + // First focusable = #aboveSlots setAllTabIndex(-1); host.focus(); - assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, null); + assert_equals(shadowRoot.activeElement, aboveSlots); + assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus, all tabindex=-1"); test(() => { - resetFocus(); - setAllTabIndex(-1); + resetTabIndexAndFocus(); + removeAllTabIndex(); setTabIndex([host, belowSlots], 0); // Structure: //
(delegatesFocus=true) tabindex=0 @@ -155,16 +144,15 @@ // (slotted)
//
tabindex=0 //
- // flattened tabindex-ordered focus navigation scope of #host: - // [belowSlots] + // First focusable = #belowSlots host.focus(); assert_equals(shadowRoot.activeElement, belowSlots); assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus & tabindex=0, #belowSlots with tabindex=0"); test(() => { - resetFocus(); - setAllTabIndex(-1); + resetTabIndexAndFocus(); + removeAllTabIndex(); setTabIndex([host, outside], 0); // Structure: //
(delegatesFocus=true) tabindex=0 @@ -176,15 +164,14 @@ // (slotted)
//
//
tabindex=0 - // flattened tabindex-ordered focus navigation scope of #host: - // [] + // No focusable element under #host in the flat tree. host.focus(); assert_equals(shadowRoot.activeElement, null); assert_equals(document.activeElement, null); }, "focus() on host with delegatesFocus & tabindex=0, #outside with tabindex=0"); test(() => { - resetFocus(); + resetTabIndexAndFocus(); setTabIndex([host, aboveSlots, belowSlots], 0); // Structure: //
(delegatesFocus=true) tabindex=0 @@ -196,94 +183,30 @@ // (slotted)
//
tabindex=0 //
- // flattened tabindex-ordered focus navigation scope of #host: - // [aboveSlots, belowSlots] + // First focusable = #aboveSlots host.focus(); assert_equals(shadowRoot.activeElement, aboveSlots); assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus & tabindex=0, #aboveSlots and #belowSlots with tabindex=0"); test(() => { - resetFocus(); - setAllTabIndex(-1); - setTabIndex([host, aboveSlots], 0); - setTabIndex([belowSlots], 1); - // Structure: - //
(delegatesFocus=true) tabindex=0 - // #shadowRoot - //
tabindex=0 - // - // (slotted)
- // - // (slotted)
- //
tabindex=1 - //
- // flattened tabindex-ordered focus navigation scope of #host: - // [belowSlots, aboveSlots] - host.focus(); - assert_equals(shadowRoot.activeElement, belowSlots); - assert_equals(document.activeElement, host); -}, "focus() on host with delegatesFocus & tabindex=0, #aboveSlots with tabindex=0, #belowSlots with tabindex=1"); - -test(() => { - resetFocus(); - setTabIndex([host, firstSlot, slottedToFirstSlot, secondSlot, slottedToSecondSlot], 0); + resetTabIndexAndFocus(); + setTabIndex([host, slottedToFirstSlot, slottedToSecondSlot, belowSlots], 0); // Structure: //
(delegatesFocus=true) tabindex=0 // #shadowRoot //
- // tabindex=0 - // (slotted)
tabindex=0 - // tabindex=0 - // (slotted)
tabindex=0 - //
- //
- // flattened tabindex-ordered focus navigation scope of #host: - // [slottedToFirstSlot, slottedToSecondSlot] - host.focus(); - assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, slottedToFirstSlot); -}, "focus() on host with delegatesFocus & tabindex=0, #firstSlot, #slottedToFirstSlot, #secondSlot, #slottedToSecondSlot with tabindex=0"); - -test(() => { - resetFocus(); - setTabIndex([firstSlot], 1); - setTabIndex([host, aboveSlots, slottedToFirstSlot], 0); - // Structure: - //
(delegatesFocus=true) tabindex=0 - // #shadowRoot - //
tabindex=0 - // tabindex=1 + // // (slotted)
tabindex=0 // - // (slotted)
- //
+ // (slotted)
tabindex=0 + //
tabindex=0 //
- // flattened tabindex-ordered focus navigation scope of #host: - // [slottedToFirstSlot, aboveSlots] + // First focusable = #slottedToFirstSlot host.focus(); assert_equals(shadowRoot.activeElement, null); assert_equals(document.activeElement, slottedToFirstSlot); -}, "focus() on host with delegatesFocus & tabindex=0, #firstSlot with tabindex=1, #slottedToFirstSlot and #aboveSlots with tabindex=0"); +}, "focus() on host with delegatesFocus & tabindex=0, #slottedToFirstSlot, #slottedToSecondSlot, #belowSlots with tabindex=0"); -test(() => { - resetFocus(); - setTabIndex([slottedToFirstSlot], 1); - setTabIndex([host, aboveSlots], 0); - // Structure: - //
(delegatesFocus=true) tabindex=0 - // #shadowRoot - //
tabindex=0 - // - // (slotted)
tabindex=1 - // - // (slotted)
- //
- //
- // flattened tabindex-ordered focus navigation scope of #host: - // [aboveSlots, slottedToFirstSlot] - host.focus(); - assert_equals(shadowRoot.activeElement, aboveSlots); - assert_equals(document.activeElement, host); -}, "focus() on host with delegatesFocus & tabindex=0, #slottedTofirstSlot with tabindex=1, #aboveSlots with tabindex=0"); + diff --git a/shadow-dom/focus/focus-tabindex-order-shadow-negative-delegatesFocus.html b/shadow-dom/focus/focus-tabindex-order-shadow-negative-delegatesFocus.html new file mode 100644 index 00000000000000..356b0bb329e27b --- /dev/null +++ b/shadow-dom/focus/focus-tabindex-order-shadow-negative-delegatesFocus.html @@ -0,0 +1,34 @@ + + +HTML Test: focus - the sequential focus navigation order with shadow dom that delegates focus and all tabindex=-1 in shadow tree + + + + + + + + + diff --git a/shadow-dom/focus/focus-tabindex-order-shadow-varying-delegatesFocus.html b/shadow-dom/focus/focus-tabindex-order-shadow-varying-delegatesFocus.html new file mode 100644 index 00000000000000..67899cff4a9d2e --- /dev/null +++ b/shadow-dom/focus/focus-tabindex-order-shadow-varying-delegatesFocus.html @@ -0,0 +1,36 @@ + + +HTML Test: focus - the sequential focus navigation order with shadow dom that delegates focus and tabindex in shadow tree varies + + + + + + + + + diff --git a/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html b/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html new file mode 100644 index 00000000000000..0025187e77cc2d --- /dev/null +++ b/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html @@ -0,0 +1,34 @@ + + +HTML Test: focus - the sequential focus navigation order with shadow dom that delegates focus and all tabindex=0 + + + + + + + + + From 8edc86f0d16a4d48b7dd8a482643cb77f7b05c0c Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Thu, 26 Sep 2019 18:24:21 +0900 Subject: [PATCH 3/9] Explicitly list order --- .../focus/focus-tabindex-order-shadow-zero-delegatesFocus.html | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html b/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html index 0025187e77cc2d..5e6ab3a90f8f12 100644 --- a/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html +++ b/shadow-dom/focus/focus-tabindex-order-shadow-zero-delegatesFocus.html @@ -28,7 +28,7 @@ resetFocus(); // Focus should move in flat tree order since every one of them has tabindex ==0, // but doesn't include slots and #host. - return assertFocusOrder(elementsInFlatTreeOrder.filter(el => (el !== slotAbove && el !== slotBelow && el !== host))); + return assertFocusOrder([aboveHost, aboveSlot, slottedAbove, slottedBelow, belowSlot, belowHost]); }, "Order when all tabindex=0 is and delegatesFocus = true"); From 95b0f05ddd99ca344256d97433a55925ddd09a90 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Fri, 27 Sep 2019 13:07:01 +0900 Subject: [PATCH 4/9] Add test for click focus --- .../focus/click-focus-delegatesFocus.html | 83 +++++++++++++++++++ 1 file changed, 83 insertions(+) create mode 100644 shadow-dom/focus/click-focus-delegatesFocus.html diff --git a/shadow-dom/focus/click-focus-delegatesFocus.html b/shadow-dom/focus/click-focus-delegatesFocus.html new file mode 100644 index 00000000000000..596d26c5f165af --- /dev/null +++ b/shadow-dom/focus/click-focus-delegatesFocus.html @@ -0,0 +1,83 @@ + + +HTML Test: click on shadow host with delegatesFocus + + + + + + + +
+
slotted
+
+
outside
+ + + From e53c8e0e99f90d92b717969ca52474a1fbe4f42d Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Fri, 27 Sep 2019 14:01:10 +0900 Subject: [PATCH 5/9] Add actual testdriver tests --- ...ck-focus-delegatesFocus-click-method.html} | 16 ----- ...-focus-delegatesFocus-tabindex-varies.html | 69 +++++++++++++++++++ ...ck-focus-delegatesFocus-tabindex-zero.html | 69 +++++++++++++++++++ 3 files changed, 138 insertions(+), 16 deletions(-) rename shadow-dom/focus/{click-focus-delegatesFocus.html => click-focus-delegatesFocus-click-method.html} (78%) create mode 100644 shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html create mode 100644 shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html diff --git a/shadow-dom/focus/click-focus-delegatesFocus.html b/shadow-dom/focus/click-focus-delegatesFocus-click-method.html similarity index 78% rename from shadow-dom/focus/click-focus-delegatesFocus.html rename to shadow-dom/focus/click-focus-delegatesFocus-click-method.html index 596d26c5f165af..92212cd85b8661 100644 --- a/shadow-dom/focus/click-focus-delegatesFocus.html +++ b/shadow-dom/focus/click-focus-delegatesFocus-click-method.html @@ -49,14 +49,6 @@ resetFocus(shadowRoot); } -test(() => { - resetTabIndexAndFocus(); - setAllTabIndex(0); - test_driver.click(host); - assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, document.body); -}, "click on host with delegatesFocus, all tabindex=0"); - test(() => { resetTabIndexAndFocus(); setAllTabIndex(0); @@ -65,14 +57,6 @@ assert_equals(document.activeElement, document.body); }, "call click() on host with delegatesFocus, all tabindex=0"); -test(() => { - resetTabIndexAndFocus(); - setAllTabIndex(0); - test_driver.click(slotted); - assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, document.body); -}, "click on slotted element in delegatesFocus shadow tree, all tabindex=0"); - test(() => { resetTabIndexAndFocus(); setAllTabIndex(0); diff --git a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html new file mode 100644 index 00000000000000..46d805635258e1 --- /dev/null +++ b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html @@ -0,0 +1,69 @@ + + +HTML Test: click on shadow host with delegatesFocus + + + + + + + +
+
slotted
+
+
outside
+ + + diff --git a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html new file mode 100644 index 00000000000000..b18031d8ce6b8c --- /dev/null +++ b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html @@ -0,0 +1,69 @@ + + +HTML Test: click on shadow host with delegatesFocus + + + + + + + +
+
slotted
+
+
outside
+ + + From 7004d81a03aeaaa8d3ba5200242202b400e60bab Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Fri, 27 Sep 2019 14:14:31 +0900 Subject: [PATCH 6/9] use promise_test --- .../focus/click-focus-delegatesFocus-tabindex-varies.html | 7 +++---- .../focus/click-focus-delegatesFocus-tabindex-zero.html | 7 +++---- 2 files changed, 6 insertions(+), 8 deletions(-) diff --git a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html index 46d805635258e1..fe51a9d0d3c0e7 100644 --- a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html +++ b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html @@ -56,14 +56,13 @@ resetFocus(shadowRoot); } -async_test(async (t) => { +promise_test(async () => { resetTabIndexAndFocus(); setTabIndex([aboveSlot], 2); setTabIndex([slot, slotted], 1); await test_driver.click(host); - t.step(() => { assert_equals(shadowRoot.activeElement, null); }); - t.step(() => { assert_equals(document.activeElement, aboveSlot); }); - t.done(); + assert_equals(shadowRoot.activeElement, null); + assert_equals(document.activeElement, aboveSlot); }, "click on host with delegatesFocus, #aboveSlot tabindex = 2, #slot and #slotted tabindex = 1"); diff --git a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html index b18031d8ce6b8c..5f7914f2a4e31e 100644 --- a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html +++ b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-zero.html @@ -56,14 +56,13 @@ resetFocus(shadowRoot); } -async_test(async (t) => { +promise_test(async () => { resetTabIndexAndFocus(); setAllTabIndex(0); removeTabIndex([spacer]); await test_driver.click(host); - t.step(() => { assert_equals(shadowRoot.activeElement, aboveSlot); }); - t.step(() => { assert_equals(document.activeElement, host); }); - t.done(); + assert_equals(shadowRoot.activeElement, aboveSlot); + assert_equals(document.activeElement, host); }, "click on host with delegatesFocus, all tabindex=0 except spacer"); From d50f1a32f2c84c8466e739f40cd3d9fb70668c5d Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Tue, 8 Oct 2019 17:34:49 +0900 Subject: [PATCH 7/9] Add tabindex=1 test to focus() We should use flat-tree order instead of tabindex order, add test to ensure that. --- .../focus/focus-method-delegatesFocus.html | 20 +++++++++++++++++++ 1 file changed, 20 insertions(+) diff --git a/shadow-dom/focus/focus-method-delegatesFocus.html b/shadow-dom/focus/focus-method-delegatesFocus.html index 3c7f8afec69f6b..a28bd4033bc111 100644 --- a/shadow-dom/focus/focus-method-delegatesFocus.html +++ b/shadow-dom/focus/focus-method-delegatesFocus.html @@ -189,6 +189,26 @@ assert_equals(document.activeElement, host); }, "focus() on host with delegatesFocus & tabindex=0, #aboveSlots and #belowSlots with tabindex=0"); +test(() => { + resetTabIndexAndFocus(); + setTabIndex([host, aboveSlots], 0); + setTabIndex([belowSlots], 1); + // Structure: + //
(delegatesFocus=true) tabindex=0 + // #shadowRoot + //
tabindex=0 + // + // (slotted)
+ // + // (slotted)
+ //
tabindex=1 + //
+ // First focusable = #aboveSlots + host.focus(); + assert_equals(shadowRoot.activeElement, aboveSlots); + assert_equals(document.activeElement, host); +}, "focus() on host with delegatesFocus & tabindex=0, #aboveSlots with tabindex=0 and #belowSlots with tabindex=1"); + test(() => { resetTabIndexAndFocus(); setTabIndex([host, slottedToFirstSlot, slottedToSecondSlot, belowSlots], 0); From a1a7eeb18fb97a3faa4c92f909b27ff9ff4a4e1d Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Fri, 11 Oct 2019 20:45:31 +0900 Subject: [PATCH 8/9] Update focus-method-delegatesFocus.html --- shadow-dom/focus/focus-method-delegatesFocus.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shadow-dom/focus/focus-method-delegatesFocus.html b/shadow-dom/focus/focus-method-delegatesFocus.html index a28bd4033bc111..462542e3f7be18 100644 --- a/shadow-dom/focus/focus-method-delegatesFocus.html +++ b/shadow-dom/focus/focus-method-delegatesFocus.html @@ -118,7 +118,7 @@ // No focusable element under #host in the flat tree. host.focus(); assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, null); + assert_equals(document.activeElement, document.body); }, "focus() on host with delegatesFocus, all without tabindex"); test(() => { @@ -167,7 +167,7 @@ // No focusable element under #host in the flat tree. host.focus(); assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, null); + assert_equals(document.activeElement, document.body); }, "focus() on host with delegatesFocus & tabindex=0, #outside with tabindex=0"); test(() => { From a8a89f224f2170723170a452cb18b46cafb723b6 Mon Sep 17 00:00:00 2001 From: Rakina Zata Amni Date: Fri, 11 Oct 2019 20:46:10 +0900 Subject: [PATCH 9/9] Update click-focus-delegatesFocus-tabindex-varies.html --- .../focus/click-focus-delegatesFocus-tabindex-varies.html | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html index fe51a9d0d3c0e7..4051db128a9150 100644 --- a/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html +++ b/shadow-dom/focus/click-focus-delegatesFocus-tabindex-varies.html @@ -61,8 +61,8 @@ setTabIndex([aboveSlot], 2); setTabIndex([slot, slotted], 1); await test_driver.click(host); - assert_equals(shadowRoot.activeElement, null); - assert_equals(document.activeElement, aboveSlot); + assert_equals(shadowRoot.activeElement, aboveSlot); + assert_equals(document.activeElement, host); }, "click on host with delegatesFocus, #aboveSlot tabindex = 2, #slot and #slotted tabindex = 1");