Bug 148781 - node.replaceChild(node.lastChild, node.firstChild) should add two mutation records
Summary: node.replaceChild(node.lastChild, node.firstChild) should add two mutation re...
Status: RESOLVED DUPLICATE of bug 149546
Alias: None
Product: WebKit
Classification: Unclassified
Component: DOM (show other bugs)
Version: WebKit Nightly Build
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Nobody
URL:
Keywords: InRadar
Depends on:
Blocks:
 
Reported: 2015-09-03 20:18 PDT by Ryosuke Niwa
Modified: 2015-09-24 16:16 PDT (History)
2 users (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
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 ***