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

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

Issue 2415923003: Fix setting textContent to empty string (Closed)
Patch Set: Remove test expectations Created 4 years, 2 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: third_party/WebKit/Source/core/dom/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index f1292c443e9f91f47da3e401f871bbcfa14bbabd..bead55f338998ccfa9ec7835ef0ae0e273230945 100644
--- a/third_party/WebKit/Source/core/dom/Node.cpp
+++ b/third_party/WebKit/Source/core/dom/Node.cpp
@@ -1303,7 +1303,7 @@ void Node::setTextContent(const String& text) {
// See crbug.com/352836 also.
// No need to do anything if the text is identical.
if (container->hasOneTextChild() &&
- toText(container->firstChild())->data() == text)
+ toText(container->firstChild())->data() == text && !text.isEmpty())
return;
ChildListMutationScope mutation(*this);

Powered by Google App Engine
This is Rietveld 408576698