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

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

Issue 1310043003: Introduce previousPositionOf() for VisiblePosition (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2015-08-28T16:28:03 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
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/editing/commands/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/editing/commands/ApplyBlockElementCommand.cpp
diff --git a/Source/core/editing/commands/ApplyBlockElementCommand.cpp b/Source/core/editing/commands/ApplyBlockElementCommand.cpp
index 4ecb424767bd1789f12e366d82967d0fa8036764..20961e6a8b03d3322125008ce92b5448eb7f9dfe 100644
--- a/Source/core/editing/commands/ApplyBlockElementCommand.cpp
+++ b/Source/core/editing/commands/ApplyBlockElementCommand.cpp
@@ -72,10 +72,10 @@ void ApplyBlockElementCommand::doApply()
// ends "inside" that paragraph, so it would be confusing if Indent/Outdent
// operated on that paragraph.
// FIXME: We paint the gap before some paragraphs that are indented with left
- // margin/padding, but not others. We should make the gap painting more consistent and
- // then use a left margin/padding rule here.
+ // margin/padding, but not others. We should make the gap painting more
+ // consistent and then use a left margin/padding rule here.
if (visibleEnd.deepEquivalent() != visibleStart.deepEquivalent() && isStartOfParagraph(visibleEnd)) {
- VisibleSelection newSelection(visibleStart, visibleEnd.previous(CannotCrossEditingBoundary), endingSelection().isDirectional());
+ VisibleSelection newSelection(visibleStart, previousPositionOf(visibleEnd, CannotCrossEditingBoundary), endingSelection().isDirectional());
if (newSelection.isNone())
return;
setEndingSelection(newSelection);
« no previous file with comments | « Source/core/editing/VisibleUnits.cpp ('k') | Source/core/editing/commands/BreakBlockquoteCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698