Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(393)

Unified Diff: third_party/WebKit/Source/core/dom/ContainerNode.cpp

Issue 2325143002: Node.replaceChild with an empty DocumentFragment should not dispatch DOMSubtreeModified twice. (Closed)
Patch Set: Created 4 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/loader/delete-inside-cancelTimer-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/dom/ContainerNode.cpp
diff --git a/third_party/WebKit/Source/core/dom/ContainerNode.cpp b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
index b277ab739a8557379fe8f239435a01058b647837..1d568780e071c72e464b81f5d42ea7131d78e781 100644
--- a/third_party/WebKit/Source/core/dom/ContainerNode.cpp
+++ b/third_party/WebKit/Source/core/dom/ContainerNode.cpp
@@ -400,6 +400,8 @@ Node* ContainerNode::replaceChild(Node* newChild, Node* oldChild, ExceptionState
collectChildrenAndRemoveFromOldParent(*newChild, targets, exceptionState);
if (exceptionState.hadException())
return nullptr;
+ if (targets.isEmpty())
+ return child;
// Does this yet another check because collectChildrenAndRemoveFromOldParent() fires a MutationEvent.
if (!checkAcceptChild(newChild, child, exceptionState)) {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/loader/delete-inside-cancelTimer-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698