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

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

Issue 291143002: Don't indent if selection is none. (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: 2014-05-20T05:00:38 Created 6 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: Source/core/editing/ApplyBlockElementCommand.cpp
diff --git a/Source/core/editing/ApplyBlockElementCommand.cpp b/Source/core/editing/ApplyBlockElementCommand.cpp
index 5ecf67a627649d9769d1236f31b5f777fb76fb77..fe35eb03de3df545c81e1fc978509a646d16320c 100644
--- a/Source/core/editing/ApplyBlockElementCommand.cpp
+++ b/Source/core/editing/ApplyBlockElementCommand.cpp
@@ -73,8 +73,11 @@ void ApplyBlockElementCommand::doApply()
// 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.
- if (visibleEnd != visibleStart && isStartOfParagraph(visibleEnd))
+ if (visibleEnd != visibleStart && isStartOfParagraph(visibleEnd)) {
setEndingSelection(VisibleSelection(visibleStart, visibleEnd.previous(CannotCrossEditingBoundary), endingSelection().isDirectional()));
+ if (endingSelection().isNone())
Yuta Kitamura 2014/05/20 09:44:36 Is this logic equivalent to the following? Vi
yosin_UTC9 2014/05/21 03:44:07 Done. Yes, you're right. Your version is better t
+ return;
+ }
VisibleSelection selection = selectionForParagraphIteration(endingSelection());
VisiblePosition startOfSelection = selection.visibleStart();

Powered by Google App Engine
This is Rietveld 408576698