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

Unified Diff: Source/core/dom/Node.cpp

Issue 383163003: Add intentional optimization comment in Node::setTextContent (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebase layout tests case Created 6 years, 5 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
Index: Source/core/dom/Node.cpp
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp
index 8af4165eb24a4b736848148c34141be39e915632..03dfb7da2d718bbc033505b588e97228e1c963d7 100644
--- a/Source/core/dom/Node.cpp
+++ b/Source/core/dom/Node.cpp
@@ -1515,9 +1515,6 @@ void Node::setTextContent(const String& text)
case DOCUMENT_FRAGMENT_NODE: {
// FIXME: Merge this logic into replaceChildrenWithText.
RefPtrWillBeRawPtr<ContainerNode> container = toContainerNode(this);
- // No need to do anything if the text is identical.
- if (container->hasOneTextChild() && toText(container->firstChild())->data() == text)
- return;
ChildListMutationScope mutation(*this);
container->removeChildren();
// Note: This API will not insert empty text nodes:

Powered by Google App Engine
This is Rietveld 408576698