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

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

Issue 2442673002: Get rid of createVisibleSelection() taking one Position (Closed)
Patch Set: 2016-10-24T17:42:38 Created 4 years, 2 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/IndentOutdentCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
index 664f076860efbba012ac785da04fc416233cf0fb..553f61567915c277b40f8f4659956c7237c1d0c5 100644
--- a/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/IndentOutdentCommand.cpp
@@ -345,8 +345,10 @@ void IndentOutdentCommand::outdentRegion(
.toPositionWithAffinity();
if (endOfCurrentParagraph.deepEquivalent() ==
endOfLastParagraph.deepEquivalent()) {
- setEndingSelection(createVisibleSelection(originalSelectionEnd,
- TextAffinity::Downstream));
+ SelectionInDOMTree::Builder builder;
+ if (originalSelectionEnd.isNotNull())
+ builder.collapse(originalSelectionEnd);
+ setEndingSelection(createVisibleSelection(builder.build()));
} else {
setEndingSelection(endOfCurrentParagraph);
}

Powered by Google App Engine
This is Rietveld 408576698