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

Unified Diff: third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.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/DeleteSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
index 9a5cbda86609f4f28a9178f4c6623826a2eee489..acd66a8cc3f90ba64b6c27c1c39c2817d1b6815f 100644
--- a/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp
@@ -110,7 +110,7 @@ void DeleteSelectionCommand::initializeStartEnd(Position& start, Position& end)
// For HRs, we'll get a position at (HR,1) when hitting delete from the beginning of the previous line, or (HR,0) when forward deleting,
// but in these cases, we want to delete it, so manually expand the selection
if (isHTMLHRElement(*start.anchorNode()))
- start = positionBeforeNode(start.anchorNode());
+ start = Position::beforeNode(start.anchorNode());
else if (isHTMLHRElement(*end.anchorNode()))
end = Position::afterNode(end.anchorNode());
@@ -324,7 +324,7 @@ bool DeleteSelectionCommand::handleSpecialCaseBRDelete(EditingState* editingStat
// FIXME: This code doesn't belong in here.
// We detect the case where the start is an empty line consisting of BR not wrapped in a block element.
- if (upstreamStartIsBR && downstreamStartIsBR && !(isStartOfBlock(createVisiblePosition(positionBeforeNode(nodeAfterUpstreamStart))) && isEndOfBlock(createVisiblePosition(Position::afterNode(nodeAfterUpstreamStart))))) {
+ if (upstreamStartIsBR && downstreamStartIsBR && !(isStartOfBlock(createVisiblePosition(Position::beforeNode(nodeAfterUpstreamStart))) && isEndOfBlock(createVisiblePosition(Position::afterNode(nodeAfterUpstreamStart))))) {
m_startsAtEmptyLine = true;
m_endingPosition = m_downstreamEnd;
}

Powered by Google App Engine
This is Rietveld 408576698