diff --git a/dom.bs b/dom.bs index 85b43079b..575f8ce79 100644 --- a/dom.bs +++ b/dom.bs @@ -5260,10 +5260,15 @@ when invoked, must run these steps: 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, run these steps:
If forceDocumentFragmentAdoption is not given, then set it false. + +
This is needed for HTML's <{template}> element. +
Let oldDocument be node's node document.
If node's parent is non-null, then remove @@ -5278,6 +5283,15 @@ 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. +
Set inclusiveDescendant's node document to document.
If inclusiveDescendant is an element, then set the @@ -5307,6 +5321,12 @@ must run these steps:
If node is a shadow root, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. +
If node is a {{DocumentFragment}} node and its + host is non-null, then return node. + +
Unfortunately this does not throw for web compatibility. +
Return node.