You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
<var>shadowRoot</var> is not null and <var>shadowRoot</var> is the <span>root</span> of at
68336
68336
least one element that <span data-x="element has the focus">has the focus</span>.</p></li>
@@ -72550,8 +72550,14 @@ END:VCARD</pre>
72550
72550
72551
72551
<h4>Data model</h4>
72552
72552
72553
-
<p>The term <dfn>focusable area</dfn> is used to refer to regions of the interface that can become
72554
-
the target of keyboard input. Focusable areas can be elements, parts of elements, or other regions
72553
+
<p>A <span>top-level browsing context</span> has <dfn data-x="tlbc system focus">system
72554
+
focus</dfn> when it can receive keyboard input channeled from the operating system.</p>
72555
+
72556
+
<p class="note">System focus is lost when a browser window loses focus, but might also be lost to
72557
+
other system widgets in the browser window such as a URL bar.</p>
72558
+
72559
+
<p>The term <dfn>focusable area</dfn> is used to refer to regions of the interface that can further become
72560
+
the target of such keyboard input. Focusable areas can be elements, parts of elements, or other regions
72555
72561
managed by the user agent.</p>
72556
72562
72557
72563
<p>Each <span>focusable area</span> has a <dfn>DOM anchor</dfn>, which is a <code>Node</code> object
@@ -72694,9 +72700,12 @@ END:VCARD</pre>
72694
72700
in this specification.</p>
72695
72701
72696
72702
<p>The <dfn>currently focused area of a top-level browsing context</dfn> <var>topLevelBC</var> at
72697
-
any particular time is the <span>focusable area</span> returned by this algorithm:</p>
72703
+
any particular time is the <span>focusable area</span>-or-null returned by this algorithm:</p>
72698
72704
72699
72705
<ol>
72706
+
<li><p>If <var>topLevelBC</var> does not have <span data-x="tlbc system focus">system
72707
+
focus</span>, then return null.</p></li>
72708
+
72700
72709
<li><p>Let <var>candidate</var> be <var>topLevelBC</var>'s <span>active document</span>.</p></li>
72701
72710
72702
72711
<li><p>While <var>candidate</var>'s <span data-x="focused area of the document">focused
@@ -72712,11 +72721,16 @@ END:VCARD</pre>
72712
72721
<li><p>Return <var>candidate</var>.</p></li>
72713
72722
</ol>
72714
72723
72724
+
<p>The <dfn>current focus chain of a top-level browsing context</dfn> <var>topLevelBC</var> at any
72725
+
particular time is the <span>focus chain</span> of the <span data-x="currently focused area of a
72726
+
top-level browsing context">currently focused area</span> of <var>topLevelBC</var>, if
72727
+
<var>topLevelBC</var> is non-null, or an empty list otherwise.</p>
72728
+
72715
72729
<p>An element that is the <span>DOM anchor</span> of a <span>focusable area</span> is said to <dfn
72716
-
data-x="gains focus">gain focus</dfn> when that <span>focusable area</span> becomes the <span>currently
72717
-
focused area of a top-level browsing context</span>. When an element is the <span>DOM anchor</span> of a
72718
-
<span>focusable area</span> of the <span>currently focused area of a top-level browsing context</span>,
72719
-
it is <dfn>focused</dfn>.</p>
72730
+
data-x="gains focus">gain focus</dfn> when that <span>focusable area</span> becomes the
72731
+
<span>currently focused area of a top-level browsing context</span>. When an element is the
72732
+
<span>DOM anchor</span> of a <span>focusable area</span> of the <span>currently focused area of a
72733
+
top-level browsing context</span>, it is <dfn>focused</dfn>.</p>
72720
72734
72721
72735
<div w-nodev>
72722
72736
@@ -73229,10 +73243,9 @@ END:VCARD</pre>
73229
73243
<li><p>If <var>new focus target</var> is the <span>currently focused area of a
73230
73244
top-level browsing context</span>, then return.</p></li>
73231
73245
73232
-
<li><p>Let <var>old chain</var> be the <span>focus chain</span> of the <span
73233
-
data-x="currently focused area of a top-level browsing context">currently focused area of the
73234
-
top-level browsing context</span> in which <var>new focus target</var> finds
73235
-
itself.</p></li>
73246
+
<li><p>Let <var>old chain</var> be the <span data-x="current focus chain of a top-level browsing
73247
+
context">current focus chain of the top-level browsing context</span> in which <var>new focus
73248
+
target</var> finds itself.</p></li>
73236
73249
73237
73250
<li><p>Let <var>new chain</var> be the <span>focus chain</span> of <var>new
73238
73251
focus target</var>.</p></li>
@@ -73262,21 +73275,27 @@ END:VCARD</pre>
73262
73275
target</var> be that <span>currently focused area of a top-level browsing context</span>.</p>
73263
73276
</li>
73264
73277
73265
-
<li><p>Let <var>old chain</var> be the <span>focus chain</span> of the <span>currently
73266
-
focused area of a top-level browsing context</span>.</p></li>
73278
+
<li><p>Let <var>old chain</var> be the <span data-x="current focus chain of a top-level browsing
73279
+
context">current focus chain of the top-level browsing context</span> in which <var>old focus
73280
+
target</var> finds itself.</p></li>
73267
73281
73268
73282
<li><p>If <var>old focus target</var> is not one of the entries in <var>old
73269
73283
chain</var>, then return.</p></li>
73270
73284
73285
+
<li><p>If <var>old focus target</var> is not a <span>focusable area</span>, then return.</p></li>
73286
+
73287
+
<li><p>Let <var>topDocument</var> be <var>old chain</var>'s last entry.</p></li>
73288
+
73271
73289
<li>
73272
-
<p>If <var>old focus target</var> is a <span>focusable area</span>, then let <var>new
73273
-
focus target</var> be its <code>Document</code>'s <span>viewport</span>.</p>
73290
+
<p>If <var>topDocument</var>'s <span data-x="concept-document-bc">browsing context</span> has
73291
+
<span data-x="tlbc system focus">system focus</span>, then run the <span>focusing steps</span>
73292
+
for <var>topDocument</var>'s <span>viewport</span>.</p>
73274
73293
73275
-
<p>Otherwise, let <var>new focus target</var> be null.</p>
73294
+
<p>Otherwise, apply any relevant platform-specific conventions for removing <span data-x="tlbc
73295
+
system focus">system focus</span> from <var>topDocument</var>'s <span
73296
+
data-x="concept-document-bc">browsing context</span>, and run the <span>focus update
73297
+
steps</span> with <var>old chain</var>, an empty list, and null respectively.</p>
73276
73298
</li>
73277
-
73278
-
<li><p>If <var>new focus target</var> is not null, then run the <span>focusing
73279
-
steps</span> for <var>new focus target</var>.</p></li>
73280
73299
</ol>
73281
73300
73282
73301
<p>When the <span>currently focused area of a top-level browsing context</span> is somehow
@@ -73364,9 +73383,9 @@ END:VCARD</pre>
73364
73383
</ol>
73365
73384
</li>
73366
73385
73367
-
<li><p>Apply any relevant platform-specific conventions for focusing <var>new focus
73368
-
target</var>. (For example, some platforms select the contents of a text control when that
73369
-
control is focused.)</p></li>
73386
+
<li><p>Apply any relevant platform-specific conventions for focusing <var>new focus target</var>.
73387
+
(For example, some platforms select the contents of a text control when that control is
73388
+
focused.)</p></li>
73370
73389
73371
73390
<li>
73372
73391
<p>For each entry <var>entry</var> in <var>new chain</var>, in reverse
@@ -73426,6 +73445,10 @@ END:VCARD</pre>
73426
73445
top-level browsing context">currently focused area of the top-level browsing
73427
73446
context</span>.</p></li>
73428
73447
73448
+
<li><p>Assert: <var>target area</var> is not null, since key events are only routed to <span
73449
+
data-x="top-level browsing context">top-level browsing contexts</span> that have <span
73450
+
data-x="tlbc system focus">system focus</span>.</p></li>
73451
+
73429
73452
<li><p>If <var>target area</var> is a <span>focusable area</span>, let <var>target
73430
73453
node</var> be <var>target area</var>'s <span>DOM anchor</span>. Otherwise, <var>target area</var> is a <code>dialog</code>; let <var>target node</var> be
0 commit comments