Skip to content

Commit

Permalink
Improve autofocus and delegatesFocus interaction
Browse files Browse the repository at this point in the history
Now, when focusing a shadow host with delegates focus set, we try to focus the first focusable area with the autofocus attribute set, instead of just the first focusable area.

Closes #833.
  • Loading branch information
domenic committed Aug 25, 2021
1 parent b85e9ae commit 7db993d
Showing 1 changed file with 18 additions and 18 deletions.
36 changes: 18 additions & 18 deletions source
Original file line number Diff line number Diff line change
Expand Up @@ -74997,24 +74997,24 @@ END:VCARD</pre>
<span>currently focused area of a top-level browsing context</span>'s <span>DOM anchor</span>,
then return null.</li>

<li>
<p>Otherwise:</p>

<ol>
<li>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>.</li>

<li>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>.</li>

<li>Return the first <span>focusable area</span> in <span>tree order</span> of their <span
data-x="DOM anchor">DOM anchors</span> in <var>possible focus delegates</var>, or null if
<var>possible focus delegates</var> is empty.</li>
</ol>
</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>

<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>

<li><p>If any of the <span data-x="focusable area">focusable areas</span> in <var>possible
focus delegates</var> have a <span>DOM anchor</span> whose <code
data-x="attr-fe-autofocus">autofocus</code> content attribute is specified, then return the
first such <span>focusable area</span> in <span>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 their <span
data-x="DOM anchor">DOM anchors</span> in <var>possible focus delegates</var>, or null if
<var>possible focus delegates</var> is empty.</p></li>
</ol>

<p class="note">For <span data-x="sequentially focusable">sequential focusability</span>, the
Expand Down

0 comments on commit 7db993d

Please sign in to comment.