Reversed MutationRecords for inserting <script> which inserts another element |
|||
Issue descriptionChrome Version: 59 canary OS: All but iOS What steps will reproduce the problem? (1) Open http://w3c-test.org/dom/nodes/MutationObserver-document.html What is the expected result? No FAIL tess What happens instead? One FAIL test. Please use labels and text to provide additional information. DOM mutations in the failing test is: <p id='n00'></p><script id='s002'> var newScript = document.createElement("script"); setupTest.step(function() { newScript.textContent = "document.body.appendChild(newElement);"; newScript.id = "inserted_script"; document.getElementById("n00").appendChild(newScript); Expected MutationRecords are: [{type: "childList", addedNodes: function () { return [ document.getElementById("inserted_script") ]; }, target: function () { return document.getElementById("n00"); }}, {type: "childList", addedNodes: function () { return [ document.getElementById("inserted_element") ]; }, previousSibling: function () { return document.getElementById("s002"); }, target: document.body} ] However, the order of MutaionRecords are reversed in Chromium browser.
,
May 22 2017
,
May 22 2017
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/5a3def7f350a35e7e481714f0d3851c9434cdeec commit 5a3def7f350a35e7e481714f0d3851c9434cdeec Author: tkent <tkent@chromium.org> Date: Mon May 22 06:02:24 2017 DOM: Fix an issue of reversed MutationRecoards. In appendChild, insertBefore, and replaceChild, ChildListMutationScope should be destructed before calling notifications which can execute author scripts. This CL splits InsertNodeVector() into two parts; one should be wrapped with ChildListMutationScope, and another should not. The new behavior matches to the DOM standard, Firefox, and Edge. BUG= 711568 Review-Url: https://codereview.chromium.org/2899613002 Cr-Commit-Position: refs/heads/master@{#473512} [delete] https://crrev.com/6f832b7a5ad0f23098edfc38d4a2c60c2b66b3ff/third_party/WebKit/LayoutTests/external/wpt/dom/nodes/MutationObserver-document-expected.txt [modify] https://crrev.com/5a3def7f350a35e7e481714f0d3851c9434cdeec/third_party/WebKit/Source/core/dom/ContainerNode.cpp [modify] https://crrev.com/5a3def7f350a35e7e481714f0d3851c9434cdeec/third_party/WebKit/Source/core/dom/ContainerNode.h
,
May 22 2017
|
|||
►
Sign in to add a comment |
|||
Comment 1 by tkent@chromium.org
, May 16 2017