[dom] Fix the adoption step when replacing node by child into parent (#121)

If the replacing node is the replaced child, the node doesn't need and
shouldn't be adopted into the parent's document because it removes it from
the parent, which is already done in the very next step.

The adoption step is made conditional and not the removing one to not
artificially increase the number of mutation records being queued during
the replacing as a whole.
You can view, comment on, or merge this pull request online at:

  https://github.com/whatwg/dom/pull/121

-- Commit Summary --

  * Fix the adoption step when replacing node by child into parent

-- File Changes --

    M dom.bs (5)
    M dom.html (12)

-- Patch Links --

https://github.com/whatwg/dom/pull/121.patch
https://github.com/whatwg/dom/pull/121.diff

---
Reply to this email directly or view it on GitHub:
https://github.com/whatwg/dom/pull/121

Received on Thursday, 26 November 2015 23:16:53 UTC