Skip to content

Commit

Permalink
Avoid enqueuing "disconnectedCallback" on detached custom elements
Browse files Browse the repository at this point in the history
Fixes #773.
  • Loading branch information
shvaikalesh authored Feb 7, 2020
1 parent e15774f commit de29633
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions dom.bs
Original file line number Diff line number Diff line change
Expand Up @@ -2681,8 +2681,10 @@ indicated in the <a for=/>remove</a> algorithm below.

<li><p>Run the <a>removing steps</a> with <var>node</var> and <var>parent</var>.

<li><p>Let <var>isParentConnected</var> be <var>parent</var>'s <a>connected</a>.

<li>
<p>If <var>node</var> is <a for=Element>custom</a>, then
<p>If <var>node</var> is <a for=Element>custom</a> and <var>isParentConnected</var> is true, then
<a>enqueue a custom element callback reaction</a> with <var>node</var>, callback name
"<code>disconnectedCallback</code>", and an empty argument list.

Expand All @@ -2696,9 +2698,9 @@ indicated in the <a for=/>remove</a> algorithm below.
<ol>
<li><p>Run the <a>removing steps</a> with <var>descendant</var>.

<li><p>If <var>descendant</var> is <a for=Element>custom</a>, then
<a>enqueue a custom element callback reaction</a> with <var>descendant</var>, callback name
"<code>disconnectedCallback</code>", and an empty argument list.
<li><p>If <var>descendant</var> is <a for=Element>custom</a> and <var>isParentConnected</var>
is true, then <a>enqueue a custom element callback reaction</a> with <var>descendant</var>,
callback name "<code>disconnectedCallback</code>", and an empty argument list.
</ol>
</li>

Expand Down

0 comments on commit de29633

Please sign in to comment.