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

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

Issue 202883002: Revert 169394 "Node::setTextContent should avoid work when nothi..." (Closed) Base URL: svn://svn.chromium.org/blink/
Patch Set: Created 6 years, 9 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 | « trunk/LayoutTests/fast/repaint/set-text-content-same-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: trunk/Source/core/dom/Node.cpp
===================================================================
--- trunk/Source/core/dom/Node.cpp (revision 169400)
+++ trunk/Source/core/dom/Node.cpp (working copy)
@@ -59,7 +59,6 @@
#include "core/dom/shadow/InsertionPoint.h"
#include "core/dom/shadow/ShadowRoot.h"
#include "core/editing/htmlediting.h"
-#include "core/editing/markup.h"
#include "core/events/BeforeLoadEvent.h"
#include "core/events/Event.h"
#include "core/events/EventDispatchMediator.h"
@@ -1498,7 +1497,11 @@
case ELEMENT_NODE:
case ATTRIBUTE_NODE:
case DOCUMENT_FRAGMENT_NODE: {
- replaceChildrenWithText(toContainerNode(this), text, ASSERT_NO_EXCEPTION);
+ RefPtr<ContainerNode> container = toContainerNode(this);
+ ChildListMutationScope mutation(*this);
+ container->removeChildren();
+ if (!text.isEmpty())
+ container->appendChild(document().createTextNode(text), ASSERT_NO_EXCEPTION);
return;
}
case DOCUMENT_NODE:
« no previous file with comments | « trunk/LayoutTests/fast/repaint/set-text-content-same-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698