Bug 148781

Summary: node.replaceChild(node.lastChild, node.firstChild) should add two mutation records
Product: WebKit Reporter: Ryosuke Niwa <rniwa>
Component: DOMAssignee: Nobody <webkit-unassigned>
Status: RESOLVED DUPLICATE    
Severity: Normal CC: cdumez, webkit-bug-importer
Priority: P2 Keywords: InRadar
Version: WebKit Nightly Build   
Hardware: Unspecified   
OS: Unspecified   

Description Ryosuke Niwa 2015-09-03 20:18:54 PDT
Because of the way replaceChild is defined (https://dom.spec.whatwg.org/#dom-node-replacechild),
it should add two mutation records when the inserted node was originally a sibling of the reference child.

e.g. node.replaceChild(node.lastChild, node.firstChild) when node has two children.

This bug was found by the newly added test: LayoutTests/http/tests/w3c/dom/nodes/MutationObserver-childList.html
Comment 1 Radar WebKit Bug Importer 2015-09-03 20:19:40 PDT
<rdar://problem/22571887>
Comment 2 Chris Dumez 2015-09-24 16:16:59 PDT

*** This bug has been marked as a duplicate of bug 149546 ***