diff --git a/source b/source index 1f9af255de0..27a90674fd4 100644 --- a/source +++ b/source @@ -1804,6 +1804,18 @@ a.setAttribute('href', 'https://example.com/'); // change the content attribute removedNode and optionally oldParent, are defined as the following:

    +
  1. +

    If removedNode's node document's focused area is removedNode, then set removedNode's + node document's focused area to + removedNode's node document's viewport.

    + +

    This does not perform the unfocusing steps, + focusing steps, or focus update steps, and thus no blur or change events are + fired.

    +
  2. +
  3. If removedNode is an element whose namespace is the HTML namespace, and this standard defines HTML element removing steps @@ -59153,9 +59165,9 @@ interface HTMLDialogElement : HTMLElement {

    This will cause the focused area of the document to become inert (unless that currently focused area is a - shadow-including descendant of subject). In such cases, the focus - fixup rule will kick in and reset the focused area of the document to the - viewport for now. In a couple steps we will attempt to find a better candidate to + shadow-including descendant of subject). In such cases, the + focused area of the document will soon be reset to + the viewport. In a couple steps we will attempt to find a better candidate to focus.

  4. @@ -76866,39 +76878,14 @@ partial interface Navigator {
-

When the currently focused area of a top-level traversable is somehow unfocused - without another element being explicitly focused in its stead, the user agent must - immediately run the unfocusing steps for that object.

- -

The unfocusing steps do not always result in the focus changing, - even when applied to the currently focused area of a top-level traversable. For +

The unfocusing steps do not always result in the focus changing, even + when applied to the currently focused area of a top-level traversable. For example, if the currently focused area of a top-level traversable is a viewport, then it will usually keep its focus regardless until another focusable area is explicitly focused with the focusing steps.


-

Focus fixup rule: When the designated focused area of the document is removed from that Document in some - way (e.g. it stops being a focusable area, it is removed from the DOM, it becomes - inert, etc.), designate the Document's viewport to be the - new focused area of the document.

- -

For example, this might happen because an element is removed from its - Document, or has a hidden attribute added. It might - also happen to an input element when the element gets disabled.

- -

In a Document whose focused area is a button element, removing, disabling, or hiding - that button would cause the page's new focused - area to be the viewport of the Document. This would, in turn, - be reflected through the activeElement API as the body - element.

- -
-

The focus update steps, given an old chain, a new chain, and a new focus target respectively, are as follows:

@@ -76945,8 +76932,9 @@ partial interface Navigator { named blur at blur event target, with related blur target as the related target.

-

In some cases, e.g. if entry is an area - element's shape, a scrollable region, or a viewport, no event is fired.

+

In some cases, e.g. if entry is + an area element's shape, a scrollable region, or a viewport, no + event is fired.

@@ -99573,6 +99561,27 @@ import "https://example.com/foo/../module2.mjs"; +
  • +

    For each fully active Document in docs, if the focused area of that Document is no + longer a focusable area, then run the focusing steps for that + Document's viewport.

    + +

    For example, this might happen because an element has the hidden attribute added, causing it to stop being + rendered. It might also happen to an input element when the element gets + disabled.

    + +

    This will usually fire blur events, and possibly change + events.

    + +

    In addition to this asynchronous fixup, if the focused area of the + document is removed, there is a synchronous + fixup. That one will not fire blur or change events.

    +
  • +
  • For each fully active Document in docs, run the update intersection observations steps for that Document, passing in now as the timestamp.