@@ -1794,6 +1794,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute
1794
1794
<var>removedNode</var> and optionally <var>oldParent</var>, are defined as the following:</p>
1795
1795
1796
1796
<ol>
1797
+ <li id="node-remove-focus-fixup">
1798
+ <p>If <var>removedNode</var>'s <span>node document</span>'s <span data-x="focused area of the
1799
+ document">focused area</span> is <var>removedNode</var>, then set <var>removedNode</var>'s
1800
+ <span>node document</span>'s <span data-x="focused area of the document">focused area</span> to
1801
+ <var>removedNode</var>'s <span>node document</span>'s <span>viewport</span>.</p>
1802
+
1803
+ <p class="note">This does <em>not</em> perform the <span>unfocusing steps</span>,
1804
+ <span>focusing steps</span>, or <span>focus update steps</span>, and thus no <code
1805
+ data-x="event-blur">blur</code> or <code data-x="event-change">change</code> events are
1806
+ fired.</p>
1807
+ </li>
1808
+
1797
1809
<li><p>If <var>removedNode</var> is an element whose <span
1798
1810
data-x="concept-element-namespace">namespace</span> is the <span>HTML namespace</span>, and this
1799
1811
standard defines <span data-x="html element removing steps">HTML element removing steps</span>
@@ -59396,9 +59408,9 @@ interface <dfn interface>HTMLDialogElement</dfn> : <span>HTMLElement</span> {
59396
59408
59397
59409
<p class="note" id="note-dialog-plus-focus-fixup">This will cause the <span>focused area of the
59398
59410
document</span> to become <span>inert</span> (unless that currently focused area is a
59399
- <span>shadow-including descendant</span> of <var>subject</var>). In such cases, the <span>focus
59400
- fixup rule</ span> will kick in and reset the < span>focused area of the document</span > to the
59401
- <span>viewport</span> for now . In a couple steps we will attempt to find a better candidate to
59411
+ <span>shadow-including descendant</span> of <var>subject</var>). In such cases, the
59412
+ < span>focused area of the document</ span> will soon be <a href="#focus-fixup-rule">reset</a > to
59413
+ the <span>viewport</span>. In a couple steps we will attempt to find a better candidate to
59402
59414
focus.</p>
59403
59415
</li>
59404
59416
@@ -77126,39 +77138,14 @@ partial interface <span id="NavigatorUserActivation-partial">Navigator</span> {
77126
77138
</li>
77127
77139
</ol>
77128
77140
77129
- <p>When the <span>currently focused area of a top-level traversable</span> is somehow unfocused
77130
- without another element being explicitly focused in its stead, the user agent must
77131
- <span>immediately</span> run the <span>unfocusing steps</span> for that object.</p>
77132
-
77133
- <p class="note">The <span>unfocusing steps</span> do not always result in the focus changing,
77134
- even when applied to the <span>currently focused area of a top-level traversable</span>. For
77141
+ <p class="note">The <span>unfocusing steps</span> do not always result in the focus changing, even
77142
+ when applied to the <span>currently focused area of a top-level traversable</span>. For
77135
77143
example, if the <span>currently focused area of a top-level traversable</span> is a
77136
77144
<span>viewport</span>, then it will usually keep its focus regardless until another
77137
77145
<span>focusable area</span> is explicitly focused with the <span>focusing steps</span>.</p>
77138
77146
77139
77147
<hr>
77140
77148
77141
- <p><dfn>Focus fixup rule</dfn>: When the designated <span data-x="focused area of the
77142
- document">focused area of the document</span> is removed from that <code>Document</code> in some
77143
- way (e.g. it stops being a <span>focusable area</span>, it is removed from the DOM, it becomes
77144
- <span>inert</span>, etc.), designate the <code>Document</code>'s <span>viewport</span> to be the
77145
- new <span>focused area of the document</span>.</p>
77146
-
77147
- <p class="example">For example, this might happen because an element is removed from its
77148
- <code>Document</code>, or has a <code data-x="attr-hidden">hidden</code> attribute added. It might
77149
- also happen to an <code>input</code> element when the element gets <span
77150
- data-x="concept-fe-disabled">disabled</span>.</p>
77151
-
77152
- <p class="example">In a <code>Document</code> whose <span data-x="focused area of the
77153
- document">focused area</span> is a <code>button</code> element, removing, disabling, or hiding
77154
- that button would cause the page's new <span data-x="focused area of the document">focused
77155
- area</span> to be the <span>viewport</span> of the <code>Document</code>. This would, in turn,
77156
- be reflected through the <code
77157
- data-x="dom-documentorshadowroot-activeElement">activeElement</code> API as <span>the body
77158
- element</span>.</p>
77159
-
77160
- <hr>
77161
-
77162
77149
<p>The <dfn>focus update steps</dfn>, given an <var>old chain</var>, a <var>new chain</var>, and a <var>new focus target</var> respectively, are as
77163
77150
follows:</p>
77164
77151
@@ -77205,8 +77192,9 @@ partial interface <span id="NavigatorUserActivation-partial">Navigator</span> {
77205
77192
named <code data-x="event-blur">blur</code> at <var>blur event target</var>, with
77206
77193
<var>related blur target</var> as the related target.</p>
77207
77194
77208
- <p class="note">In some cases, e.g. if <var>entry</var> is an <code>area</code>
77209
- element's shape, a scrollable region, or a <span>viewport</span>, no event is fired.</p>
77195
+ <p class="note" id="note-sometimes-no-blur-event">In some cases, e.g., if <var>entry</var> is
77196
+ an <code>area</code> element's shape, a scrollable region, or a <span>viewport</span>, no
77197
+ event is fired.</p>
77210
77198
</li>
77211
77199
</ol>
77212
77200
</li>
@@ -99654,6 +99642,27 @@ import "https://example.com/foo/../module2.mjs";</code></pre>
99654
99642
</ol>
99655
99643
</li>
99656
99644
99645
+ <li id="focus-fixup-rule">
99646
+ <p>For each <span>fully active</span> <code>Document</code> in <var>docs</var>, if the <span
99647
+ data-x="focused area of the document">focused area</span> of that <code>Document</code> is
99648
+ not a <span>focusable area</span>, then run the <span>focusing steps</span> for that
99649
+ <code>Document</code>'s <span>viewport</span>.</p>
99650
+
99651
+ <p class="example">For example, this might happen because an element has the <code
99652
+ data-x="attr-hidden">hidden</code> attribute added, causing it to stop <span>being
99653
+ rendered</span>. It might also happen to an <code>input</code> element when the element gets
99654
+ <span data-x="concept-fe-disabled">disabled</span>.</p>
99655
+
99656
+ <p class="note">This will <a href="#note-sometimes-no-blur-event">usually</a> fire <code
99657
+ data-x="event-blur">blur</code> events, and possibly <code data-x="event-change">change</code>
99658
+ events.</p>
99659
+
99660
+ <p class="note">In addition to this asynchronous fixup, if the <span>focused area of the
99661
+ document</span> is removed, there is a <a href="#node-remove-focus-fixup">synchronous
99662
+ fixup</a>. That one will <em>not</em> fire <code data-x="event-blur">blur</code> or <code
99663
+ data-x="event-change">change</code> events.</p>
99664
+ </li>
99665
+
99657
99666
<li><p>For each <span>fully active</span> <code>Document</code> in <var>docs</var>, <span>run
99658
99667
the update intersection observations steps</span> for that <code>Document</code>, passing in
99659
99668
<var>now</var> as the timestamp. <ref spec=INTERSECTIONOBSERVER></p></li>
0 commit comments