diff --git a/dom.bs b/dom.bs index 520dfc089..4c0779e8d 100644 --- a/dom.bs +++ b/dom.bs @@ -12,7 +12,7 @@ No Editor: true Logo: https://resources.whatwg.org/logo-dom.svg Abstract: DOM defines a platform-neutral model for events and node trees. Ignored Terms: EmptyString, Array, Document -Ignored Vars: p, documentFragment, ev, oldParent, em, processingInstruction, obj, tree, removedNode, C, *, intersects, collapsed +Ignored Vars: p, documentFragment, ev, oldParent, em, processingInstruction, obj, tree, insertedNode, removedNode, C, *, intersects, collapsed Boilerplate: omit conformance, omit feedback-header @@ -1535,14 +1535,12 @@ To pre-insert a

Specifications may define insertion steps for all or some nodes. -The algorithm is passed insertedNode and newAncestor as indicated in the -insert algorithm below. +The algorithm is passed insertedNode, as indicated in the insert +algorithm below. -

newAncestor can be insertedNode's parent. - To insert a node into a parent before a child, with an optional suppress observers flag, run these steps: @@ -1600,9 +1598,9 @@ into a parent before a child, with an optional

  • Insert node into parent before child or at the end of parent if child is null. -

  • For each shadow-root-including inclusive descendant descendant of - node, in shadow-root-including tree order, run the insertion steps with - descendant and parent. +

  • For each shadow-root-including inclusive descendant inclusiveDescendant + of node, in shadow-root-including tree order, run the insertion steps + with inclusiveDescendant.

  • If suppress observers flag is unset, @@ -1798,10 +1796,8 @@ To pre-remove a

    Specifications may define removing steps for all or some nodes. -The algorithm is passed removedNode and oldAncestor, as indicated in the -remove algorithm below. - -

    oldAncestor can be removedNode's former parent. +The algorithm is passed removedNode, and optionally oldParent, as indicated in +the remove algorithm below. To remove a node from a parent, with an optional suppress observers flag, run these @@ -1850,9 +1846,11 @@ steps:

  • Remove node from its parent. -
  • For each shadow-root-including inclusive descendant descendant of - node, in shadow-root-including tree order, run the removing steps with - descendant and parent. +

  • Run the removing steps with node and parent. + +

  • For each shadow-root-including descendant descendant of node, + in shadow-root-including tree order, run the removing steps with + descendant.

  • For each inclusive ancestor inclusiveAncestor of parent, if inclusiveAncestor has any registered observers @@ -5004,17 +5002,22 @@ interface ShadowRoot : DocumentFragment { shadow-root-including tree order, is shadow-root-including preorder, depth-first traversal of a tree. shadow-root-including preorder, depth-first traversal of a tree -tree is preorder, depth-first traversal of tree, with for each element -element encountered in tree, whose shadow root is non-null, -shadow-root-including preorder, depth-first traversal of the element's +tree is preorder, depth-first traversal of tree, with for each +element element encountered in tree, whose +shadow root is non-null, +shadow-root-including preorder, depth-first traversal of the element's shadow root's tree just after it is encountered.

    An object A is a +shadow-root-including descendant of an +object B, if A is a descendant of B, or A's +root is a shadow root and A's root's +host is a shadow-root-including inclusive descendant of +B. + +

    A shadow-root-including inclusive descendant -of an object B, if A is an inclusive descendant of B, or -A's root is a shadow root and A's -root's host is a -shadow-root-including inclusive descendant of B. +is an object or one of its shadow-root-including descendants.


    diff --git a/dom.html b/dom.html index fc7c1ee1e..95d106803 100644 --- a/dom.html +++ b/dom.html @@ -1049,8 +1049,8 @@

    Return node.

    Specifications may define insertion steps for all or some nodes. -The algorithm is passed insertedNode and newAncestor as indicated in the insert algorithm below.

    -

    newAncestor can be insertedNode’s parent.

    +The algorithm is passed insertedNode, and optionally newParent, as indicated +in the insert algorithm below.

    To insert a node into a parent before a child, with an optional suppress observers flag, run these steps:

    1. Let count be the number of children of node if @@ -1077,7 +1077,10 @@

      Insert node into parent before child or at the end of parent if child is null.

    2. -

      For each shadow-root-including inclusive descendant descendant of node, in shadow-root-including tree order, run the insertion steps with descendant and parent.

      +

      Run the insertion steps with node and parent.

      +
    3. +

      For each shadow-root-including descendant descendant of node, + in shadow-root-including tree order, run the insertion steps with descendant.

  • If suppress observers flag is unset, queue a mutation record of "childList" for parent with addedNodes nodes, nextSibling child, and previousSibling child’s previous sibling or parent’s last child if child is null. @@ -1147,8 +1150,8 @@

    Return child.

    Specifications may define removing steps for all or some nodes. -The algorithm is passed removedNode and oldAncestor, as indicated in the remove algorithm below.

    -

    oldAncestor can be removedNode’s former parent.

    +The algorithm is passed removedNode, and optionally oldParent, as indicated in +the remove algorithm below.

    To remove a node from a parent, with an optional suppress observers flag, run these steps:

      @@ -1165,7 +1168,10 @@

      Let oldNextSibling be node’s next sibling.
    1. Remove node from its parent.
    2. -

      For each shadow-root-including inclusive descendant descendant of node, in shadow-root-including tree order, run the removing steps with descendant and parent.

      +

      Run the removing steps with node and parent.

      +
    3. +

      For each shadow-root-including descendant descendant of node, + in shadow-root-including tree order, run the removing steps with descendant.

    4. For each inclusive ancestor inclusiveAncestor of parent, if inclusiveAncestor has any registered observers whose options' subtree is true, then for each such registered observer registered, append a transient registered observer whose observer and options are identical to those of registered and source which is registered to node’s list of registered observers.
    5. If suppress observers flag is unset, queue a mutation record of "childList" for parent with removedNodes a list solely containing node, @@ -2779,7 +2785,8 @@

      The host attribute’s getter must return the context object’s host.


      In shadow-root-including tree order, is shadow-root-including preorder, depth-first traversal of a tree. shadow-root-including preorder, depth-first traversal of a tree tree is preorder, depth-first traversal of tree, with for each element element encountered in tree, whose shadow root is non-null, shadow-root-including preorder, depth-first traversal of the element’s shadow root’s tree just after it is encountered.

      -

      An object A is a shadow-root-including inclusive descendant of an object B, if A is an inclusive descendant of B, or A’s root is a shadow root and A’s root’s host is a shadow-root-including inclusive descendant of B.

      +

      An object A is a shadow-root-including descendant of an +object B, if A is a descendant of B, or A’s root is a shadow root and A’s root’s host is B or a shadow-root-including descendant of B.


      For now you can find more information about this object in Shadow DOM. The DOM Standard will be updated over time to cover more details.

      @@ -5463,7 +5470,7 @@

      dfn for Element, in §4.9
    6. shadowRoot, in §4.9 -
    7. shadow-root-including inclusive descendant, in §4.8 +
    8. shadow-root-including descendant, in §4.8
    9. shadow-root-including preorder, depth-first traversal, in §4.8
    10. shadow-root-including tree order, in §4.8
    11. ShadowRootInit, in §4.9