Skip to content

Commit 185190c

Browse files
authored
Queue a task to run all the autofocusing steps
Closes #3467. Tests (non-exhaustive): web-platform-tests/wpt#9804
1 parent 6df4863 commit 185190c

File tree

1 file changed

+8
-11
lines changed

1 file changed

+8
-11
lines changed

source

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -52962,18 +52962,20 @@ interface <dfn>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
5296252962
<div w-nodev>
5296352963

5296452964
<p>When an element with the <code data-x="attr-fe-autofocus">autofocus</code> attribute specified
52965-
is <span data-x="node is inserted into a document">inserted into a document</span>, user agents
52966-
should run the following steps:</p>
52965+
is <span data-x="node is inserted into a document">inserted into a document</span>, <span>queue a
52966+
task</span> on the <span>user interaction task source</span> to run the following steps:</p>
5296752967

5296852968
<ol>
52969+
<li><p>If the user has indicated (for example, by starting to type in a form control) that they
52970+
do not wish focus to be changed, then optionally return.</p></li>
5296952971

5297052972
<li><p>Let <var>target</var> be the element's <span>node document</span>.</p></li>
5297152973

5297252974
<li><p>If <var>target</var> has no <span data-x="concept-document-bc">browsing context</span>,
5297352975
then return.</p></li>
5297452976

5297552977
<li><p>If <var>target</var>'s <span data-x="concept-document-bc">browsing context</span> has no
52976-
<span>top-level browsing context</span> (e.g. it is a <span>nested browsing context</span> with
52978+
<span>top-level browsing context</span> (e.g., it is a <span>nested browsing context</span> with
5297752979
no <span>parent browsing context</span>), then return.</p></li>
5297852980

5297952981
<li><p>If <var>target</var>'s <span>active sandboxing flag set</span> has the
@@ -52994,14 +52996,9 @@ interface <dfn>HTMLLegendElement</dfn> : <span>HTMLElement</span> {
5299452996
document</span> is the same as <var>target</var>'s <span>top-level browsing
5299552997
context</span>'s <span>active document</span>, then return.</p></li>
5299652998

52997-
<li><p>If the user has indicated (for example, by starting to type in a form control) that they
52998-
do not wish focus to be changed, then optionally return.</p></li>
52999-
53000-
<li><p><span>Queue a task</span> that runs the <span>focusing steps</span> for the element. User
53001-
agents may also change the scrolling position of the document, or perform some other action that
53002-
brings the element to the user's attention. The <span>task source</span> for this task is the
53003-
<span>user interaction task source</span>.</p></li>
53004-
52999+
<li><p>Run the <span>focusing steps</span> for the element. User agents may also change the
53000+
scrolling position of the document, or perform some other action that brings the element to the
53001+
user's attention.</p></li>
5300553002
</ol>
5300653003

5300753004
<p class="note">This handles the automatic focusing during document load. The <code

0 commit comments

Comments
 (0)