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 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
33 changes: 22 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,19 @@ 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>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 the first <span>focusable area</span> in <span>shadow-including 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>
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nit: should this be "... tree order whose DOM anchor is in ..."?

Copy link
Member Author

@domenic domenic Nov 1, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Well tree order needs to apply to DOM anchor... but yeah the current phrasing is weird. Will fix.

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I see the intent of the current phrasing now. It's "Return the first focusable area, in shadow-including tree order of who their DOM anchors are, in possible focus delegates."

This is just too confusing though. I will add an explicit sorting step so as to avoid the very long sentence with too many clauses that step on each other in confusing ways.

</ol>

<p class="note">For <span data-x="sequentially focusable">sequential focusability</span>, the
Expand Down Expand Up @@ -75166,6 +75169,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