From 7ece78f49c8b7549373b0c70b4fc767c48f7d32b Mon Sep 17 00:00:00 2001 From: Anthony Ramine Date: Fri, 27 Nov 2015 00:54:11 +0100 Subject: [PATCH] Fix queuing of mutation records when removing a node from its parent The old next sibling of the node needs to be stored somewhere before removing the node from its parent. --- dom.bs | 4 +++- dom.html | 5 +++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/dom.bs b/dom.bs index d85bd922..d0629fc2 100644 --- a/dom.bs +++ b/dom.bs @@ -1725,6 +1725,8 @@ steps:
  • Let oldPreviousSibling be node's previous sibling +
  • Let oldNextSibling be node's next sibling. +
  • Remove node from its parent.
  • Run the removing steps with @@ -1742,7 +1744,7 @@ steps:
  • If suppress observers flag is unset, queue a mutation record of "childList" for parent with removedNodes a list solely containing node, - nextSibling node's next sibling, and previousSibling + nextSibling oldNextSibling, and previousSibling oldPreviousSibling. diff --git a/dom.html b/dom.html index 7123d2fc..ac7cf559 100644 --- a/dom.html +++ b/dom.html @@ -69,7 +69,7 @@

    DOM

    -

    Living Standard — Last Updated

    +

    Living Standard — Last Updated

    Participate: @@ -1021,12 +1021,13 @@

    For each NodeIterator object iterator whose root’s node document is node’s node document, run the NodeIterator pre-removing steps given node and iterator.

  • Let oldPreviousSibling be node’s previous sibling +
  • Let oldNextSibling be node’s next sibling.
  • Remove node from its parent.
  • Run the removing steps with node, parent, and oldPreviousSibling.
  • For each inclusive ancestor ancestor of parent, if ancestor has any registered observers whose options' subtree is true, then for each such registered observer registered, append a transient registered observer whose observer and options are identical to those of registered and source which is registered to node’s list of registered observers.
  • If suppress observers flag is unset, queue a mutation record of "childList" for parent with removedNodes a list solely containing node, - nextSibling node’s next sibling, and previousSibling oldPreviousSibling. + nextSibling oldNextSibling, and previousSibling oldPreviousSibling.

    4.2.2. Interface NonElementParentNode

    The getElementById() method is not