From 0d30952bf048f110e3a0fb8442cde6216ac82afe 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 3073a9c52321e3ab49b8cc04b362553a791e5b94 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.
@@ -2764,12 +2767,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.
@@ -2841,8 +2846,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.
@@ -2956,7 +2977,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.
@@ -2983,7 +3004,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
@@ -3099,7 +3120,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.
@@ -3888,9 +3909,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.
@@ -3950,6 +3976,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}}
@@ -3970,15 +3997,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,
@@ -5626,7 +5672,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:
@@ -6516,7 +6563,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
@@ -7561,7 +7608,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 945189c247f95b338d3fd8d7def09fc47ebc2489 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 b798d9a67b59879c0dfb7eca09109ffc10a07e7b 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.
@@ -4005,11 +4005,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.
@@ -2767,7 +2767,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.
@@ -2851,15 +2851,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
@@ -2893,6 +2911,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.
@@ -3911,7 +4037,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,
@@ -5063,9 +5189,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 2afc546e6c307957eb283d08ab3d7e2d4601f09a 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.
@@ -2785,8 +2782,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 086207815272d802595a56876807d2791e3745e6 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.
@@ -2899,9 +2899,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.
@@ -2922,8 +2919,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.
@@ -2979,17 +2975,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
@@ -3225,7 +3214,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.
@@ -4014,14 +4003,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.
@@ -4086,9 +4070,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.
@@ -4101,28 +4085,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,
@@ -5174,15 +5139,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 c59a7e588d19bccdb0d34cdae8bb3d943ea8fa5b 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
@@ -7669,7 +7669,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 c53fba85dd0407b2577d2e6b0e033adb7ae83e30 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.
@@ -2971,17 +2971,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 47e97f0b8191bd85e299c47792bd57604530397a 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 75f5c75330e5339dbf16e85abe8504b38ff49471 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:
@@ -2919,8 +2949,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.
@@ -2968,12 +2996,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
+
+
-
@@ -3991,6 +4031,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;
@@ -4025,6 +4066,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 85d32befe50fc733a3860fc73a24b8a33dd5cd7f 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 8ecd282ee242f599d5275ff8b4b2b24905221385 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
@@ -3109,7 +3098,7 @@ within a parent, run these steps:
From e5bb88030b680dc0597004b7586799480a1166b4 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
-
+
From 70e15315de035df4ff395fa64f3c4df69eaef013 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
-
-
@@ -4135,7 +4106,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;
@@ -4170,10 +4140,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). @@ -2930,7 +2930,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 cfe40ffc6ebeff830fbca7e27ea6370d5976a9a9 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 1d0f90e5eb20e2f6a84b036cdb380d85ae8d451d 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 abb3c4abc3ce477b7de1b0c5527d63586bd41e3a 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 73bdd6dc6f1d01625ac2ec0d9dd4c738a1c69264 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 @@ -3031,13 +3032,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 457c410b3ba50adca19b403452c89d7e2cc87b6f 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 41b1742ea2ccca9617dddbae454c266e8ff0fe41 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 cb549cacd4e8890b59ab1967a5966cfce8e0ff43 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 2bc92133d5d3ff4f595c3518e97bd9fa86aea08b 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
@@ -3193,22 +3178,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
@@ -8366,6 +8336,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.
@@ -3024,11 +3024,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 a40701df857231968ce1d51d6663ab38eb1ffe76 Mon Sep 17 00:00:00 2001
From: Dominic Farolino
@@ -2966,31 +2966,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 22ff396cb0c1c12988e15517d157695a14541684 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 9478d7fcb542b85647c0a59cde750bde4219de94 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 f5c1e8338ade927a3156319c73a72090f1794645 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 bc64f9a7362559335e81d0079c72cf06f00e3e71 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 d6436f458b5b381388a9ec0ecf2425dce5573b85 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 41e8864577b845ccda6de0a2c36257c0ed23bc66 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.
@@ -3168,7 +3168,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
@@ -5139,7 +5139,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 7c781c5afe44770ca76d94744e69c1c4924c4214 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 21ee3c11319d513c9355a53bc037e4f292fc889a 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 c6aaaceb4ddbab280d91368b0761d377f2e86fb1 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}}.
@@ -3311,6 +3308,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);
@@ -3359,6 +3357,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.
@@ -4252,7 +4260,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 227fd9d35c6c8e81653c0b8116f155f5e0e8b4ea 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:
@@ -8325,7 +8325,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 @@ -2712,10 +2712,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 @@ -2934,8 +2934,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 @@ -3308,6 +3308,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); @@ -3420,6 +3421,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.
@@ -5147,16 +5158,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 @@ -8331,7 +8332,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 145d726adf8265d2cba0b2e118ea5f956ee76a7e 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
@@ -3309,7 +3292,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);
@@ -3425,10 +3408,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.
- Return result. Let referenceChild be child.
+
+ If referenceChild is node, then set referenceChild to
+ node's next sibling.
+
+ 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 4b54a0d97778b4c5bfe406cadce29d8cc3a281d8 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 90d83391dfef67c2f0393acb2668b9c39bb01aab Mon Sep 17 00:00:00 2001
From: Dominic Farolino
-
-
-
querySelector(selectors)
method
From 8e1d36d238ac9a77948d57769640fd760ae7c5fd 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 @@ -2921,6 +2886,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. @@ -3408,8 +3400,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 bb1a060ad3c5c22b1b20b26537c4d9f9148ad551 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 f3f2ab22b0cfc632e576dd513a1e58bba6c61d12 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 32a8a683e49c2772d08a622413500f69d0455f3a 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: