diff --git a/dom.bs b/dom.bs index 5162a42a..5af3f8fc 100644 --- a/dom.bs +++ b/dom.bs @@ -2509,6 +2509,8 @@ of a node into a parent before a child, run the
If referenceChild is node, then set referenceChild to node's next sibling. +
Adopt node into parent's node document. +
Insert node into parent before referenceChild.
Return node. @@ -2574,8 +2576,6 @@ before a child, with an optional suppress observers flag, run
For each node in nodes, in tree order:
Adopt node into parent's node document. -
If child is null, then append node to parent's children. @@ -2689,6 +2689,8 @@ within a parent, run these steps:
Let previousSibling be child's previous sibling. +
Adopt node into parent's node document. +
Let removedNodes be the empty set.
If node is non-null, then adopt node into parent's + node document. +
Let removedNodes be parent's children.
Let addedNodes be the empty set. @@ -5324,8 +5329,8 @@ method steps are: algorithm is passed node and oldDocument, as indicated in the adopt algorithm. -
To adopt a node into a document, run -these steps: +
To adopt a node into a document, +with an optional forceDocumentFragmentAdoption (default false):
Let oldDocument be node's node document. @@ -5342,6 +5347,16 @@ these steps: shadow-including inclusive descendants:
If forceDocumentFragmentAdoption is false, inclusiveDescendant is a + {{DocumentFragment}} node, inclusiveDescendant is node, and + node's host is non-null, then + continue. + +
This is only reasonable as long as all adopt callers remove the children + of node. HTML's <{template}> element passes true for + forceDocumentFragmentAdoption. +
Set inclusiveDescendant's node document to document.
If inclusiveDescendant is an element, then set the @@ -5370,8 +5385,11 @@ these steps:
If node is a shadow root, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. -
If node is a {{DocumentFragment}} node whose - host is non-null, then return. +
If node is a {{DocumentFragment}} node and its + host is non-null, then return node. + +
Unfortunately this does not throw for web compatibility.