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

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

Issue 2724333002: Get rid of VisibleSelection::firstRangeOf() (Closed)
Patch Set: 2017-03-02T16:51:41 Created 3 years, 10 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 4a6ad4ebe8e99d88f69cefa6660e4c857011ab46..d83d5aee41f2677290c9c5860f7d1d4d1c08bc98 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertListCommand.cpp
@@ -184,7 +184,8 @@ void InsertListCommand::doApply(EditingState* editingState) {
startOfParagraph(visibleEndOfSelection, CanSkipOverEditingBoundary)
.deepEquivalent();
- Range* currentSelection = firstRangeOf(endingSelection());
+ Range* currentSelection =
+ createRange(firstEphemeralRangeOf(endingSelection()));
ContainerNode* scopeForStartOfSelection = nullptr;
ContainerNode* scopeForEndOfSelection = nullptr;
// FIXME: This is an inefficient way to keep selection alive because
@@ -296,9 +297,9 @@ void InsertListCommand::doApply(EditingState* editingState) {
return;
}
- DCHECK(firstRangeOf(endingSelection()));
- doApplyForSingleParagraph(false, listTag, *firstRangeOf(endingSelection()),
- editingState);
+ Range* const range = createRange(firstEphemeralRangeOf(endingSelection()));
+ DCHECK(!range);
Xiaocheng 2017/03/02 20:14:29 Remove '!'
yosin_UTC9 2017/03/03 04:22:35 Done. (my brain is still damaged...)
+ doApplyForSingleParagraph(false, listTag, *range, editingState);
}
InputEvent::InputType InsertListCommand::inputType() const {

Powered by Google App Engine
This is Rietveld 408576698