Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Further fixes to focus delegation #7361

Merged
merged 2 commits into from
Jan 31, 2022
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 35 additions & 4 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -2986,7 +2986,7 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#dom-shadowroot-slot-assignment">slot assignment</dfn> concept</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-slotable">slottable</dfn> concept</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#assign-slotables-for-a-tree">assign slottables for a tree</dfn> algorithm</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant">inclusive descendants</dfn> concept</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#concept-tree-inclusive-descendant">inclusive descendant</dfn> concept</li>
<li>The <dfn data-x="finding flattened slottables" data-x-href="https://dom.spec.whatwg.org/#find-flattened-slotables">find flattened slottables</dfn> algorithm</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#slottable-manual-slot-assignment">manual slot assignment</dfn> concept</li>
<li>The <dfn data-x-href="https://dom.spec.whatwg.org/#assign-a-slot">assign a slot</dfn> algorithm</li>
Expand Down Expand Up @@ -75218,12 +75218,43 @@ END:VCARD</pre>
data-x="focusable area">focusable areas</span> whose <span>DOM anchor</span> is a
<span>shadow-including descendant</span> of <var>focus target</var>.</p></li>

<li><p>If <var>possible focus delegates</var> is empty, then return null.</p></li>

<li><p>Sort <var>possible focus delegates</var> by <span>shadow-including tree order</span> of
their <span data-x="DOM anchor">DOM anchors</span>.</p></li>

<li><p>Return <var>possible focus delegates</var>[0].</p></li>
<li>
<p>For each <var>possible focus delegate</var> of <var>possible focus delegates</var>:</p>

<ol>
<li><p>Let <var>is still a candidate</var> be true.</p></li>

<li><p>Let <var>root</var> be <var>possible focus delegate</var>'s <span>DOM anchor</span>'s
<span>root</span>.</p></li>

<li>
<p>While <var>root</var> is a <span>shadow root</span>:</p>

<ol>
<li><p>If <var>focus target</var> is an <span>inclusive descendant</span> of
<var>root</var>, then <span>break</span>.</p></li>

<li><p>If <var>root</var>'s <span>delegates focus</span> is false, then set
<var>is still a candidate</var> to false and <span>break</span>.</p></li>

<li><p>Set <var>root</var> to <var>root</var>'s <span
data-x="concept-DocumentFragment-host">host</span>'s <span>root</span>.</p></li>
</ol>
</li>

<li><p>If <var>is still a candidate</var> is true, then return <var>possible focus
delegate</var>.</p></li>
</ol>

<p class="note">The intent is to return the first <span>focusable area</span> in <var>possible
focus delegates</var> where the path between its <span>DOM anchor</span> and <var>focus
target</var> delegates focus at any shadow tree boundaries.</p>
</li>

<li><p>Return null.</p></li>
</ol>

<p>The <dfn>autofocus delegate</dfn> for a <var>focus target</var> given a <var>focus
Expand Down