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

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

Issue 2451613003: Get rid of createVisibleSelection() taking two Position (Closed)
Patch Set: 2016-10-26T15:09:55 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/CompositeEditCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
index 8c2d21feb0b7689b08d70bc88f8d6ef79560abcd..6d872a4d4de20e5f238b3a37c11f0fd591a90365 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -1439,7 +1439,8 @@ void CompositeEditCommand::moveParagraphWithClones(
document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(start, end));
+ setEndingSelection(createVisibleSelection(
+ SelectionInDOMTree::Builder().collapse(start).extend(end).build()));
deleteSelection(editingState, false, false, false);
if (editingState->isAborted())
return;
@@ -1598,7 +1599,8 @@ void CompositeEditCommand::moveParagraphs(
DCHECK(!document().needsLayoutTreeUpdate());
- setEndingSelection(createVisibleSelection(start, end));
+ setEndingSelection(createVisibleSelection(
+ SelectionInDOMTree::Builder().collapse(start).extend(end).build()));
document()
.frame()
->spellChecker()
@@ -1709,9 +1711,12 @@ void CompositeEditCommand::moveParagraphs(
.createRangeForSelection(*documentElement);
if (endRange.isNull())
return;
- setEndingSelection(createVisibleSelection(
- startRange.startPosition(), endRange.startPosition(),
- TextAffinity::Downstream, originalIsDirectional));
+ setEndingSelection(
+ createVisibleSelection(SelectionInDOMTree::Builder()
+ .collapse(startRange.startPosition())
+ .extend(endRange.startPosition())
+ .setIsDirectional(originalIsDirectional)
+ .build()));
}
// FIXME: Send an appropriate shouldDeleteRange call.

Powered by Google App Engine
This is Rietveld 408576698