Skip to content

Commit

Permalink
Run insertion steps after DocumentFragment insertion completes
Browse files Browse the repository at this point in the history
Fixes whatwg/html#1127 and fixes #575.
  • Loading branch information
annevk committed Feb 20, 2018
1 parent 3f2620f commit 9d8c917
Showing 1 changed file with 25 additions and 20 deletions.
45 changes: 25 additions & 20 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2274,41 +2274,46 @@ before a <var>child</var>, with an optional <i>suppress observers flag</i>, run
<li><p>If <var>parent</var> is a <a for=Element>shadow host</a> and <var>node</var> is a
<a>slotable</a>, then <a>assign a slot</a> for <var>node</var>.

<li>If <var>node</var> is a {{Text}} node, run the <a>child text content change steps</a> for
<var>parent</var>.

<li><p>If <var>parent</var>'s <a for=tree>root</a> is a <a for=/>shadow root</a>, and
<var>parent</var> is a <a>slot</a> whose <a for=slot>assigned nodes</a> is the empty list,
then run <a>signal a slot change</a> for <var>parent</var>.

<li><p>Run <a>assign slotables for a tree</a> with <var>node</var>'s <a>tree</a>.

<li>
<p>For each <a>shadow-including inclusive descendant</a> <var>inclusiveDescendant</var> of
<var>node</var>, in <a>shadow-including tree order</a>:
<p>If <var>node</var> is <a>connected</a>, then for each
<a>shadow-including inclusive descendant</a> <var>inclusiveDescendant</var> of <var>node</var>,
in <a>shadow-including tree order</a>:

<ol>
<li><p>Run the <a>insertion steps</a> with <var>inclusiveDescendant</var>.
<li><p>If <var>inclusiveDescendant</var> is <a for=Element>custom</a>, then
<a>enqueue a custom element callback reaction</a> with <var>inclusiveDescendant</var>, callback
name "<code>connectedCallback</code>", and an empty argument list.

<li>
<p>If <var>inclusiveDescendant</var> is <a>connected</a>, then:
<p>Otherwise, <a lt="try to upgrade an element">try to upgrade</a>
<var>inclusiveDescendant</var>.

<ol>
<li><p>If <var>inclusiveDescendant</var> is <a for=Element>custom</a>, then
<a>enqueue a custom element callback reaction</a> with <var>inclusiveDescendant</var>,
callback name "<code>connectedCallback</code>", and an empty argument list.
<p class=note>If this successfully upgrades <var>inclusiveDescendant</var>, its
<code>connectedCallback</code> will be enqueued automatically during the
<a>upgrade an element</a> algorithm.
</ol>
</ol>

<li>
<p>Otherwise, <a lt="try to upgrade an element">try to upgrade</a>
<var>inclusiveDescendant</var>.
<li>
<p>For each <var>node</var> in <var>nodes</var>, in <a>tree order</a>:

<p class=note>If this successfully upgrades <var>inclusiveDescendant</var>, its
<code>connectedCallback</code> will be enqueued automatically during the
<a>upgrade an element</a> algorithm.
</ol>
</li>
<ol>
<li><p>If <var>node</var> is a {{Text}} node, run the <a>child text content change steps</a> for
<var>parent</var>.

<li>
<p>For each <a>shadow-including inclusive descendant</a> <var>inclusiveDescendant</var> of
<var>node</var>, in <a>shadow-including tree order</a>:

<ol>
<li><p>Run the <a>insertion steps</a> with <var>inclusiveDescendant</var>.
</ol>
</li>
</ol>

<li>If <i>suppress observers flag</i> is unset,
Expand Down

0 comments on commit 9d8c917

Please sign in to comment.