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

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

Issue 2428363004: Get rid of createVisibleSelection() taking PositionWithAffinity (Closed)
Patch Set: 2016-10-20T14:00:21 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 b3b12ac43eb61b64e270f190d3d1071fc1e5d516..af2a7c66d9d39831292659d4cb51976dffd38738 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -1644,8 +1644,11 @@ void CompositeEditCommand::moveParagraphs(
Position::firstPositionInNode(document().documentElement()),
destination.toParentAnchoredPosition(), true);
- VisibleSelection destinationSelection = createVisibleSelection(
- destination.toPositionWithAffinity(), originalIsDirectional);
+ VisibleSelection destinationSelection =
+ createVisibleSelection(SelectionInDOMTree::Builder()
+ .collapse(destination.toPositionWithAffinity())
+ .setIsDirectional(originalIsDirectional)
+ .build());
if (endingSelection().isNone()) {
// We abort executing command since |destination| becomes invisible.
editingState->abort();
@@ -1869,8 +1872,11 @@ bool CompositeEditCommand::breakOutOfEmptyMailBlockquotedParagraph(
return false;
document().updateStyleAndLayoutIgnorePendingStylesheets();
}
- setEndingSelection(createVisibleSelection(atBR.toPositionWithAffinity(),
- endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelection(
+ SelectionInDOMTree::Builder()
+ .collapse(atBR.toPositionWithAffinity())
+ .setIsDirectional(endingSelection().isDirectional())
+ .build()));
// If this is an empty paragraph there must be a line break here.
if (!lineBreakExistsAtVisiblePosition(caret))

Powered by Google App Engine
This is Rietveld 408576698