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

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

Issue 2415923003: Fix setting textContent to empty string (Closed)
Patch Set: Remove test 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
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/Node-textContent-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/Node.cpp
diff --git a/third_party/WebKit/Source/core/dom/Node.cpp b/third_party/WebKit/Source/core/dom/Node.cpp
index e7766f1517764202878d2c1e2b76fa3f60166f4a..fdc20908685c44adee91624c3ce73ec23a9780ba 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);
« no previous file with comments | « third_party/WebKit/LayoutTests/imported/wpt/dom/nodes/Node-textContent-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698