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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
index d63e9288696412da24b36cff1814912045b76ce3..7d1dbfd4ab2cac925fbe52931ea9186a49e51ebf 100644
--- a/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ApplyBlockElementCommand.cpp
@@ -85,8 +85,7 @@ void ApplyBlockElementCommand::doApply(EditingState* editingState) {
if (newEnd.isNotNull())
builder.extend(newEnd);
builder.setIsDirectional(endingSelection().isDirectional());
- const VisibleSelection newSelection =
- createVisibleSelection(builder.build());
+ const SelectionInDOMTree& newSelection = builder.build();
if (newSelection.isNone())
return;
setEndingSelection(newSelection);
@@ -116,12 +115,12 @@ void ApplyBlockElementCommand::doApply(EditingState* editingState) {
VisiblePosition start(visiblePositionForIndex(startIndex, startScope));
VisiblePosition end(visiblePositionForIndex(endIndex, endScope));
if (start.isNotNull() && end.isNotNull()) {
- setEndingSelection(createVisibleSelection(
+ setEndingSelection(
SelectionInDOMTree::Builder()
.collapse(start.toPositionWithAffinity())
.extend(end.deepEquivalent())
.setIsDirectional(endingSelection().isDirectional())
- .build()));
+ .build());
}
}
}
@@ -149,12 +148,10 @@ void ApplyBlockElementCommand::formatSelection(
appendNode(placeholder, blockquote, editingState);
if (editingState->isAborted())
return;
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(Position::beforeNode(placeholder))
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(Position::beforeNode(placeholder))
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
return;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/editing/commands/ApplyStyleCommand.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698