@@ -76857,51 +76857,59 @@ partial interface <span id="NavigatorUserActivation-partial">Navigator</span> {
76857
76857
<dd><p>Return null.</p></dd>
76858
76858
</dl>
76859
76859
76860
- <p>The <dfn>focus delegate</dfn> for a <var>focus target </var>, given an optional string
76861
- <var>focus trigger </var> (default "<code data-x="">other</code>"), is given by the following
76860
+ <p>The <dfn>focus delegate</dfn> for a <var>focusTarget </var>, given an optional string
76861
+ <var>focusTrigger </var> (default "<code data-x="">other</code>"), is given by the following
76862
76862
steps:</p>
76863
76863
76864
76864
<ol>
76865
- <li><p>Let <var>autofocus delegate</var> be the <span>autofocus delegate</span> for <var>focus
76866
- target</var> given <var>focus trigger</var>.</p></li>
76867
-
76868
- <li><p>If <var>autofocus delegate</var> is not null, then return <var>autofocus
76869
- delegate</var>.</p></li>
76870
-
76871
- <li><p>If <var>focus target</var> is a <span>shadow host</span> and its <span
76865
+ <li><p>If <var>focusTarget</var> is a <span>shadow host</span> and its <span
76872
76866
data-x="concept-element-shadow-root">shadow root</span>'s <span>delegates focus</span> is false,
76873
76867
then return null.</p></li>
76874
76868
76875
- <li><p>Let <var>parent</var> be <var>focus target</var>.</p></li>
76869
+ <li><p>Let <var>whereToLook</var> be <var>focusTarget</var>.</p></li>
76870
+
76871
+ <li><p>If <var>whereToLook</var> is a <span>shadow host</span>, then set <var>whereToLook</var>
76872
+ to <var>whereToLook</var>'s <span data-x="concept-element-shadow-root">shadow
76873
+ root</span>.</p></li>
76874
+
76875
+ <li><p>Let <var>autofocusDelegate</var> be the <span>autofocus delegate</span> for
76876
+ <var>whereToLook</var> given <var>focusTrigger</var>.</p></li>
76876
76877
76877
- <li><p>If <var>parent </var> is a <span>shadow host</span> , then set <var>parent</var> to
76878
- <var>parent </var>'s <span data-x="concept-element-shadow-root">shadow root</span >.</p></li>
76878
+ <li><p>If <var>autofocusDelegate </var> is not null , then return
76879
+ <var>autofocusDelegate </var>.</p></li>
76879
76880
76880
76881
<li>
76881
- <p><span data-x="list iterate">For each</span> <var>child</var> of <var>parent</var>'s <span
76882
- data-x="concept-tree-child">children</span>:</p>
76882
+ <p><span data-x="list iterate">For each</span> <var>descendant</var> of
76883
+ <var>whereToLook</var>'s <span data-x="descendant">descendants</span>, in <span>tree
76884
+ order</span>:</p>
76883
76885
76884
76886
<ol>
76887
+ <li><p>If <var>descendant</var> is a <span>focusable area</span>, then return
76888
+ <var>descendant</var>.</p></li>
76889
+
76885
76890
<li>
76886
- <p>Let <var>focusable area</var> be <var>child</var>, if <var>child</var> is a
76887
- <span>focusable area</span>; otherwise let <var>focusable area</var> be the result of <span
76888
- data-x="get the focusable area">getting the focusable area</span> for <var>child</var> given
76889
- <var>focus trigger</var>.</p>
76891
+ <p>Let <var>focusableArea</var> be the result of <span data-x="get the focusable
76892
+ area">getting the focusable area</span> for <var>descendant</var> given
76893
+ <var>focusTrigger</var>.</p>
76890
76894
76891
76895
<p class="note">This step can end up recursing, i.e., the <span>get the focusable area</span>
76892
- steps might return the <span>focus delegate</span> of <var>child </var>.</p>
76896
+ steps might return the <span>focus delegate</span> of <var>descendant </var>.</p>
76893
76897
</li>
76894
76898
76895
- <li><p>If <var>focusable area</var> is not null, then return <var>focusable
76896
- area</var>.</p></li>
76899
+ <li><p>If <var>focusableArea</var> is not null, then return <var>focusableArea</var>.</p></li>
76897
76900
</ol>
76901
+
76902
+ <p class="note">It's important that we are <em>not</em> looking at the <span
76903
+ data-x="shadow-including descendant">shadow-including descendants</span> here, but instead only
76904
+ at the <span data-x="descendant">descendants</span>. <span data-x="shadow host">Shadow
76905
+ hosts</span> are instead handled by the recursive case mentioned above.</p>
76898
76906
</li>
76899
76907
76900
76908
<li><p>Return null.</p></li>
76901
76909
</ol>
76902
76910
76903
76911
<p class="note">The above algorithm essentially returns the first suitable <span>focusable
76904
- area</span> where the path between its <span>DOM anchor</span> and <var>focus target </var>
76912
+ area</span> where the path between its <span>DOM anchor</span> and <var>focusTarget </var>
76905
76913
delegates focus at any shadow tree boundaries.</p>
76906
76914
76907
76915
<p>The <dfn>autofocus delegate</dfn> for a <var>focus target</var> given a <var>focus
0 commit comments