From 66cc3cebc670a1c0a68948645c2aefd768f2a69f Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 28 Nov 2025 15:29:42 +0100 Subject: [PATCH 1/2] Editorial: modernize mutation observers Mainly adding
. --- dom.bs | 33 ++++++++++++++++++++++++--------- 1 file changed, 24 insertions(+), 9 deletions(-) diff --git a/dom.bs b/dom.bs index 32c0b71c..be8f496f 100644 --- a/dom.bs +++ b/dom.bs @@ -3906,9 +3906,9 @@ must return null. pending mutation observers (a set of zero or more {{MutationObserver}} objects), which is initially empty. +

To -queue a mutation observer microtask, -run these steps: +queue a mutation observer microtask:

  1. If the surrounding agent's mutation observer microtask queued is true, then @@ -3918,8 +3918,10 @@ run these steps:

  2. Queue a microtask to notify mutation observers.

+
-

To notify mutation observers, run these steps: +

+

To notify mutation observers:

  1. Set the surrounding agent's mutation observer microtask queued to false. @@ -3957,6 +3959,7 @@ run these steps: slotchange, with its {{Event/bubbles}} attribute set to true, at slot.

+

@@ -4088,11 +4091,14 @@ dictionary MutationObserverInit { returns what was in there. +

The new MutationObserver(callback) constructor steps are to set this's callback to callback. +

+

The observe(target, options) method steps are: @@ -4153,7 +4159,9 @@ method steps are: node list. +

+

The disconnect() method steps are:

    @@ -4164,7 +4172,9 @@ method steps are:
  1. Empty this's record queue.

+
+

The takeRecords() method steps are:

    @@ -4175,13 +4185,15 @@ method steps are:
  1. Return records.

+

Queuing a mutation record

-

To queue a mutation record of type for target with +

+

To queue a mutation record of type for target with name, namespace, oldValue, addedNodes, -removedNodes, previousSibling, and nextSibling, run these steps: +removedNodes, previousSibling, and nextSibling:

  1. Let interestedObservers be an empty map. @@ -4259,18 +4271,21 @@ method steps are:

  2. Queue a mutation observer microtask.

+
-

To queue a tree mutation record for target with -addedNodes, removedNodes, previousSibling, and -nextSibling, run these steps: +

+

To queue a tree mutation record for target with addedNodes, +removedNodes, previousSibling, and nextSibling:

    -
  1. Assert: either addedNodes or removedNodes is not empty. +

  2. Assert: either addedNodes or removedNodes + is not empty.

  3. Queue a mutation record of "childList" for target with null, null, null, addedNodes, removedNodes, previousSibling, and nextSibling.

+

Interface {{MutationRecord}}

From 33f43ac7181ef8e90be3eba12ae7caf7e2da302b Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Fri, 28 Nov 2025 15:32:07 +0100 Subject: [PATCH 2/2] Update dom.bs --- dom.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index be8f496f..dfc0d365 100644 --- a/dom.bs +++ b/dom.bs @@ -3920,7 +3920,7 @@ must return null.
-
+

To notify mutation observers: