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

Unified Diff: Source/core/editing/ReplaceSelectionCommand.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/ReplaceSelectionCommand.h ('k') | Source/core/editing/SpellChecker.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/ReplaceSelectionCommand.cpp
diff --git a/Source/core/editing/ReplaceSelectionCommand.cpp b/Source/core/editing/ReplaceSelectionCommand.cpp
index 47617e8e5b2e2f7247e1d3845c56f7ed7a6c8a28..73ead8cbff608831865bdf50e0ba2df579f5f5ed 100644
--- a/Source/core/editing/ReplaceSelectionCommand.cpp
+++ b/Source/core/editing/ReplaceSelectionCommand.cpp
@@ -636,7 +636,7 @@ void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild
continue;
if (isProhibitedParagraphChild(toHTMLElement(node)->localName())) {
- if (HTMLElement* paragraphElement = toHTMLElement(enclosingNodeWithTag(positionInParentBeforeNode(*node), pTag)))
+ if (HTMLElement* paragraphElement = toHTMLElement(enclosingElementWithTag(positionInParentBeforeNode(*node), pTag)))
moveNodeOutOfAncestor(node, paragraphElement);
}
@@ -647,7 +647,7 @@ void ReplaceSelectionCommand::makeInsertedContentRoundTrippableWithHTMLTreeBuild
}
}
-void ReplaceSelectionCommand::moveNodeOutOfAncestor(PassRefPtrWillBeRawPtr<Node> prpNode, PassRefPtrWillBeRawPtr<Node> prpAncestor)
+void ReplaceSelectionCommand::moveNodeOutOfAncestor(PassRefPtrWillBeRawPtr<Node> prpNode, PassRefPtrWillBeRawPtr<ContainerNode> prpAncestor)
{
RefPtrWillBeRawPtr<Node> node = prpNode;
RefPtrWillBeRawPtr<Node> ancestor = prpAncestor;
@@ -683,8 +683,8 @@ void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
Node* lastLeafInserted = insertedNodes.lastLeafInserted();
if (lastLeafInserted && lastLeafInserted->isTextNode() && !nodeHasVisibleRenderText(toText(*lastLeafInserted))
- && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
- && !enclosingNodeWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) {
+ && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), selectTag)
+ && !enclosingElementWithTag(firstPositionInOrBeforeNode(lastLeafInserted), scriptTag)) {
insertedNodes.willRemoveNode(*lastLeafInserted);
removeNode(lastLeafInserted);
}
@@ -701,7 +701,7 @@ void ReplaceSelectionCommand::removeUnrenderedTextNodesAtEnds(InsertedNodes& ins
VisiblePosition ReplaceSelectionCommand::positionAtEndOfInsertedContent() const
{
// FIXME: Why is this hack here? What's special about <select> tags?
- Node* enclosingSelect = enclosingNodeWithTag(m_endOfInsertedContent, selectTag);
+ Element* enclosingSelect = enclosingElementWithTag(m_endOfInsertedContent, selectTag);
return VisiblePosition(enclosingSelect ? lastPositionInOrAfterNode(enclosingSelect) : m_endOfInsertedContent);
}
@@ -899,8 +899,8 @@ static bool isInlineNodeWithStyle(const Node* node)
inline Node* nodeToSplitToAvoidPastingIntoInlineNodesWithStyle(const Position& insertionPos)
{
- Node* containgBlock = enclosingBlock(insertionPos.containerNode());
- return highestEnclosingNodeOfType(insertionPos, isInlineNodeWithStyle, CannotCrossEditingBoundary, containgBlock);
+ Element* containingBlock = enclosingBlock(insertionPos.containerNode());
+ return highestEnclosingNodeOfType(insertionPos, isInlineNodeWithStyle, CannotCrossEditingBoundary, containingBlock);
}
void ReplaceSelectionCommand::doApply()
@@ -1149,7 +1149,7 @@ void ReplaceSelectionCommand::doApply()
insertNodeAt(createBreakElement(document()).get(), startOfInsertedContent.deepEquivalent());
if (endBR && (plainTextFragment || (shouldRemoveEndBR(endBR, originalVisPosBeforeEndBR) && !(fragment.hasInterchangeNewlineAtEnd() && selectionIsPlainText)))) {
- RefPtrWillBeRawPtr<Node> parent = endBR->parentNode();
+ RefPtrWillBeRawPtr<ContainerNode> parent = endBR->parentNode();
insertedNodes.willRemoveNode(*endBR);
removeNode(endBR);
if (Node* nodeToRemove = highestNodeToRemoveInPruning(parent.get())) {
« no previous file with comments | « Source/core/editing/ReplaceSelectionCommand.h ('k') | Source/core/editing/SpellChecker.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698