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

Unified Diff: Source/core/editing/InsertTextCommand.cpp

Issue 420603002: Use tighter typing in editing/ (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Rebase Created 6 years, 5 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 | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/ReplaceSelectionCommand.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/InsertTextCommand.cpp
diff --git a/Source/core/editing/InsertTextCommand.cpp b/Source/core/editing/InsertTextCommand.cpp
index b01cd9ea40aada9f2dcf483617e2f2a9af0cb664..e7f1c68b552c6405f7cc857824f787ad1ff4d613 100644
--- a/Source/core/editing/InsertTextCommand.cpp
+++ b/Source/core/editing/InsertTextCommand.cpp
@@ -33,6 +33,7 @@
#include "core/editing/VisibleUnits.h"
#include "core/editing/htmlediting.h"
#include "core/frame/LocalFrame.h"
+#include "core/html/HTMLSpanElement.h"
namespace blink {
@@ -243,15 +244,15 @@ Position InsertTextCommand::insertTab(const Position& pos)
}
// create new tab span
- RefPtrWillBeRawPtr<Element> spanNode = createTabSpanElement(document());
+ RefPtrWillBeRawPtr<HTMLSpanElement> spanElement = createTabSpanElement(document());
// place it
if (!node->isTextNode()) {
- insertNodeAt(spanNode.get(), insertPos);
+ insertNodeAt(spanElement.get(), insertPos);
} else {
RefPtrWillBeRawPtr<Text> textNode = toText(node);
if (offset >= textNode->length())
- insertNodeAfter(spanNode, textNode.release());
+ insertNodeAfter(spanElement, textNode.release());
else {
// split node to make room for the span
// NOTE: splitTextNode uses textNode for the
@@ -259,12 +260,12 @@ Position InsertTextCommand::insertTab(const Position& pos)
// insert the span before it.
if (offset > 0)
splitTextNode(textNode, offset);
- insertNodeBefore(spanNode, textNode.release());
+ insertNodeBefore(spanElement, textNode.release());
}
}
// return the position following the new tab
- return lastPositionInNode(spanNode.get());
+ return lastPositionInNode(spanElement.get());
}
}
« no previous file with comments | « Source/core/editing/InsertListCommand.cpp ('k') | Source/core/editing/ReplaceSelectionCommand.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698