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

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

Issue 2450213002: Utilize EditCommand::setEndingSelection() taking SelectionInDOMTree (Closed)
Patch Set: 2016-10-28T14:44:14 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 93a6409ccda19c3cdd8d60d999b8107abb152129..5a239feeab99cde4e899e5064f4147929a3725f1 100644
--- a/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/BreakBlockquoteCommand.cpp
@@ -121,12 +121,10 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
insertNodeBefore(breakElement, topBlockquote, editingState);
if (editingState->isAborted())
return;
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(Position::beforeNode(breakElement))
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(Position::beforeNode(breakElement))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
rebalanceWhitespace();
return;
}
@@ -141,11 +139,10 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
// If we're inserting the break at the end of the quoted content, we don't
// need to break the quote.
if (isLastVisPosInNode) {
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(Position::beforeNode(breakElement))
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(Position::beforeNode(breakElement))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
rebalanceWhitespace();
return;
}
@@ -186,12 +183,10 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
// If there's nothing inside topBlockquote to move, we're finished.
if (!startNode->isDescendantOf(topBlockquote)) {
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(firstPositionInOrBeforeNode(startNode))
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(firstPositionInOrBeforeNode(startNode))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
return;
}
@@ -271,14 +266,11 @@ void BreakBlockquoteCommand::doApply(EditingState* editingState) {
if (editingState->isAborted())
return;
- document().updateStyleAndLayoutIgnorePendingStylesheets();
-
// Put the selection right before the break.
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(Position::beforeNode(breakElement))
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(Position::beforeNode(breakElement))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
rebalanceWhitespace();
}

Powered by Google App Engine
This is Rietveld 408576698