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

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

Issue 1307803003: Introduce nextPositionOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T18:13:02 Created 5 years, 4 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: Source/core/editing/commands/ApplyStyleCommand.cpp
diff --git a/Source/core/editing/commands/ApplyStyleCommand.cpp b/Source/core/editing/commands/ApplyStyleCommand.cpp
index 8ed28c4947c7b86555a122cac76ed2b1fe1e57af..933df8398fe0a67a0f555f3bfa293582bc7e62d9 100644
--- a/Source/core/editing/commands/ApplyStyleCommand.cpp
+++ b/Source/core/editing/commands/ApplyStyleCommand.cpp
@@ -266,8 +266,8 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
int endIndex = TextIterator::rangeLength(endRange->startPosition(), endRange->endPosition(), true);
VisiblePosition paragraphStart(startOfParagraph(visibleStart));
- VisiblePosition nextParagraphStart(endOfParagraph(paragraphStart).next());
- VisiblePosition beyondEnd(endOfParagraph(visibleEnd).next());
+ VisiblePosition nextParagraphStart(nextPositionOf(endOfParagraph(paragraphStart)));
+ VisiblePosition beyondEnd(nextPositionOf(endOfParagraph(visibleEnd)));
while (paragraphStart.isNotNull() && paragraphStart.deepEquivalent() != beyondEnd.deepEquivalent()) {
StyleChange styleChange(style, paragraphStart.deepEquivalent());
if (styleChange.cssStyle().length() || m_removeOnly) {
@@ -285,11 +285,11 @@ void ApplyStyleCommand::applyBlockStyle(EditingStyle *style)
}
if (nextParagraphStart.isOrphan())
- nextParagraphStart = endOfParagraph(paragraphStart).next();
+ nextParagraphStart = nextPositionOf(endOfParagraph(paragraphStart));
}
paragraphStart = nextParagraphStart;
- nextParagraphStart = endOfParagraph(paragraphStart).next();
+ nextParagraphStart = nextPositionOf(endOfParagraph(paragraphStart));
}
EphemeralRange startEphemeralRange = PlainTextRange(startIndex).createRangeForSelection(toContainerNode(scope));
« no previous file with comments | « Source/core/editing/commands/ApplyBlockElementCommand.cpp ('k') | Source/core/editing/commands/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698