From b096dc024c738c3bfe60ce0ee76d2362aaa23a90 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 17 Apr 2023 12:29:07 -0700 Subject: [PATCH 1/2] Add before removing steps The existing "removing steps" allow other specs to run algorithms after a node has been removed from the tree, but there is no way to run steps before a node has been removed from the tree. This patch adds new "before removing steps" to allow other specs to run algorithms before the node has been removed. This is needed for this HTML issue: https://github.com/whatwg/html/issues/9161 --- dom.bs | 15 +++++++++++---- 1 file changed, 11 insertions(+), 4 deletions(-) diff --git a/dom.bs b/dom.bs index 6eefb816..a692f2c9 100644 --- a/dom.bs +++ b/dom.bs @@ -2754,10 +2754,11 @@ within a parent, run these steps: -

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

Specifications may define removing steps and before removing steps for all or some nodes. +These algorithms are passed removedNode, and optionally oldParent, as indicated in the remove algorithm below.

To remove a node, with an optional suppress observers flag, run these steps: @@ -2767,6 +2768,12 @@ indicated in the remove algorithm below.

  • Assert: parent is non-null. +

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

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

  • +
  • Let index be node's index.

  • For each live range whose start node is an From 35ccfbfadfe8ac11a5705420d43988125a6ae3a6 Mon Sep 17 00:00:00 2001 From: Joey Arhar Date: Mon, 17 Apr 2023 14:07:28 -0700 Subject: [PATCH 2/2] fix id attribute --- dom.bs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dom.bs b/dom.bs index a692f2c9..ac85d896 100644 --- a/dom.bs +++ b/dom.bs @@ -2756,7 +2756,7 @@ within a parent, run these steps:

    Specifications may define removing steps and before removing steps for all or some nodes. +id=concept-node-before-remove-ext>before removing steps for all or some nodes. These algorithms are passed removedNode, and optionally oldParent, as indicated in the remove algorithm below.