From 9d8c91716ba833944a584a355bff097084ee9116 Mon Sep 17 00:00:00 2001 From: Anne van Kesteren Date: Tue, 20 Feb 2018 15:27:14 +0100 Subject: [PATCH] Run insertion steps after DocumentFragment insertion completes Fixes https://github.com/whatwg/html/issues/1127 and fixes #575. --- dom.bs | 45 +++++++++++++++++++++++++-------------------- 1 file changed, 25 insertions(+), 20 deletions(-) diff --git a/dom.bs b/dom.bs index f49a00ea3..242f8e712 100644 --- a/dom.bs +++ b/dom.bs @@ -2274,9 +2274,6 @@ before a child, with an optional suppress observers flag, run
  • If parent is a shadow host and node is a slotable, then assign a slot for node. -

  • If node is a {{Text}} node, run the child text content change steps for - parent. -
  • If parent's root is a shadow root, and parent is a slot whose assigned nodes is the empty list, then run signal a slot change for parent. @@ -2284,31 +2281,39 @@ before a child, with an optional suppress observers flag, run

  • Run assign slotables for a tree with node's tree.

  • -

    For each shadow-including inclusive descendant inclusiveDescendant of - node, in shadow-including tree order: +

    If node is connected, then for each + shadow-including inclusive descendant inclusiveDescendant of node, + in shadow-including tree order:

      -
    1. Run the insertion steps with inclusiveDescendant. +

    2. If inclusiveDescendant is custom, then + enqueue a custom element callback reaction with inclusiveDescendant, callback + name "connectedCallback", and an empty argument list.

    3. -

      If inclusiveDescendant is connected, then: +

      Otherwise, try to upgrade + inclusiveDescendant. -

        -
      1. If inclusiveDescendant is custom, then - enqueue a custom element callback reaction with inclusiveDescendant, - callback name "connectedCallback", and an empty argument list. +

        If this successfully upgrades inclusiveDescendant, its + connectedCallback will be enqueued automatically during the + upgrade an element algorithm. +

      +
    -
  • -

    Otherwise, try to upgrade - inclusiveDescendant. +

  • +

    For each node in nodes, in tree order: -

    If this successfully upgrades inclusiveDescendant, its - connectedCallback will be enqueued automatically during the - upgrade an element algorithm. - -

  • +
      +
    1. If node is a {{Text}} node, run the child text content change steps for + parent. + +

    2. +

      For each shadow-including inclusive descendant inclusiveDescendant of + node, in shadow-including tree order: + +

        +
      1. Run the insertion steps with inclusiveDescendant.

      -
  • If suppress observers flag is unset,