We have an optimization in Node.insertBefore(newNode, refChild) to avoid doing any work when newNode == refChild or newNode.nextSibling == refChild. This optimization is not in the specification: - https://dom.spec.whatwg.org/#concept-node-replace The issue is that this optimization is observable with DOM mutation observers / listeners or DOM ranges.
Created attachment 285768 [details] Patch
Comment on attachment 285768 [details] Patch Clearing flags on attachment: 285768 Committed r204368: <http://trac.webkit.org/changeset/204368>
All reviewed patches have been landed. Closing bug.
<rdar://problem/29393697>