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:

      -
    1. Adopt node into parent's node document. -

    2. If child is null, then append node to parent's children. @@ -2689,6 +2689,8 @@ within a parent, run these steps:

    3. Let previousSibling be child's previous sibling. +

    4. Adopt node into parent's node document. +

    5. Let removedNodes be the empty set.

    6. @@ -2721,6 +2723,9 @@ within a parent, run these steps: within a parent, run these steps:
        +
      1. If node is non-null, then adopt node into parent's + node document. +

      2. Let removedNodes be parent's children.

      3. 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):

        1. Let oldDocument be node's node document. @@ -5342,6 +5347,16 @@ 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. HTML's <{template}> element passes true for + forceDocumentFragmentAdoption. +

          2. Set inclusiveDescendant's node document to document.

          3. If inclusiveDescendant is an element, then set the @@ -5370,8 +5385,11 @@ these steps:

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

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

          6. +

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

            Unfortunately this does not throw for web compatibility.

          7. Adopt node into this.