From de29633694822f4fd0bab61a2d142de2298dc88b Mon Sep 17 00:00:00 2001 From: Alexey Shvayka Date: Fri, 7 Feb 2020 12:34:06 +0200 Subject: [PATCH] Avoid enqueuing "disconnectedCallback" on detached custom elements Fixes #773. --- dom.bs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/dom.bs b/dom.bs index 308eb4ff2..e9533bbf8 100644 --- a/dom.bs +++ b/dom.bs @@ -2681,8 +2681,10 @@ indicated in the remove algorithm below.
  • Run the removing steps with node and parent. +

  • Let isParentConnected be parent's connected. +

  • -

    If node is custom, then +

    If node is custom and isParentConnected is true, then enqueue a custom element callback reaction with node, callback name "disconnectedCallback", and an empty argument list. @@ -2696,9 +2698,9 @@ indicated in the remove algorithm below.

    1. Run the removing steps with descendant. -

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

    3. If descendant is custom and isParentConnected + is true, then enqueue a custom element callback reaction with descendant, + callback name "disconnectedCallback", and an empty argument list.