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); |
} |