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

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

Issue 2724333002: Get rid of VisibleSelection::firstRangeOf() (Closed)
Patch Set: 2017-03-03T13:18:27 DCHECK(!range) => DCHECK(range) 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..bef69781f5aaa91504d976afe249e4422d3b5b11 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);
+ doApplyForSingleParagraph(false, listTag, *range, editingState);
}
InputEvent::InputType InsertListCommand::inputType() const {

Powered by Google App Engine
This is Rietveld 408576698