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:

    +
  1. +

    If forceDocumentFragmentAdoption is not given, then set it false. + +

    This is needed for HTML's <{template}> element. +

  2. Let oldDocument be node's node document.

  3. If node's parent is non-null, then remove @@ -5278,6 +5283,15 @@ these steps: shadow-including inclusive descendants:

      +
    1. +

      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. +

    2. Set inclusiveDescendant's node document to document.

    3. If inclusiveDescendant is an element, then set the @@ -5307,6 +5321,12 @@ must run these steps:

    4. If node is a shadow root, then throw a "{{HierarchyRequestError!!exception}}" {{DOMException}}. +

    5. +

      If node is a {{DocumentFragment}} node and its + host is non-null, then return node. + +

      Unfortunately this does not throw for web compatibility. +

    6. Adopt node into this.

    7. Return node.