From 5920e1cc0dbc0bb50d1f3a47993d3b05e79d4b1a Mon Sep 17 00:00:00 2001
From: Dominic Farolino The The Let perform state-preserving atomic move be true if this is
+ connected, node is connected, this's node
+ document is fully active, and this's root is the same as
+ node's root. If perform state-preserving atomic move is true, then set this's node document's state-preserving atomic move in progress to true. Let oldFlag be the value of this's node document's fire
+ mutation events flag. Set this's node document's fire mutation events flag to
+ false. Let return node be the result of pre-inserting node into
+ this before child. Set this's node document's fire mutation events flag to
+ oldFlag. Set this's node document's state-preserving atomic move in
+ progress to false. Return return node. The
From 442ef6dfd577806f89f16612473e5f30357d96ef Mon Sep 17 00:00:00 2001
From: Dominic Farolino Let nodes be node's children, if node is a
{{DocumentFragment}} node; otherwise « node ».
+ Let state-preserving atomic move in progress be parent's
+ node document state-preserving atomic move in progress.
+
Let count be nodes's size.
If count is 0, then return.
@@ -2773,12 +2776,14 @@ before a child, with an optional suppress observers flag, run
If node is a {{DocumentFragment}} node:
Assert: state-preserving atomic move in progress is false.
+
Queue a tree mutation record for node with « », nodes, null, and
- null.
+ Queue a tree mutation record for node with « », nodes, « »,
+ null, and null.
This step intentionally does not pay attention to the
suppress observers flag.
@@ -2850,8 +2855,24 @@ before a child, with an optional suppress observers flag, run
If suppress observers flag is unset, then queue a tree mutation record for
- parent with nodes, « », previousSibling, and child.
+ If suppress observers flag is unset, then:
+
+ If state-preserving atomic move in progress, then
+ queue a tree mutation record for parent with « », « », nodes,
+ previousSibling, and child. This exposes nodes in the corresponding
+ {{MutationRecord/movedNodes}}. If state-preserving atomic move in progress, then
+ queue a tree mutation record for parent with nodes, « », « »,
+ previousSibling, and child. Run the children changed steps for parent.
@@ -2965,7 +2986,7 @@ within a parent, run these steps:
with the suppress observers flag set.
Queue a tree mutation record for parent with nodes,
- removedNodes, previousSibling, and referenceChild.
+ removedNodes, « », previousSibling, and referenceChild.
Return child.
@@ -2992,7 +3013,7 @@ within a parent, run these steps:
If either addedNodes or removedNodes is not empty,
then queue a tree mutation record for parent with addedNodes,
- removedNodes, null, and null.
+ removedNodes, « », null, and null.
This algorithm does not make any checks with regards to the
@@ -3108,7 +3129,7 @@ optional suppress observers flag, run these steps:
registered observer list.
If suppress observers flag is unset, then queue a tree mutation record for
- parent with « », « node », oldPreviousSibling, and
+ parent with « », « node », « », oldPreviousSibling, and
oldNextSibling.
Run the children changed steps for parent.
@@ -3896,9 +3917,14 @@ method steps are:
To queue a mutation record of type for target with
name, namespace, oldValue, addedNodes,
-removedNodes, previousSibling, and nextSibling, run these steps:
+removedNodes, movedNodes, previousSibling, and
+nextSibling, run these steps:
Let interestedObservers be an empty map.
@@ -3958,6 +3984,7 @@ method steps are:
interestedObservers:
Let record be a new {{MutationRecord}} object with its {{MutationRecord/type}}
set to type, {{MutationRecord/target}} set to target,
{{MutationRecord/attributeName}} set to name, {{MutationRecord/attributeNamespace}}
@@ -3978,15 +4005,28 @@ method steps are:
To queue a tree mutation record for target with
-addedNodes, removedNodes, previousSibling, and
-nextSibling, run these steps:
+addedNodes, removedNodes, movedNodes, previousSibling,
+and nextSibling, run these steps:
Assert: either addedNodes or removedNodes is not empty.
+ Assert: one of the following conditions is true: target's node document's
+ state-preserving atomic move in progresss false, and either addedNodes or
+ removedNodes is not empty; or target's node document's
+ state-preserving atomic move in progresss true, and both addedNodes and
+ removedNodes are empty, and movedNodes
+ is not empty; or Queue a mutation record of " The type, target,
addedNodes,
removedNodes,
+movedNodes,
previousSibling,
nextSibling,
attributeName,
@@ -5662,7 +5708,8 @@ these steps:
Let oldDocument be node's node document.
If node's parent is non-null, then remove
- node.
+ node with the suppress observers flag set if document's
+ state-preserving atomic move in progress is true, and unset otherwise.
If document is not oldDocument:
@@ -6551,7 +6598,7 @@ null), and boolean synchronousCustomElements (default false):
Queue a mutation record of " If element is custom, then
enqueue a custom element callback reaction with element, callback name
@@ -7603,7 +7650,7 @@ string called data.
count to length minus offset.
Queue a mutation record of " If perform state-preserving atomic move is true, then set this's node document's state-preserving atomic move in progress to true. Let oldFlag be the value of this's node document's fire
- mutation events flag. Set this's node document's fire mutation events flag to
- false. Let return node be the result of pre-inserting node into
this before child. Set this's node document's fire mutation events flag to
- oldFlag. Set this's node document's state-preserving atomic move in
- progress to false. Set this's node document's
+ state-preserving atomic move in progress to false. Return return node. Let record be a new {{MutationRecord}} object with its {{MutationRecord/type}}
set to type, {{MutationRecord/target}} set to target,
{{MutationRecord/attributeName}} set to name, {{MutationRecord/attributeNamespace}}
set to namespace, {{MutationRecord/oldValue}} set to mappedOldValue,
{{MutationRecord/addedNodes}} set to addedNodes,
- {{MutationRecord/removedNodes}} set to removedNodes,
- {{MutationRecord/previousSibling}} set to previousSibling, and
- {{MutationRecord/nextSibling}} set to nextSibling.
+ {{MutationRecord/removedNodes}} set to removedNodes, {{MutationRecord/movedNodes}} set
+ to movedNodes, {{MutationRecord/previousSibling}} set to previousSibling,
+ and {{MutationRecord/nextSibling}} set to nextSibling.
Enqueue record to observer's
record queue.
From 4030e9abd907e4b26b69c26a90c3f3df8795d9c5 Mon Sep 17 00:00:00 2001
From: Dominic Farolino target's node document's
state-preserving atomic move in progresss true, and both addedNodes and
removedNodes are empty, and movedNodes
- is not empty; or Queue a mutation record of " Assert: one of the following conditions is true: target's node document's
state-preserving atomic move in progresss false, and either addedNodes or
From 588e62d360a26763606fa8aac813d5d27832bb22 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Let state-preserving atomic move in progress be parent's
- node document state-preserving atomic move in progress.
+ node document's state-preserving atomic move in progress.
Let count be nodes's size.
@@ -4013,11 +4013,11 @@ and nextSibling, run these steps:
target's node document's
- state-preserving atomic move in progresss false, and either addedNodes or
+ state-preserving atomic move in progress is false, and either addedNodes or
removedNodes is not empty; or target's node document's
- state-preserving atomic move in progresss true, and both addedNodes and
+ state-preserving atomic move in progresss true, and both addedNodes and
removedNodes are empty, and movedNodes
is not empty Let nodes be node's children, if node is a
{{DocumentFragment}} node; otherwise « node ».
- Let state-preserving atomic move in progress be parent's
+ Let statePreservingAtomicMoveInProgress be parent's
node document's state-preserving atomic move in progress.
Let count be nodes's size.
@@ -2776,7 +2776,7 @@ before a child, with an optional suppress observers flag, run
If node is a {{DocumentFragment}} node:
Assert: state-preserving atomic move in progress is false.
+ Assert: statePreservingAtomicMoveInProgress is false.
Remove its children with the suppress observers flag
set.
@@ -2860,15 +2860,15 @@ before a child, with an optional suppress observers flag, run
If state-preserving atomic move in progress, then
- queue a tree mutation record for parent with « », « », nodes,
- previousSibling, and child. If statePreservingAtomicMoveInProgress, then queue a tree mutation record
+ for parent with « », « », nodes, previousSibling, and
+ child. This exposes nodes in the corresponding
{{MutationRecord/movedNodes}}. If state-preserving atomic move in progress, then
+ If statePreservingAtomicMoveInProgress, then
queue a tree mutation record for parent with nodes, « », « »,
previousSibling, and child. Let perform state-preserving atomic move be true if this is
- connected, node is connected, this's node
- document is fully active, and this's root is the same as
- node's root. If any of the following conditions are false: If perform state-preserving atomic move is true, then set this's node document's state-preserving atomic move in progress to true. node is connected; this's node document is fully active; or then throw "{{HierarchyRequestError!!exception}}" {{DOMException}}. Set this's node document's
+ state-preserving atomic move in progress to true. Let return node be the result of pre-inserting node into
this before child. To pre-move a node into a
+parent before a child, run these steps:
+
+ Ensure pre-insertion validity of node into parent before
+ child.
+
+ Let referenceChild be child.
+
+ If referenceChild is node, then set referenceChild to
+ node's next sibling.
+
+ Move node into parent before referenceChild.
+
+ Return node.
+ Specifications may define
insertion steps for all or some nodes. The
algorithm is passed insertedNode, as indicated in the insert algorithm
@@ -2902,6 +2920,114 @@ before a child, with an optional suppress observers flag, run
Specifications may define moving steps for all or some nodes. The algorithm is
+passed a node movedNode, and a node-or-null oldParent as indicated in the move algorithm below.
+
+ To move a node into a parent before
+a child, with an optional suppress observers flag, run these steps:
+
+ Let statePreservingAtomicMoveInProgress be node's
+ node document's state-preserving atomic move in progress.
+
+ Let oldParent be node's parent.
+
+ Assert: parent is non-null.
+
+ If child is non-null, then:
+
+ For each live range whose start node is parent and
+ 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
+ its end offset by count.
+ Let previousSibling be child's previous sibling or
+ parent's last child if child is null.
+
+ Remove node with the suppress observers flag set if
+ document's state-preserving atomic move in progress is true, and unset otherwise.
+
+ If child is null, then append node to
+ parent's children.
+
+ Otherwise, insert node into parent's
+ children before child's index.
+
+ If parent is a shadow host whose shadow root's
+ slot assignment is " If parent's root is a shadow root, and
+ parent is a slot whose assigned nodes is the empty list,
+ then run signal a slot change for parent.
+
+ Run assign slottables for a tree with node's root.
+
+ For each shadow-including inclusive descendant inclusiveDescendant of
+ node, in shadow-including tree order:
+
+ If inclusiveDescendant is node, then run the moving steps with
+ inclusiveDescendant and oldParent. Otherwise, run the moving steps
+ with inclusiveDescendant and null.
+
+ Because the move algorithm is a separate primitive from
+ insert and remove, it does not invoke the traditional
+ insertion steps or removing steps for inclusiveDescendant.
+ If inclusiveDescendant is custom, then
+ enqueue a custom element callback reaction with inclusiveDescendant, callback
+ name " TODO(Noam): Do the right custom element callback stuff here. Otherwise, try to upgrade
+ inclusiveDescendant.
+
+ If this successfully upgrades inclusiveDescendant, its
+ If suppress observers flag is unset, then:
+
+ If statePreservingAtomicMoveInProgress, then queue a tree mutation record
+ for parent with « », « », nodes, previousSibling, and
+ child. This exposes nodes in the corresponding
+ {{MutationRecord/movedNodes}}. If statePreservingAtomicMoveInProgress, then
+ queue a tree mutation record for parent with nodes, « », « »,
+ previousSibling, and child. Run the children changed steps for parent.
+ To append a node to a parent,
pre-insert node into parent before null.
@@ -3919,7 +4045,7 @@ method steps are:
-state-preserving atomic move in progress
+state-preserving atomic move in progress
To queue a mutation record of type for target with
name, namespace, oldValue, addedNodes,
@@ -5095,9 +5221,8 @@ method steps are:
node is connected; this's node document is fully active; or this's shadow-including root is the same as node's
+ shadow-including root, then throw "{{HierarchyRequestError!!exception}}" {{DOMException}}. Set this's node document's
state-preserving atomic move in progress to true. Let return node be the result of pre-inserting node into
+ Let return node be the result of pre-moving node into
this before child. Set this's node document's
From b17f357fe121466dfe8e9f456fe243a3f31a57ab Mon Sep 17 00:00:00 2001
From: Dominic Farolino Let nodes be node's children, if node is a
{{DocumentFragment}} node; otherwise « node ».
- Let statePreservingAtomicMoveInProgress be parent's
- node document's state-preserving atomic move in progress.
-
Let count be nodes's size.
If count is 0, then return.
@@ -2794,8 +2791,6 @@ before a child, with an optional suppress observers flag, run
If node is a {{DocumentFragment}} node:
If suppress observers flag is unset, then:
-
- If statePreservingAtomicMoveInProgress, then queue a tree mutation record
- for parent with « », « », nodes, previousSibling, and
- child. This exposes nodes in the corresponding
- {{MutationRecord/movedNodes}}. If statePreservingAtomicMoveInProgress, then
- queue a tree mutation record for parent with nodes, « », « »,
- previousSibling, and child. If suppress observers flag is unset, then queue a tree mutation record for
+ parent with nodes, « », previousSibling, and child.
Run the children changed steps for parent.
From ef2f986e1d40fb4c39ebc20759c19887d366c5d2 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Queue a tree mutation record for node with « », nodes, « »,
- null, and null.
+ Queue a tree mutation record for node with « », nodes, null,
+ and null.
This step intentionally does not pay attention to the
suppress observers flag.
@@ -2908,9 +2908,6 @@ ignore>oldParent as indicated in the move algorithm below.
a child, with an optional suppress observers flag, run these steps:
Let statePreservingAtomicMoveInProgress be node's
- node document's state-preserving atomic move in progress.
-
Let oldParent be node's parent.
Assert: parent is non-null.
@@ -2931,8 +2928,7 @@ a child, with an optional suppress observers flag, run these s
Let previousSibling be child's previous sibling or
parent's last child if child is null.
- Remove node with the suppress observers flag set if
- document's state-preserving atomic move in progress is true, and unset otherwise.
+ Remove node with the suppress observers flag set.
If child is null, then append node to
parent's children.
@@ -2988,17 +2984,10 @@ a child, with an optional suppress observers flag, run these s
If suppress observers flag is unset, then:
If statePreservingAtomicMoveInProgress, then queue a tree mutation record
- for parent with « », « », nodes, previousSibling, and
- child. This exposes nodes in the corresponding
- {{MutationRecord/movedNodes}}. Queue a tree mutation record for parent with « », nodes,
+ previousSibling, and child. If statePreservingAtomicMoveInProgress, then
- queue a tree mutation record for parent with nodes, « », « »,
+ Queue a tree mutation record for parent with nodes,
- removedNodes, « », previousSibling, and referenceChild.
+ removedNodes, previousSibling, and referenceChild.
Return child.
If either addedNodes or removedNodes is not empty,
then queue a tree mutation record for parent with addedNodes,
- removedNodes, « », null, and null.
+ removedNodes, null, and null.
This algorithm does not make any checks with regards to the
@@ -3234,7 +3223,7 @@ optional suppress observers flag, run these steps:
registered observer list.
If suppress observers flag is unset, then queue a tree mutation record for
- parent with « », « node », « », oldPreviousSibling, and
+ parent with « », « node », oldPreviousSibling, and
oldNextSibling.
Run the children changed steps for parent.
@@ -4022,14 +4011,9 @@ method steps are:
To queue a mutation record of type for target with
name, namespace, oldValue, addedNodes,
-removedNodes, movedNodes, previousSibling, and
-nextSibling, run these steps:
+removedNodes, previousSibling, and nextSibling, run these steps:
Let interestedObservers be an empty map.
@@ -4094,9 +4078,9 @@ term actually appears in HTML -->
{{MutationRecord/attributeName}} set to name, {{MutationRecord/attributeNamespace}}
set to namespace, {{MutationRecord/oldValue}} set to mappedOldValue,
{{MutationRecord/addedNodes}} set to addedNodes,
- {{MutationRecord/removedNodes}} set to removedNodes, {{MutationRecord/movedNodes}} set
- to movedNodes, {{MutationRecord/previousSibling}} set to previousSibling,
- and {{MutationRecord/nextSibling}} set to nextSibling.
+ {{MutationRecord/removedNodes}} set to removedNodes,
+ {{MutationRecord/previousSibling}} set to previousSibling, and
+ {{MutationRecord/nextSibling}} set to nextSibling.
Enqueue record to observer's
record queue.
@@ -4109,28 +4093,15 @@ term actually appears in HTML -->
To queue a tree mutation record for target with
-addedNodes, removedNodes, movedNodes, previousSibling,
-and nextSibling, run these steps:
+addedNodes, removedNodes, previousSibling, and
+nextSibling, run these steps:
Assert: one of the following conditions is true: target's node document's
- state-preserving atomic move in progress is false, and either addedNodes or
- removedNodes is not empty; or target's node document's
- state-preserving atomic move in progresss true, and both addedNodes and
- removedNodes are empty, and movedNodes
- is not empty Assert: either addedNodes or removedNodes is not empty.
Queue a mutation record of " The type, target,
addedNodes,
removedNodes,
-movedNodes,
previousSibling,
nextSibling,
attributeName,
@@ -5206,15 +5171,9 @@ method steps are:
then throw "{{HierarchyRequestError!!exception}}" {{DOMException}}. Set this's node document's
- state-preserving atomic move in progress to true. Let return node be the result of pre-moving node into
this before child. Set this's node document's
- state-preserving atomic move in progress to false. Return return node. Let oldDocument be node's node document.
If node's parent is non-null, then remove
- node with the suppress observers flag set if document's
- state-preserving atomic move in progress is true, and unset otherwise.
+ node.
If document is not oldDocument:
From 0a813821033b0d72ae370a7e3e31787e471fab86 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Queue a mutation record of " If element is custom, then
enqueue a custom element callback reaction with element, callback name
@@ -7711,7 +7711,7 @@ string called data.
count to length minus offset.
Queue a mutation record of " Queue a tree mutation record for node with « », nodes, null,
- and null.
+ Queue a tree mutation record for node with « », nodes, null, and
+ null.
This step intentionally does not pay attention to the
suppress observers flag.
From 11010731a7eb0ce9f1f1d36faab65f6ae63de1f4 Mon Sep 17 00:00:00 2001
From: Dominic Farolino To move a node into a parent before
-a child, with an optional suppress observers flag, run these steps:
+a child, run these steps:
Let oldParent be node's parent.
@@ -2980,17 +2980,11 @@ a child, with an optional suppress observers flag, run these s
If suppress observers flag is unset, then:
-
- Queue a tree mutation record for parent with « », nodes,
- previousSibling, and child. Queue a tree mutation record for parent with « », nodes,
+ previousSibling, and child. Run the children changed steps for parent.
From b43c8fc0e62963badde58fc5ce50c8fa1f66a2fd Mon Sep 17 00:00:00 2001
From: Dominic Farolino If inclusiveDescendant is custom, then
- enqueue a custom element callback reaction with inclusiveDescendant, callback
- name " TODO(Noam): Do the right custom element callback stuff here. If inclusiveDescendant is custom, then
+ enqueue a custom element callback reaction with inclusiveDescendant, callback
+ name " Otherwise, try to upgrade
From ba0638d138fb02a9f77799de1c5d420e2c3378e5 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Assert: parent is non-null.
+ Let index be node's index.
+
+
+ For each live range whose start node is an
+ inclusive descendant of node, set its start to
+ (parent, index).
+
+ For each live range whose end node is an inclusive descendant
+ of node, set its end to (parent, index).
+
+ For each live range whose start node is parent and
+ start offset is greater than index, decrease its
+ start offset by 1.
+
+ For each live range whose end node is parent and
+ end offset is greater than index, decrease its
+ end offset by 1.
+
+ For each {{NodeIterator}} object iterator whose
+ root's node document is node's
+ node document, run the Let oldPreviousSibling be node's previous sibling.
+
+ Let oldNextSibling be node's next sibling.
+
+ If child is non-null, then:
@@ -2928,8 +2958,6 @@ a child, run these steps:
Let previousSibling be child's previous sibling or
parent's last child if child is null.
- Remove node with the suppress observers flag set.
-
If child is null, then append node to
parent's children.
@@ -2977,12 +3005,17 @@ a child, run these steps:
Queue a tree mutation record for parent with « », nodes,
- previousSibling, and child.removeChild(child) method steps are to
return the result of pre-removing child from this.
+moveBefore(node, child)
+method steps are:
+
+
+
+
+
-
+
+ Queuing a mutation record
+
+state-preserving atomic move in progress
+
+
-
@@ -3999,6 +4039,7 @@ interface MutationRecord {
[SameObject] readonly attribute Node target;
[SameObject] readonly attribute NodeList addedNodes;
[SameObject] readonly attribute NodeList removedNodes;
+ [SameObject] readonly attribute NodeList movedNodes;
readonly attribute Node? previousSibling;
readonly attribute Node? nextSibling;
readonly attribute DOMString? attributeName;
@@ -4033,6 +4074,10 @@ interface MutationRecord {
+
+ childList" for target with
- null, null, null, addedNodes, removedNodes, previousSibling,
- and nextSibling.
+ null, null, null, addedNodes, removedNodes, movedNodes,
+ previousSibling, and nextSibling.
record . {{MutationRecord/movedNodes}}
+ record . {{MutationRecord/previousSibling}}
record . {{MutationRecord/nextSibling}}
From bc1a4665916f8293a42b94fb392e9f3a2bf55bd4 Mon Sep 17 00:00:00 2001
From: Dominic Farolino attributes" for element with
attribute's local name, attribute's
- namespace, oldValue, « », « », null, and null.
+ namespace, oldValue, « », « », « », null, and null.
characterData" for node with
- null, null, node's data, « », « », null, and null.
+ null, null, node's data, « », « », « », null, and null.
-
- childList" for target with
null, null, null, addedNodes, removedNodes, movedNodes,
From 8d41e6a968801b21fbe648f0eabfe66c7eb6fc21 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
@@ -3118,7 +3107,7 @@ within a parent, run these steps:
From 2b8cf634fa44315534807fe87a360af330559586 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
-
+
From 7b742c7a24b9a3e2ff46839d0d049957de6d4f98 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
-
+
+
+
+
+
+
+
+
+
+
+
+
+ named" and node is a
+ slottable, then assign a slot for node.
+
+
+
+ connectedCallback", and an empty argument list.
+
+ connectedCallback will be enqueued automatically during the
+ upgrade an element algorithm.
+
+
+
-
-
-
-
Queuing a mutation record
-
-state-preserving atomic move in progress
-
-
@@ -4143,7 +4114,6 @@ interface MutationRecord {
[SameObject] readonly attribute Node target;
[SameObject] readonly attribute NodeList addedNodes;
[SameObject] readonly attribute NodeList removedNodes;
- [SameObject] readonly attribute NodeList movedNodes;
readonly attribute Node? previousSibling;
readonly attribute Node? nextSibling;
readonly attribute DOMString? attributeName;
@@ -4178,10 +4148,6 @@ interface MutationRecord {
-
- childList" for target with
- null, null, null, addedNodes, removedNodes, movedNodes,
- previousSibling, and nextSibling.
+ null, null, null, addedNodes, removedNodes, previousSibling, and
+ nextSibling.
record . {{MutationRecord/movedNodes}}
- record . {{MutationRecord/previousSibling}}
record . {{MutationRecord/nextSibling}}
attributes" for element with
attribute's local name, attribute's
- namespace, oldValue, « », « », « », null, and null.
+ namespace, oldValue, « », « », null, and null.
characterData" for node with
- null, null, node's data, « », « », « », null, and null.
+ null, null, node's data, « », « », null, and null.
-
connectedCallback", and an empty argument list.
-
- connectedMoveCallback", and an empty argument list.
NodeIterator pre-removing steps given
+ node and iterator.
+
+
Run the children changed steps for parent. +
Run the children changed steps for parent.
+ +TODO(domfarolino): Before merging, do a full audit on children changed steps, and + write tests.
+Let oldParent be node's parent. -
Assert: parent is non-null. +
Assert: oldParent is non-null.
Let index be node's index. -
For each live range whose start node is an inclusive descendant of node, set its start to (parent, index). @@ -2939,7 +2939,7 @@ a child, run these steps:
Let oldNextSibling be node's next sibling. -
Specifications may define moving steps for all or some nodes. The algorithm is passed a node movedNode, and a node-or-null oldParent as indicated in the move algorithm below. +ignore>oldParent as indicated in the move algorithm below. Like the insertion steps, 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 tasks to do these things asynchronously, however. +
To move a node into a parent before
a child, run these steps:
From a94082745677b0e193b98852106f9facaa616a23 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
To ensure pre-move validity +of a node into a parent before a child, run these steps: + +
Assert: node is either an {{Element}} or {{CharacterData}}.
If parent is not an {{Element}} node, then throw a + "{{HierarchyRequestError!!exception}}" {{DOMException}}. + +
If node is a host-including inclusive ancestor of parent, then + throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. + +
If child is non-null and its parent is not parent, + then throw a "{{NotFoundError!!exception}}" {{DOMException}}. +
The ensure pre-move validity steps are a similar, but slightly stricter version +of the ensure pre-insertion validity steps.
+To pre-move a node into a parent before a child, run these steps:
Ensure pre-insertion validity of node into parent before +
Ensure pre-move validity of node into parent before child.
Let referenceChild be child.
From 8ded562056c849b7142c5906e468211e3f0a402e Mon Sep 17 00:00:00 2001
From: Dominic Farolino Assert: node is either an {{Element}} or {{CharacterData}}. If node is not an {{Element}} or a {{CharacterData}} node, then
+ throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. If parent is not an {{Element}} node, then throw a
"{{HierarchyRequestError!!exception}}" {{DOMException}}.
From dbbde9e28713a45617a32e494bac88de8624d125 Mon Sep 17 00:00:00 2001
From: Dominic Farolino To ensure pre-move validity
of a node into a parent before a child, run these steps:
- If either parent or node are not connected, then
+ throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. If parent's shadow-including root is not the same as
+ node's shadow-including root, then throw a
+ "{{HierarchyRequestError!!exception}}" {{DOMException}}. If node is not an {{Element}} or a {{CharacterData}} node, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. If any of the following conditions are false: node is connected; this's shadow-including root is the same as node's
- shadow-including root, then throw "{{HierarchyRequestError!!exception}}" {{DOMException}}. Let return node be the result of pre-moving node into
- this before child. Return return node. To ensure pre-move validity
of a node into a parent before a child, run these steps:
+ If either parent or node are not connected, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
-
From e28936a190a6e89d8225d3f89d8cbd4ffe8a2fde Mon Sep 17 00:00:00 2001
From: Dominic Farolino
+
-
-
-
-
If node is not an {{Element}} or a {{CharacterData}} node, then - throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If parent is not an {{Element}} node, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If node is a host-including inclusive ancestor of parent, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. +
If node is not an {{Element}} or a {{CharacterData}} node, then + throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If child is non-null and its parent is not parent, then throw a "{{NotFoundError!!exception}}" {{DOMException}}.
Let index be node's index. -
For each live range whose start node is an - inclusive descendant of node, set its start to - (parent, index). - -
For each live range whose end node is an inclusive descendant - of node, set its end to (parent, index). - -
For each live range whose start node is parent and - start offset is greater than index, decrease its - start offset by 1. +
For each live range whose start node is parent and + start offset is greater than index, decrease its + start offset by 1.
+ +Note that unlike the traditional removal case, we do not + need to update live range state when their start node or + end node is an inclusive descendant of the node. This is + because said nodes do not get removed from their tree, so ranges associated with + them stay intact.
+For each live range whose end node is parent and end offset is greater than index, decrease its @@ -3040,13 +3041,6 @@ a child, run these steps:
Run the children changed steps for parent.
- -TODO(domfarolino): Before merging, do a full audit on children changed steps, and - write tests.
-Algorithms that modify a tree (in particular the insert, -remove, replace data, and split algorithms) modify -live ranges associated with that tree. +remove, move, replace data, and split +algorithms) modify live ranges associated with that tree.
The root of a live range is the
root of its start node.
From 707f3f62b9d646f29e15d4695142cff135c9f593 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
If parent is not an {{Element}} node, then throw a - "{{HierarchyRequestError!!exception}}" {{DOMException}}. +
If parent is not an {{Element}} or {{DocumentFragment}} node, then + throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If node is a host-including inclusive ancestor of parent, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
From 863f481ddd88768c055441e60f79cb0cd825d5d4 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Let return node be the result of pre-moving node into
- this before child, rethrowing any exceptions.
Return return node.
Let index be node's index. -
For each live range whose start node is parent and - start offset is greater than index, decrease its - start offset by 1.
- -Note that unlike the traditional removal case, we do not - need to update live range state when their start node or - end node is an inclusive descendant of the node. This is - because said nodes do not get removed from their tree, so ranges associated with - them stay intact.
-For each live range whose start node is an + inclusive descendant of node, set its start to + (parent, index). + +
For each live range whose end node is an inclusive descendant + of node, set its end to (parent, index). + +
For each live range whose start node is parent and + start offset is greater than index, decrease its + start offset by 1.
For each live range whose end node is parent and
end offset is greater than index, decrease its
From f2ad3dfceabea07ad220c9c0783b0bfc1179cc0f Mon Sep 17 00:00:00 2001
From: Dominic Farolino If either parent or node are not connected, then
- throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. If any of the following conditions are true then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
+
+ Moving a node around in a DOM tree requires both it and its eventual parent
+ to both be connected, or both be disconnected. Otherwise, state preservation cannot be
+ guaranteed during the move operation. If parent's shadow-including root is not the same as
node's shadow-including root, then throw a
From 6fe0a6e86b56e7c4b1d742de0cccd046fc9078e2 Mon Sep 17 00:00:00 2001
From: Dominic Farolino If any of the following conditions are true Assert: oldParent is non-null.
- Let index be node's index.
-
- For each live range whose start node is an
- inclusive descendant of node, set its start to
- (parent, index).
-
- For each live range whose end node is an inclusive descendant
- of node, set its end to (parent, index).
-
- For each live range whose start node is parent and
- start offset is greater than index, decrease its
- start offset by 1.
-
- For each live range whose end node is parent and
- end offset is greater than index, decrease its
- end offset by 1.
+ Run the live range pre-removing steps, given node.
For each {{NodeIterator}} object iterator whose
root's node document is node's
@@ -3202,22 +3187,7 @@ optional suppress observers flag, run these steps:
Assert: parent is non-null.
- Let index be node's index.
-
- For each live range whose start node is an
- inclusive descendant of node, set its start to
- (parent, index).
-
- For each live range whose end node is an inclusive descendant
- of node, set its end to (parent, index).
-
- For each live range whose start node is parent and
- start offset is greater than index, decrease its
- start offset by 1.
-
- For each live range whose end node is parent and
- end offset is greater than index, decrease its
- end offset by 1.
+ Run the live range pre-removing steps, given node.
For each {{NodeIterator}} object iterator whose
root's node document is node's
@@ -8408,6 +8378,31 @@ but not its end node, or vice versa.
+ The live range pre-removing steps given a node node, are as follows:
+
+ Let parent be node's parent.
+
+ Assert: parent is not null.
+
+ Let index be node's index.
+
+ For each live range whose start node is an
+ inclusive descendant of node, set its start to
+ (parent, index).
+
+ For each live range whose end node is an inclusive descendant
+ of node, set its end to (parent, index).
+
+ For each live range whose start node is parent and
+ start offset is greater than index, decrease its
+ start offset by 1.
+
+ For each live range whose end node is parent and
+ end offset is greater than index, decrease its
+ end offset by 1.
+ To move a node into a parent before
-a child, run these steps:
+ To move a node into a newParent
+before a child, run these steps:
If child is non-null, then:
For each live range whose start node is parent and
+ For each live range whose start node is newParent and
start offset is greater than child's index, increase
- its start offset by count.
+ its start offset by 1.
- For each live range whose end node is parent and
+ For each live range whose end node is newParent and
end offset is greater than child's index, increase
- its end offset by count.
+ its end offset by 1.
Let previousSibling be child's previous sibling or
- parent's last child if child is null.
+ Let newPreviousSibling be child's previous sibling if
+ child is non-null, and newParent's last child otherwise.
If child is null, then append node to
- parent's children.
+ newParent's children.
- Otherwise, insert node into parent's
+ Otherwise, insert node into newParent's
children before child's index.
- If parent is a shadow host whose shadow root's
+ If newParent is a shadow host whose shadow root's
slot assignment is " If parent's root is a shadow root, and
- parent is a slot whose assigned nodes is the empty list,
- then run signal a slot change for parent.
+ If newParent's root is a shadow root, and
+ newParent is a slot whose assigned nodes is the empty list,
+ then run signal a slot change for newParent.
Run assign slottables for a tree with node's root.
@@ -3033,11 +3033,11 @@ a child, run these steps:
Queue a tree mutation record for parent with « », nodes,
+ Queue a tree mutation record for oldParent with « », « node »,
oldPreviousSibling, and oldNextSibling.
-
+
+
+
+
+
From 2a623d53b02bd4bdd0fbead008e15196171225df Mon Sep 17 00:00:00 2001
From: Dominic Farolino
@@ -2975,31 +2975,31 @@ a child, run these steps:
-
- named" and node is a
slottable, then assign a slot for node.
-
If inclusiveDescendant is custom, then
- enqueue a custom element callback reaction with inclusiveDescendant, callback
- name "connectedMoveCallback", and an empty argument list.
+
If inclusiveDescendant is custom and newParent is
+ connected, then enqueue a custom element callback reaction with
+ inclusiveDescendant, callback name "connectedMoveCallback", and an empty
+ argument list.
Otherwise, try to upgrade
From f23c4982e6eba4788a969af586382b690091d347 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Assert: either addedNodes or removedNodes is not empty.
Queue a mutation record of " If inclusiveDescendant is custom and newParent is
+ If inclusiveDescendant is custom and newParent is
connected, then enqueue a custom element callback reaction with
inclusiveDescendant, callback name " Otherwise, try to upgrade
- inclusiveDescendant.
-
- If this successfully upgrades inclusiveDescendant, its
- childList" for target with
- null, null, null, addedNodes, removedNodes, previousSibling, and
- nextSibling.
+ null, null, null, addedNodes, removedNodes, previousSibling,
+ and nextSibling.
From 21d0da39805c668635df4b00ed7395d7963009ab Mon Sep 17 00:00:00 2001
From: Dominic Farolino connectedMoveCallback", and an empty
argument list.
-
- connectedCallback will be enqueued automatically during the
- upgrade an element algorithm.
-
If parent's shadow-including root is not the same as - node's shadow-including root, then throw a - "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If parent's node document is not the same as node's + node document, then throw a "{{HierarchyRequestError!!exception}}" + {{DOMException}}.
If parent is not an {{Element}} or {{DocumentFragment}} node, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
From cb0c91cf2f0172eeb965d7623de34f45db1c4321 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
If parent is not an {{Element}} or {{DocumentFragment}} node, then - throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. +
If parent is not a {{Document}}, {{DocumentFragment}}, or {{Element}} + node, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If node is a host-including inclusive ancestor of parent, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
From ca88e231a79016cda4a3639356d45d3136e80bbf Mon Sep 17 00:00:00 2001
From: Dominic Farolino If node is a host-including inclusive ancestor of parent, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
+ If child is non-null and its parent is not parent,
+ then throw a "{{NotFoundError!!exception}}" {{DOMException}}.
+
If node is not an {{Element}} or a {{CharacterData}} node, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. If child is non-null and its parent is not parent,
- then throw a "{{NotFoundError!!exception}}" {{DOMException}}.
+ If node is a {{Text}} node and parent is a
+ document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
+
+ If parent is a {{Document}}, node is an {{Element}}
+ node, and either parent has an element child,
+ child is a doctype, or child is non-null and a doctype is
+ following child then throw a "{{HierarchyRequestError!!exception}}"
+ {{DOMException}}.
The ensure pre-move validity steps are a similar, but slightly stricter version
From 358cc4301ecddcd831da8fd1ea3eccbaaa135ab2 Mon Sep 17 00:00:00 2001
From: Dominic Farolino If any of the following conditions are true If parent's shadow-including root is not the same as node's
+ shadow-including root, then throw a "{{HierarchyRequestError!!exception}}"
+ {{DOMException}}. then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
-
- Moving a node around in a DOM tree requires both it and its eventual parent
- to both be connected, or both be disconnected. Otherwise, state preservation cannot be
- guaranteed during the move operation. This has the side effect of ensuring that a move is only performed if
+ parent's connected status matches node's connected status. If parent's node document is not the same as node's
- node document, then throw a "{{HierarchyRequestError!!exception}}"
- {{DOMException}}. If parent is not a {{Document}}, {{DocumentFragment}}, or {{Element}}
node, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
From 90d4f4514aaa60c303266bce3b603ed3511666ca Mon Sep 17 00:00:00 2001
From: Dominic Farolino Assert: oldParent is non-null.
- Run the live range pre-removing steps, given node.
+ Run the live range pre-remove steps, given node.
For each {{NodeIterator}} object iterator whose
root's node document is node's
- node document, run the Let oldPreviousSibling be node's previous sibling.
@@ -3177,7 +3177,7 @@ optional suppress observers flag, run these steps:
Assert: parent is non-null.
- Run the live range pre-removing steps, given node.
+ Run the live range pre-remove steps, given node.
For each {{NodeIterator}} object iterator whose
root's node document is node's
@@ -5171,7 +5171,7 @@ method steps are to return the result of replacing child with
within this.
The The The live range pre-removing steps given a node node, are as follows:
+ The live range pre-remove steps given a node node, are as follows:
Let parent be node's parent.
From 2eb22d325d5b34b3a9f4e0d14b2361bcffb6e112 Mon Sep 17 00:00:00 2001
From: Dominic Farolino If inclusiveDescendant is custom and newParent is
connected, then enqueue a custom element callback reaction with
- inclusiveDescendant, callback name " If node is a {{Text}} node and parent is a
document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
- If parent is a {{Document}}, node is an {{Element}}
+ If parent is a document, node is an {{Element}}
node, and either parent has an element child,
child is a doctype, or child is non-null and a doctype is
following child then throw a "{{HierarchyRequestError!!exception}}"
From 26bd858b5657a51d51eab1bdd51960f7cc1641a7 Mon Sep 17 00:00:00 2001
From: Dominic Farolino To ensure pre-move validity
-of a node into a parent before a child, run these steps:
+of a node into a parent before a child:
To pre-move a node into a
-parent before a child, run these steps:
+parent before a child:
Ensure pre-move validity of node into parent before
From 71736d943e9b574d8d9561527e4a54d2426c724c Mon Sep 17 00:00:00 2001
From: Dominic Farolino If parent is not a {{Document}}, {{DocumentFragment}}, or {{Element}}
- node, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
-
If node is a host-including inclusive ancestor of parent, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
@@ -3320,6 +3317,7 @@ interface mixin ParentNode {
[CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined append((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes);
+ [CEReactions] Node moveBefore(Node node, Node? child);
Element? querySelector(DOMString selectors);
[NewObject] NodeList querySelectorAll(DOMString selectors);
@@ -3368,6 +3366,16 @@ Element includes ParentNode;
the node tree are violated.
+ Moves, without first removing, movedNode into node after child
+ if child is non-null; otherwise after the last child of node. This
+ methods preserves state associated with movedNode so that it persists after the move.
+
+ Throws a "{{HierarchyRequestError!!exception}}" {{DOMException}} if the constraints of
+ the node tree are violated.
+
+
Returns the first element that is a descendant of
node that matches selectors.
@@ -4260,7 +4268,6 @@ interface Node : EventTarget {
[CEReactions] Node appendChild(Node node);
[CEReactions] Node replaceChild(Node node, Node child);
[CEReactions] Node removeChild(Node child);
- [CEReactions] Node moveBefore(Node node, Node? child);
};
dictionary GetRootNodeOptions {
From f321247ed26b1a341caadd0a19e0c8f249432857 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren To ensure pre-move validity
-of a node into a parent before a child:
+ To ensure pre-move validity of a node node into a
+node parent before a node child:
-
-
- NodeIterator pre-removing steps given
+ node document, run the NodeIterator pre-remove steps given
node and iterator.
removeChild(child) method steps are to
-return the result of pre-removing child from this.
+return the result of pre-remove child from this.
moveBefore(node, child)
method steps are:
@@ -8367,7 +8367,7 @@ but not its end node, or vice versa.
-
connectedMoveCallback", and an empty
- argument list.
+ inclusiveDescendant, callback name "connectedMoveCallback", and « ».
-node . moveBefore(movedNode, child)
+ node . querySelector(selectors)
This has the side effect of ensuring that a move is only performed if - parent's connected status matches node's connected status.
+ parent's connected is node's connected.If node is a host-including inclusive ancestor of parent, then @@ -2721,10 +2721,10 @@ of a node into a parent before a child:
The ensure pre-move validity steps are a similar, but slightly stricter version -of the ensure pre-insertion validity steps.
+of the ensure pre-insert validity steps. -To pre-move a node into a -parent before a child: +
To pre-move a node node into a node +parent before a node child:
Ensure pre-move validity of node into parent before @@ -2943,8 +2943,8 @@ data-x="concept-insertion-steps-ext">insertion steps, these steps must no JavaScript. These steps may queue tasks to do these things asynchronously, however. -
To move a node into a newParent -before a child, run these steps: +
To move a node node into a node +newParent before a node child:
If child is non-null, then: +
If child is non-null:
For each live range whose start node is newParent and @@ -3317,6 +3317,7 @@ interface mixin ParentNode { [CEReactions, Unscopable] undefined prepend((Node or DOMString)... nodes); [CEReactions, Unscopable] undefined append((Node or DOMString)... nodes); [CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes); + [CEReactions] Node moveBefore(Node node, Node? child); Element? querySelector(DOMString selectors); @@ -3429,6 +3430,16 @@ are:
Replace all with node within this.
The moveBefore(node, child)
+method steps are:
+
+
Let result be the result of pre-moving node into this + before child.
Return result.
The querySelector(selectors) method
steps are to return the first result of running scope-match a selectors string
selectors against this, if the result is not an empty list; otherwise null.
@@ -5179,16 +5190,6 @@ within this.
The removeChild(child) method steps are to
return the result of pre-remove child from this.
-
The moveBefore(node, child)
-method steps are:
-
-
Let return node be the result of pre-moving node into - this before child.
Return return node.
The @@ -8373,7 +8374,8 @@ but not its end node, or vice versa. -
The live range pre-remove steps given a node node, are as follows: +
The live range pre-remove steps given a node node, are as +follows:
Let parent be node's parent.
From 53ce47259eb8b10080edb32abb65d5c8185ed354 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren The The The ensure pre-move validity steps are a similar, but slightly stricter version
of the ensure pre-insert validity steps. To pre-move a node node into a node
-parent before a node child:
-
- Ensure pre-move validity of node into parent before
- child.
-
- Let referenceChild be child.
-
- If referenceChild is node, then set referenceChild to
- node's next sibling.
-
- Move node into parent before referenceChild.
-
- Return node.
- Specifications may define
insertion steps for all or some nodes. The
algorithm is passed insertedNode, as indicated in the insert algorithm
@@ -3318,7 +3301,7 @@ interface mixin ParentNode {
[CEReactions, Unscopable] undefined append((Node or DOMString)... nodes);
[CEReactions, Unscopable] undefined replaceChildren((Node or DOMString)... nodes);
- [CEReactions] Node moveBefore(Node node, Node? child);
+ [CEReactions] undefined moveBefore(Node node, Node? child);
Element? querySelector(DOMString selectors);
[NewObject] NodeList querySelectorAll(DOMString selectors);
@@ -3434,10 +3417,14 @@ are:
method steps are:
Let result be the result of pre-moving node into this
- before child. Ensure pre-move validity of node into thisbefore child.
+
+ Let referenceChild be child.
+
+ If referenceChild is node, then set referenceChild to
+ node's next sibling.
- Return result. The removeChild(child) method steps are to
-return the result of pre-remove child from this.
+return the result of pre-remove child from this.
From 4822fd76ea52d1eee9530b8a5687c73659b6df92 Mon Sep 17 00:00:00 2001
From: Anne van Kesteren removeChild(child) method steps are to
-return the result of pre-remove child from this.
+return the result of pre-removing child from this.
From 1d49fc5a1b888c08f021e57ea74dd1a309efb02c Mon Sep 17 00:00:00 2001
From: Dominic Farolino
-
-
-
querySelector(selectors) method
From 937f22e58adb6ef182a3def061e11aa1a1e9c474 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
To ensure pre-move validity of a node node into a -node parent before a node child: - -
If parent's shadow-including root is not the same as node's - shadow-including root, then throw a "{{HierarchyRequestError!!exception}}" - {{DOMException}}.
- -This has the side effect of ensuring that a move is only performed if - parent's connected is node's connected.
-If node is a host-including inclusive ancestor of parent, then - throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. - -
If child is non-null and its parent is not parent, - then throw a "{{NotFoundError!!exception}}" {{DOMException}}. - -
If node is not an {{Element}} or a {{CharacterData}} node, then - throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If node is a {{Text}} node and parent is a - document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. - -
If parent is a document, node is an {{Element}} - node, and either parent has an element child, - child is a doctype, or child is non-null and a doctype is - following child then throw a "{{HierarchyRequestError!!exception}}" - {{DOMException}}. -
The ensure pre-move validity steps are a similar, but slightly stricter version -of the ensure pre-insert validity steps.
-Specifications may define insertion steps for all or some nodes. The algorithm is passed insertedNode, as indicated in the insert algorithm @@ -2930,6 +2895,33 @@ JavaScript. These steps may queue tasks to do these things asynchronously, howev newParent before a node child:
If this's shadow-including root is not the same as node's + shadow-including root, then throw a "{{HierarchyRequestError!!exception}}" + {{DOMException}}.
+ +This has the side effect of ensuring that a move is only performed if this's + connected is node's connected.
+If node is a host-including inclusive ancestor of this, then + throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. + +
If child is non-null and its parent is not this, then + throw a "{{NotFoundError!!exception}}" {{DOMException}}. + +
If node is not an {{Element}} or a {{CharacterData}} node, then + throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
If node is a {{Text}} node and this is a document, + then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. + +
If this is a document, node is an {{Element}} node, + and either this has an element child, child is a + doctype, or child is non-null and a doctype is following + child then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. +
Let oldParent be node's parent. @@ -3417,8 +3409,6 @@ are: method steps are:
Ensure pre-move validity of node into thisbefore child. -
Let referenceChild be child.
If referenceChild is node, then set referenceChild to
From 1e183c66354ddf0d0679c65f0fb7ae9f2cf39edc Mon Sep 17 00:00:00 2001
From: Dominic Farolino If this's shadow-including root is not the same as node's
- shadow-including root, then throw a "{{HierarchyRequestError!!exception}}"
- {{DOMException}}. If newParent's shadow-including root is not the same as
+ node's shadow-including root, then throw a
+ "{{HierarchyRequestError!!exception}}" {{DOMException}}. This has the side effect of ensuring that a move is only performed if this's
- connected is node's connected. This has the side effect of ensuring that a move is only performed if
+ newParent's connected is node's connected. If node is a host-including inclusive ancestor of this, then
- throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
+ If node is a host-including inclusive ancestor of newParent,
+ then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
- If child is non-null and its parent is not this, then
- throw a "{{NotFoundError!!exception}}" {{DOMException}}.
+ If child is non-null and its parent is not newParent,
+ then throw a "{{NotFoundError!!exception}}" {{DOMException}}.
If node is not an {{Element}} or a {{CharacterData}} node, then
throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. If node is a {{Text}} node and this is a document,
- then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
+ If node is a {{Text}} node and newParent is a
+ document, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
- If this is a document, node is an {{Element}} node,
- and either this has an element child, child is a
- doctype, or child is non-null and a doctype is following
- child then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}.
+ If newParent is a document, node is an {{Element}}
+ node, and either newParent has an element
+ child, child is a doctype, or child is non-null and a
+ doctype is following child then throw a
+ "{{HierarchyRequestError!!exception}}" {{DOMException}}.
Let oldParent be node's parent.
From 5ae3cde315885bac6cd89a4bd787e40ce3caf847 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Specifications may define moving steps for all or some nodes. The algorithm is
+id=concept-node-move-ext>moving steps for all or some nodes. The 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
From a454656ebda8e34b98bb22b76bc2cee21f75a843 Mon Sep 17 00:00:00 2001
From: Dominic Farolino If node is assigned, then run assign slottables for
+ node's assigned slot.
+
+ If oldParent's root is a shadow root, and
+ oldParent is a slot whose assigned nodes is the empty list, then
+ run signal a slot change for oldParent.
+
If child is non-null:
From 71a3c385e063f77afb3f137b465299b6ece03d53 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Specifications may define moving steps for all or some nodes. The 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 insertedNode participates in, create
-browsing contexts, fire events, or otherwise execute
-JavaScript. These steps may queue tasks to do these things asynchronously, however.
+ignore>oldParent as indicated in the move algorithm below. Like the insertion
+steps, 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 tasks to do these things
+asynchronously, however.
To move a node node into a node
From 53409b962ff05f88b51a9c3a6c9dcea1b6a76f25 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Specifications may define moving steps for all or some nodes. The 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 insertedNode
-participates in, create browsing contexts, fire
-events, or otherwise execute JavaScript. These steps may queue tasks to do these things
-asynchronously, however.
+ Specifications may define
+moving steps for all or some nodes. The
+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
+insertedNode 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
From 1f60b93df5f3ac5d18cac365367d30c71be9d6f9 Mon Sep 17 00:00:00 2001
From: Dominic Farolino If node has an inclusive descendant that is a slot:
+
+ Run assign slottables for a tree with oldParent's root.
+
+ Run assign slottables for a tree with node.
+ If child is non-null:
From 01b7634d90251907a4cc7abb6501afedce1879a2 Mon Sep 17 00:00:00 2001
From: Dominic Farolino Run assign slottables for a tree with node.
-
+
+
Queue a tree mutation record for oldParent with « », « node », oldPreviousSibling, and oldNextSibling.
Queue a tree mutation record for newParent with « node », « », newPreviousSibling, and child.
To move a node node into a node -newParent before a node child: +newParent before a node-or-null child:
If oldParent's root is a shadow root, and - oldParent is a slot whose assigned nodes is the empty list, then - run signal a slot change for oldParent. + oldParent is a slot whose assigned nodes + is empty, then run signal a slot change for oldParent.
If node has an inclusive descendant that is a slot: @@ -2956,7 +2956,6 @@ to do these things asynchronously, however.
Run assign slottables for a tree with node.
If newParent's root is a shadow root, and - newParent is a slot whose assigned nodes is the empty list, - then run signal a slot change for newParent. + newParent is a slot whose assigned nodes + is empty, then run signal a slot change for newParent.
Run assign slottables for a tree with node's root. @@ -3364,10 +3363,11 @@ Element includes ParentNode;
Moves, without first removing, movedNode into node after child if child is non-null; otherwise after the last child of node. This - methods preserves state associated with movedNode so that it persists after the move. + method preserves state associated with movedNode.
Throws a "{{HierarchyRequestError!!exception}}" {{DOMException}} if the constraints of - the node tree are violated. + the node tree are violated, or the state associated with the moved node cannot be + preserved.
node . querySelector(selectors)