New issue
Advanced search Search tips

Issue 722741 link

Starred by 1 user

Issue metadata

Status: Fixed
Owner:
Closed: May 2017
Components:
EstimatedDays: ----
NextAction: ----
OS: ----
Pri: 3
Type: Bug

Blocking:
issue 711568



Sign in to add a comment

Wrong MutationRecords for Node.replaceChild()

Project Member Reported by tkent@chromium.org, May 16 2017

Issue description

Chrome Version: (copy from chrome://version)
OS: (e.g. Win7, OSX 10.9.5, etc...)

What steps will reproduce the problem?
(1) Open http://w3c-test.org/dom/nodes/MutationObserver-childList.html

What is the expected result?
Expected: No Fail tests

What happens instead?
Actual: Two Fail tess

Please use labels and text to provide additional information.
They tests mutation records for replaceChild().

  parent.replaceChild(parent.lastChild, parent.firstChild);

It should produce two MutationRecords for
* the removal of parent.lastChild from parent, and
* the removal of parent.firstChild and the addition of parent.lastChild.

But we produces only one record.

 

Comment 1 by tkent@chromium.org, May 16 2017

Labels: Hotlist-Interop
Safari and Firefox work correctly.

Comment 2 by tkent@chromium.org, May 16 2017

Owner: tkent@chromium.org
Status: Started (was: Available)
Project Member

Comment 3 by bugdroid1@chromium.org, May 17 2017

The following revision refers to this bug:
  https://chromium.googlesource.com/chromium/src.git/+/56387aa57bc11d0f969c5bb9824a39c804202be3

commit 56387aa57bc11d0f969c5bb9824a39c804202be3
Author: tkent <tkent@chromium.org>
Date: Wed May 17 09:12:21 2017

MutationObserver: Correct MutationRecords for Node.replaceChild().

  parent.replaceChild(parent.lastChild, parent.firstChild);

This code produced just one MutationRecord, but it should produce two
MutationRecords. This CL makes replaceChild() implementation close to the DOM
standard.

New behavior matches to Firefox and Safari.

BUG= 722741 

Review-Url: https://codereview.chromium.org/2889523002
Cr-Commit-Position: refs/heads/master@{#472393}

[delete] https://crrev.com/05e9dab183abf911f6a390ec6bdd77692760a824/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/MutationObserver-childList-expected.txt
[modify] https://crrev.com/56387aa57bc11d0f969c5bb9824a39c804202be3/third_party/WebKit/LayoutTests/fast/dom/move-nodes-across-documents-expected.txt
[modify] https://crrev.com/56387aa57bc11d0f969c5bb9824a39c804202be3/third_party/WebKit/LayoutTests/fast/dom/move-nodes-across-documents.html
[modify] https://crrev.com/56387aa57bc11d0f969c5bb9824a39c804202be3/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child-expected.txt
[modify] https://crrev.com/56387aa57bc11d0f969c5bb9824a39c804202be3/third_party/WebKit/LayoutTests/fast/events/mutation-during-replace-child.html
[modify] https://crrev.com/56387aa57bc11d0f969c5bb9824a39c804202be3/third_party/WebKit/Source/core/dom/ContainerNode.cpp

Comment 4 by tkent@chromium.org, May 18 2017

Labels: M-60
Status: Fixed (was: Started)

Sign in to add a comment