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

Unified Diff: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.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/ReplaceSelectionCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
index 111f99f500c8fdbcfbccd4ebdf19219354c29551..680124d6f0e313ab8289ee1f8093904af88ee9fd 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -1872,26 +1872,22 @@ void ReplaceSelectionCommand::completeHTMLReplacement(
m_startOfInsertedRange = start;
m_endOfInsertedRange = end;
- document().updateStyleAndLayoutIgnorePendingStylesheets();
-
if (m_selectReplacement) {
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .setBaseAndExtentDeprecated(start, end)
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .setBaseAndExtentDeprecated(start, end)
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
return;
}
if (end.isNotNull()) {
- setEndingSelection(createVisibleSelection(
- SelectionInDOMTree::Builder()
- .collapse(end)
- .setIsDirectional(endingSelection().isDirectional())
- .build()));
+ setEndingSelection(SelectionInDOMTree::Builder()
+ .collapse(end)
+ .setIsDirectional(endingSelection().isDirectional())
+ .build());
return;
}
- setEndingSelection(createVisibleSelection(SelectionInDOMTree()));
+ setEndingSelection(SelectionInDOMTree());
}
void ReplaceSelectionCommand::mergeTextNodesAroundPosition(
@@ -2099,14 +2095,11 @@ bool ReplaceSelectionCommand::performTrivialReplace(
m_startOfInsertedRange = start;
m_endOfInsertedRange = end;
- document().updateStyleAndLayoutIgnorePendingStylesheets();
- VisibleSelection selectionAfterReplace = createVisibleSelection(
+ setEndingSelection(
SelectionInDOMTree::Builder()
.setBaseAndExtentDeprecated(m_selectReplacement ? start : end, end)
.build());
- setEndingSelection(selectionAfterReplace);
-
return true;
}

Powered by Google App Engine
This is Rietveld 408576698