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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp

Issue 1997563002: Get rid of a redundant function alias positionBeforeNode() (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 2016-05-19T22:35:34 rebase Created 4 years, 7 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
Index: third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
index c40a7180e85d0e4f9495ed492b178bfb3e32ed40..30af03f2c1bf9b80d36ec9f6090e0c43729985ec 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -942,7 +942,7 @@ bool ApplyStyleCommand::shouldApplyInlineStyleToRun(EditingStyle* style, Node* r
// We don't consider m_isInlineElementToRemoveFunction here because we never apply style when m_isInlineElementToRemoveFunction is specified
if (!style->styleIsPresentInComputedStyleOfNode(node))
return true;
- if (m_styledInlineElement && !enclosingElementWithTag(positionBeforeNode(node), m_styledInlineElement->tagQName()))
+ if (m_styledInlineElement && !enclosingElementWithTag(Position::beforeNode(node), m_styledInlineElement->tagQName()))
return true;
}
return false;
@@ -1344,7 +1344,7 @@ void ApplyStyleCommand::splitTextElementAtStart(const Position& start, const Pos
newEnd = end;
splitTextNodeContainingElement(toText(start.computeContainerNode()), start.offsetInContainerNode());
- updateStartEnd(positionBeforeNode(start.computeContainerNode()), newEnd);
+ updateStartEnd(Position::beforeNode(start.computeContainerNode()), newEnd);
}
void ApplyStyleCommand::splitTextElementAtEnd(const Position& start, const Position& end)
@@ -1556,10 +1556,10 @@ Position ApplyStyleCommand::positionToComputeInlineStyleChange(Node* startNode,
// It's okay to obtain the style at the startNode because we've removed all relevant styles from the current run.
if (!startNode->isElementNode()) {
dummyElement = HTMLSpanElement::create(document());
- insertNodeAt(dummyElement, positionBeforeNode(startNode), editingState);
+ insertNodeAt(dummyElement, Position::beforeNode(startNode), editingState);
if (editingState->isAborted())
return Position();
- return positionBeforeNode(dummyElement);
+ return Position::beforeNode(dummyElement);
}
return firstPositionInOrBeforeNode(startNode);

Powered by Google App Engine
This is Rietveld 408576698