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

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

Issue 2442673002: Get rid of createVisibleSelection() taking one Position (Closed)
Patch Set: 2016-10-24T17:42:38 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/BreakBlockquoteCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
index fd960c63a8fba9428bfc6fd6fc729c07f1c0cc33..93a6409ccda19c3cdd8d60d999b8107abb152129 100644
--- a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
@@ -123,8 +123,10 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
return;
document().updateStyleAndLayoutIgnorePendingStylesheets();
setEndingSelection(createVisibleSelection(
- Position::beforeNode(breakElement), TextAffinity::Downstream,
- endingSelection().isDirectional()));
+ SelectionInDOMTree::Builder()
+ .collapse(Position::beforeNode(breakElement))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build()));
rebalanceWhitespace();
return;
}
@@ -140,8 +142,10 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
// need to break the quote.
if (isLastVisPosInNode) {
setEndingSelection(createVisibleSelection(
- Position::beforeNode(breakElement), TextAffinity::Downstream,
- endingSelection().isDirectional()));
+ SelectionInDOMTree::Builder()
+ .collapse(Position::beforeNode(breakElement))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build()));
rebalanceWhitespace();
return;
}
@@ -270,9 +274,11 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
document().updateStyleAndLayoutIgnorePendingStylesheets();
// Put the selection right before the break.
- setEndingSelection(createVisibleSelection(Position::beforeNode(breakElement),
- TextAffinity::Downstream,
- endingSelection().isDirectional()));
+ setEndingSelection(createVisibleSelection(
+ SelectionInDOMTree::Builder()
+ .collapse(Position::beforeNode(breakElement))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build()));
rebalanceWhitespace();
}

Powered by Google App Engine
This is Rietveld 408576698