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

Unified Diff: sky/engine/core/editing/InsertLineBreakCommand.cpp

Issue 879733002: Replace createTextNode with new Text(). (Closed) Base URL: git@github.com:domokit/mojo.git@master
Patch Set: Created 5 years, 11 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 | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/html/HTMLTitleElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: sky/engine/core/editing/InsertLineBreakCommand.cpp
diff --git a/sky/engine/core/editing/InsertLineBreakCommand.cpp b/sky/engine/core/editing/InsertLineBreakCommand.cpp
index 70d4205e5d17be5d7cf047a9fd657124f871a8fa..5aa547b6e9fb561d8a4efbe97ce060ee64f9dde8 100644
--- a/sky/engine/core/editing/InsertLineBreakCommand.cpp
+++ b/sky/engine/core/editing/InsertLineBreakCommand.cpp
@@ -70,7 +70,7 @@ void InsertLineBreakCommand::doApply()
pos = positionOutsideTabSpan(pos);
RefPtr<Node> nodeToInsert = nullptr;
- nodeToInsert = document().createTextNode("\n");
+ nodeToInsert = Text::create(document(), "\n");
// FIXME: Need to merge text nodes when inserting just after or before text.
@@ -111,7 +111,7 @@ void InsertLineBreakCommand::doApply()
if (textNode->inDocument())
insertTextIntoNode(textNode, 0, nonBreakingSpaceString());
else {
- RefPtr<Text> nbspNode = document().createTextNode(nonBreakingSpaceString());
+ RefPtr<Text> nbspNode = Text::create(document(), nonBreakingSpaceString());
insertNodeAt(nbspNode.get(), positionBeforeTextNode);
endingPosition = firstPositionInNode(nbspNode.get());
}
« no previous file with comments | « sky/engine/core/dom/Node.cpp ('k') | sky/engine/core/html/HTMLTitleElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698