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

Fixes to delegatesFocus #7079

Merged
merged 2 commits into from
Nov 1, 2021
Merged
Changes from all commits
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
36 changes: 25 additions & 11 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -75042,9 +75042,10 @@ END:VCARD</pre>

<dd>
<ol>
<li><p>If <var>focus target</var> is a <span>shadow-including inclusive ancestor</span> of the
<span>currently focused area of a top-level browsing context</span>'s <span>DOM anchor</span>,
then return null.</p></li>
<li><p>If <var>focus target</var>'s <span data-x="concept-element-shadow-root">shadow
root</span> is a <span>shadow-including inclusive ancestor</span> of the <span>currently
focused area of a top-level browsing context</span>'s <span>DOM anchor</span>, then return
null.</p></li>

<li><p>Let <var>autofocus delegate</var> be the <span>autofocus delegate</span> for <var>focus
target</var> given <var>focus trigger</var>.</p></li>
Expand All @@ -75053,17 +75054,22 @@ END:VCARD</pre>
delegate</var>.</p></li>

<li><p>If <var>focus trigger</var> is "<code data-x="">click</code>", then let <var>possible
focus delegates</var> be the list of all <span>click focusable</span> <span
data-x="focusable area">focusable areas</span> whose <span>DOM anchor</span> is a descendant
of <var>focus target</var> in the <span>flat tree</span>.</p></li>
focus delegates</var> be the list of all <span>click focusable</span> <span data-x="focusable
area">focusable areas</span> whose <span>DOM anchor</span> is a <span>shadow-including
descendant</span> of <var>focus target</var>'s <span
data-x="concept-element-shadow-root">shadow root</span>.</p></li>

<li><p>Otherwise, let <var>possible focus delegates</var> be the list of all <span
data-x="focusable area">focusable areas</span> whose <span>DOM anchor</span> is a descendant
of <var>focus target</var> in the <span>flat tree</span>.</p></li>
data-x="focusable area">focusable areas</span> whose <span>DOM anchor</span> is a
<span>shadow-including descendant</span> of <var>focus target</var>'s <span
data-x="concept-element-shadow-root">shadow root</span>.</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 the first <span>focusable area</span> in <span>tree order</span> of who their
<span data-x="DOM anchor">DOM anchors</span> are in <var>possible focus delegates</var>, or
null if <var>possible focus delegates</var> is empty.</p></li>
<li><p>Return <var>possible focus delegates</var>[0].</p></li>
</ol>

<p class="note">For <span data-x="sequentially focusable">sequential focusability</span>, the
Expand Down Expand Up @@ -75166,6 +75172,14 @@ END:VCARD</pre>
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2819 -->
<!-- https://software.hixie.ch/utilities/js/live-dom-viewer/?saved=2822 -->

<li><p>If <var>old focus target</var> is a <span>shadow host</span> whose <span
data-x="concept-element-shadow-root">shadow root</span>'s <span>delegates focus</span> is true,
and <var>old focus target</var>'s <span data-x="concept-element-shadow-root">shadow root</span>
is a <span>shadow-including inclusive ancestor</span> of the <span>currently focused area of a
top-level browsing context</span>'s <span>DOM anchor</span>, then set <var>old focus
target</var> to that <span>currently focused area of a top-level browsing
context</span>.</p></li>

<li><p>If <var>old focus target</var> is <span>inert</span>, then return.</p></li>

<li>
Expand Down