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

Unified Diff: third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.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/InsertParagraphSeparatorCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
index ddf2f4e92ae8fd9c978eef2529e3ad5518f69b3c..ff2e6a09079c510e35f5016ef5a3538d3ab37668 100644
--- a/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/InsertParagraphSeparatorCommand.cpp
@@ -323,12 +323,10 @@ void InsertParagraphSeparatorCommand::doApply(EditingState* editingState) {
if (editingState->isAborted())
return;
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(Position::firstPositionInNode(parent))
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(Position::firstPositionInNode(parent))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
return;
}
@@ -394,12 +392,10 @@ void InsertParagraphSeparatorCommand::doApply(EditingState* editingState) {
return;
// In this case, we need to set the new ending selection.
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(insertionPosition)
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(insertionPosition)
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
return;
}
@@ -422,11 +418,11 @@ void InsertParagraphSeparatorCommand::doApply(EditingState* editingState) {
// If the insertion point is a break element, there is nothing else
// we need to do.
if (visiblePos.deepEquivalent().anchorNode()->layoutObject()->isBR()) {
- setEndingSelection(createVisibleSelection(
+ setEndingSelection(
SelectionInDOMTree::Builder()
.collapse(insertionPosition)
.setIsDirectional(endingSelection().isDirectional())
- .build()));
+ .build());
return;
}
}
@@ -573,12 +569,10 @@ void InsertParagraphSeparatorCommand::doApply(EditingState* editingState) {
}
}
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(Position::firstPositionInNode(blockToInsert))
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(Position::firstPositionInNode(blockToInsert))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
applyStyleAfterInsertion(startBlock, editingState);
}

Powered by Google App Engine
This is Rietveld 408576698