This is an archived snapshot of W3C's public bugzilla bug tracker, decommissioned in April 2019. Please see the home page for more details.
In pre-insert and replace, step 6 ("If parent is a document, run these substeps: …") uses a chain of ifs that would be more straightforward as a switch on the node type.
Not entirely convinced this improved the status quo. https://github.com/whatwg/dom/commit/1fb01cf434d483c9f0b725eeb890730678b8fa3a