Index: Source/core/dom/Node.cpp |
diff --git a/Source/core/dom/Node.cpp b/Source/core/dom/Node.cpp |
index 8af4165eb24a4b736848148c34141be39e915632..d363f32a42d7cec22e08e99af6db878199dda050 100644 |
--- a/Source/core/dom/Node.cpp |
+++ b/Source/core/dom/Node.cpp |
@@ -1515,9 +1515,13 @@ void Node::setTextContent(const String& text) |
case DOCUMENT_FRAGMENT_NODE: { |
// FIXME: Merge this logic into replaceChildrenWithText. |
RefPtrWillBeRawPtr<ContainerNode> container = toContainerNode(this); |
+ |
+ // Note: This is an intentional optimization. |
+ // See crbug.com/352836 also. |
// 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: |