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

Unified Diff: Source/core/editing/ReplaceNodeWithSpanCommand.cpp

Issue 22508006: Refactor adding and removing named and IDed elements (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Address review comments Created 7 years, 4 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 | « Source/core/dom/TreeScope.cpp ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ReplaceNodeWithSpanCommand.cpp
diff --git a/Source/core/editing/ReplaceNodeWithSpanCommand.cpp b/Source/core/editing/ReplaceNodeWithSpanCommand.cpp
index 3c262ae141333910322d0647b5a12ddb83e5e7cd..1686ec072b200eb96f61dd7220b0495fdfeca378 100644
--- a/Source/core/editing/ReplaceNodeWithSpanCommand.cpp
+++ b/Source/core/editing/ReplaceNodeWithSpanCommand.cpp
@@ -52,16 +52,15 @@ static void swapInNodePreservingAttributesAndChildren(HTMLElement* newNode, HTML
{
ASSERT(nodeToReplace->inDocument());
RefPtr<ContainerNode> parentNode = nodeToReplace->parentNode();
- parentNode->insertBefore(newNode, nodeToReplace, ASSERT_NO_EXCEPTION);
+ // FIXME: Fix this to send the proper MutationRecords when MutationObservers are present.
+ newNode->cloneDataFromElement(*nodeToReplace);
NodeVector children;
getChildNodes(nodeToReplace, children);
for (size_t i = 0; i < children.size(); ++i)
newNode->appendChild(children[i], ASSERT_NO_EXCEPTION);
- // FIXME: Fix this to send the proper MutationRecords when MutationObservers are present.
- newNode->cloneDataFromElement(*nodeToReplace);
-
+ parentNode->insertBefore(newNode, nodeToReplace, ASSERT_NO_EXCEPTION);
parentNode->removeChild(nodeToReplace, ASSERT_NO_EXCEPTION);
}
« no previous file with comments | « Source/core/dom/TreeScope.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698