diff --git a/dom.bs b/dom.bs
index de8f62ff..d2af7842 100644
--- a/dom.bs
+++ b/dom.bs
@@ -145,7 +145,7 @@ first following sibling or null if it has no
Let tokens be a new ordered set.
-
For each member → value of dictionary, if +
For each member → value of dictionary: if event has an attribute whose identifier is member, then initialize that attribute to value. @@ -1263,8 +1263,8 @@ method steps are:
To remove all event listeners, given an {{EventTarget}} object -eventTarget, for each listener of eventTarget's -event listener list, remove an event listener with +eventTarget: for each listener of eventTarget's +event listener list: remove an event listener with eventTarget and listener.
HTML needs this to define document.open(). [[HTML]]
@@ -1383,7 +1383,7 @@ property of the event being dispatched.
Let touchTargets be a new list.
For each touchTarget of event's - touch target list, append the result of retargeting + touch target list: append the result of retargeting touchTarget against target to touchTargets.
Append to an event path with event, target, @@ -1430,7 +1430,7 @@ property of the event being dispatched.
Let touchTargets be a new list.
For each touchTarget of event's - touch target list, append the result of retargeting + touch target list: append the result of retargeting touchTarget against parent to touchTargets.
Set slot's assigned nodes to slottables. -
For each slottable of slottables, set slottable's +
For each slottable of slottables: set slottable's assigned slot to slot.
To ensure pre-insert validity of a -node node into a node parent before a +node node into a node parent before null or a node child:
+To pre-insert a node into a -parent before a child, run these steps: +
To pre-insert a node node +into a node parent before null or node child:
Ensure pre-insert validity of node into parent before @@ -2753,7 +2756,9 @@ boolean open (default false):
Return node.
Specifications may define insertion steps for all or some nodes. The algorithm is passed insertedNode, as indicated in the insert algorithm @@ -2761,6 +2766,7 @@ below. These steps must not modify the node tree that insertedNode participates in, create browsing contexts, fire events, or otherwise execute JavaScript. These steps may [=queue a global task|queue tasks=] to do these things asynchronously, however. +
While the insertion steps cannot execute JavaScript (among other things), they will
@@ -2806,6 +2812,7 @@ below. These steps must not modify the node tree that insertedNode
adjust this further based on the requirements of the script element. There might be other ways
to define that though as Olli suggests, so leaving that out for now. -->
+ Specifications may also define
post-connection steps for all or some
nodes. The algorithm is passed connectedNode, as indicated in the
@@ -2818,14 +2825,19 @@ or otherwise execute JavaScript. These steps allow a batch of nodes to be
inserted atomically with respect to script, with all major side effects
occurring after the batch insertions into the node tree is complete. This ensures
that all pending node tree insertions completely finish before more insertions can occur.
+ Specifications may define
children changed steps for all or some
nodes. The algorithm is passed no argument and is called from insert,
remove, and replace data.
+ To insert a node into a parent
-before a child, with an optional suppress observers flag, run these steps:
+ To insert a node node into a
+node parent before null or a node child, with an
+optional boolean suppressObservers (default false):
Let nodes be node's children, if node is a
@@ -2839,15 +2851,14 @@ before a child, with an optional suppress observers flag, run
If node is a {{DocumentFragment}} node:
Remove its children with the suppress observers flag
- set.
+ Remove its children with
+ suppressObservers set to true.
Queue a tree mutation record for node with « », nodes, null, and
null.
- This step intentionally does not pay attention to the
- suppress observers flag.
+ This step intentionally does not pay attention to suppressObservers.
For each live range whose start node is parent and
- start offset is greater than child's index, increase
+ start offset is greater than child's index: increase
its start offset by count.
For each live range whose end node is parent and
- end offset is greater than child's index, increase
+ end offset is greater than child's index: increase
its end offset by count.
If suppress observers flag is unset, then queue a tree mutation record for
+ If suppressObservers is false, then queue a tree mutation record for
parent with nodes, « », previousSibling, and child.
Run the children changed steps for parent.
@@ -2969,28 +2980,38 @@ before a child, with an optional suppress observers flag, run
For each shadow-including inclusive descendant inclusiveDescendant of
- node, in shadow-including tree order, append
+ node, in shadow-including tree order: append
inclusiveDescendant to staticNodeList.
For each node of staticNodeList, if node is
+ For each node of staticNodeList: if node is
connected, then run the post-connection steps with node.
+ To append a node node to a
+node parent: pre-insert node into parent before
+null.
+ Specifications may define
moving steps for all or some nodes. The
-algorithm is passed a node movedNode, and a node-or-null
+algorithm is passed a node movedNode, and a node-or-null
oldParent as indicated in the move algorithm below. Like the
insertion steps, these steps must not modify the node tree that
movedNode participates in, create browsing contexts,
fire events, or otherwise execute JavaScript. These steps may queue tasks
to do these things asynchronously, however.
+ To move a node node into a node
-newParent before a node-or-null child:
+newParent before null or a node child:
For each {{NodeIterator}} object iterator whose
root's node document is node's
- node document, run the Let oldPreviousSibling be node's previous sibling.
@@ -3061,11 +3082,11 @@ to do these things asynchronously, however.
For each live range whose start node is newParent and
- start offset is greater than child's index, increase
+ start offset is greater than child's index: increase
its start offset by 1.
For each live range whose end node is newParent and
- end offset is greater than child's index, increase
+ end offset is greater than child's index: increase
its end offset by 1.
Queue a tree mutation record for newParent with « node », « »,
newPreviousSibling, and child. To append a node to a parent,
-pre-insert node into parent before null.
-
-
- To replace a child with node
-within a parent, run these steps:
+ To replace a node child with
+a node node within a node parent:
Insert node into parent before referenceChild
- with the suppress observers flag set.
+ with suppressObservers set to true.
Queue a tree mutation record for parent with nodes,
removedNodes, previousSibling, and referenceChild.
Return child.
+ To replace all with a node
-within a parent, run these steps:
+ To replace all with a node or
+null node within a node parent:
Let removedNodes be parent's children.
@@ -3221,10 +3243,10 @@ within a parent, run these steps:
Otherwise, if node is non-null, set addedNodes to « node ».
Remove all parent's children, in tree order,
- with the suppress observers flag set.
+ with suppressObservers set to true.
If node is non-null, then insert node into
- parent before null with the suppress observers flag set.
+ parent before null with suppressObservers set to true.
If either addedNodes or removedNodes is not empty,
then queue a tree mutation record for parent with addedNodes,
@@ -3233,10 +3255,13 @@ within a parent, run these steps:
This algorithm does not make any checks with regards to the
node tree constraints. Specification authors need to use it wisely.
+ To pre-remove a child from a
-parent, run these steps:
+ Specifications may define
removing steps for all or some nodes. The
algorithm is passed a node removedNode and a
node-or-null oldParent, as indicated in the remove
algorithm below.
+ To remove a node node, with an
-optional suppress observers flag, run these steps:
+optional boolean suppressObservers (default false):
Let parent be node's parent.
@@ -3267,7 +3295,7 @@ optional suppress observers flag, run these steps:
For each {{NodeIterator}} object iterator whose
root's node document is node's
- node document, run the Let oldPreviousSibling be node's previous sibling.
@@ -3328,12 +3356,13 @@ optional suppress observers flag, run these steps:
source is registered to node's
registered observer list.
- If suppress observers flag is unset, then queue a tree mutation record for
+ If suppressObservers is false, then queue a tree mutation record for
parent with « », « node », oldPreviousSibling, and
oldNextSibling.
Run the children changed steps for parent.
Empty mo's record queue.
For each node of mo's
- node list, remove all
+ node list: remove all
transient registered observers whose observer is
mo from node's registered observer list.
@@ -3935,7 +3964,7 @@ run these steps:
and " For each slot of signalSet, fire an event named
+ For each slot of signalSet: fire an event named
slotchange, with its {{Event/bubbles}} attribute set to true,
at slot.
@@ -4109,12 +4138,12 @@ method steps are:
For each registered of target's
- registered observer list, if registered's
+ registered observer list: if registered's
observer is this:
For each node of this's
- node list, remove all
+ node list: remove all
transient registered observers whose source is
registered from node's registered observer list.
@@ -4140,7 +4169,7 @@ method steps are:
For each node of this's
- node list, remove any registered observer from
+ node list: remove any registered observer from
node's registered observer list for which this is the
observer.
@@ -4171,7 +4200,7 @@ method steps are:
Let nodes be the inclusive ancestors of target.
For each node in nodes, and then for each
+ For each node of nodes, and then for each
registered of node's registered observer list:
While currentNode is an exclusive For each live range whose start node is currentNode,
+ For each live range whose start node is currentNode:
add length to its start offset and set its
start node to node.
- For each live range whose end node is currentNode, add
+ For each live range whose end node is currentNode: add
length to its end offset and set its end node to
node.
For each live range whose start node is currentNode's
parent and start offset is currentNode's
- index, set its start node to node and its
+ index: set its start node to node and its
start offset to length.
For each live range whose end node is currentNode's
parent and end offset is currentNode's
- index, set its end node to node and its
+ index: set its end node to node and its
end offset to length.
Add currentNode's length to length.
@@ -7762,7 +7791,7 @@ return this's custom element registry.
Let elements be this's inclusive ancestors that are
elements, in reverse tree order.
- For each element in elements, if
+ For each element of elements: if
match a selector against an element, using s, element, and
scoping root this, returns success, return element. [[!SELECTORS4]]
@@ -9135,7 +9164,7 @@ method steps are:
original start offset, count original start node's length
− original start offset, data the empty string.
- For each node in nodes to remove, in tree order,
+ For each node of nodes to remove, in tree order:
remove node.
If original end node is a {{CharacterData}} node, then
@@ -9339,9 +9368,8 @@ method steps are:
clone.
For each contained child of contained children: append
+ contained child to fragment.
If last partially contained child is a {{CharacterData}} node:
@@ -9547,15 +9575,13 @@ of a live range range, run these steps:
For each contained child of contained children:
Run the update steps.
@@ -10660,7 +10686,7 @@ method steps are:
"{{InvalidCharacterError!!exception}}" {{DOMException}}.
For each token in tokens, remove token from
+ For each token of tokens: remove token from
this's token set.
Run the update steps.
-
-
@@ -2948,7 +2959,7 @@ before a child, with an optional suppress observers flag, run
+
@@ -3030,7 +3051,7 @@ to do these things asynchronously, however.
+NodeIterator pre-remove steps given
+ node document: run the NodeIterator pre-remove steps given
node and iterator.
@@ -3115,14 +3136,13 @@ to do these things asynchronously, however.
-
-
+NodeIterator pre-remove steps given
+ node document: run the NodeIterator pre-remove steps given
node and iterator.
Mixin {{NonElementParentNode}}
@@ -3926,7 +3955,7 @@ run these steps:
report", and with callback this value mo.
-
-
-
@@ -4764,22 +4793,22 @@ each descendant exclusive
Text node nod
Text node:
-
-