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

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

Issue 2451093002: Get rid of EditCommand::setEndingSelection() taking one VisiblePosition (Closed)
Patch Set: 2016-10-26T16:39:39 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/InsertListCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
index 799b67dc1bdd03601102179e1ef1c88ede986ba7..d40ee973811632974e06d3b6aef33227e8c20961 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
@@ -216,7 +216,10 @@ void InsertListCommand::doApply(EditingState* editingState) {
// and use it as the end of the new selection.
if (!startOfLastParagraph.isConnected())
return;
- setEndingSelection(startOfCurrentParagraph);
+ setEndingSelection(
+ SelectionInDOMTree::Builder()
+ .collapse(startOfCurrentParagraph.deepEquivalent())
+ .build());
// Save and restore visibleEndOfSelection and startOfLastParagraph when
// necessary since moveParagraph and movePragraphWithClones can remove
@@ -253,7 +256,9 @@ void InsertListCommand::doApply(EditingState* editingState) {
startOfCurrentParagraph =
startOfNextParagraph(endingSelection().visibleStart());
}
- setEndingSelection(visibleEndOfSelection);
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(visibleEndOfSelection.deepEquivalent())
+ .build());
}
doApplyForSingleParagraph(forceListCreation, listTag, *currentSelection,
editingState);
@@ -411,8 +416,9 @@ bool InsertListCommand::doApplyForSingleParagraph(
currentSelection.setEnd(newList, Position::lastOffsetInNode(newList),
IGNORE_EXCEPTION);
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(VisiblePosition::firstPositionInNode(newList));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(Position::firstPositionInNode(newList))
+ .build());
return true;
}

Powered by Google App Engine
This is Rietveld 408576698