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

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

Issue 1690513002: Editing: Pass failure information of RemoveNodeCommand to ReplaceSelectionCommand. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: add a comment Created 4 years, 10 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 aa6415cfc4b807ea6d848c6654fd04253ece6c9c..9cadc76f0020658f3d8394c7f3d8fc40d9a9eeec 100644
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp
@@ -920,7 +920,7 @@ static inline HTMLElement* elementToSplitToAvoidPastingIntoInlineElementsWithSty
return toHTMLElement(highestEnclosingNodeOfType(insertionPos, isInlineHTMLElementWithStyle, CannotCrossEditingBoundary, containingBlock));
}
-void ReplaceSelectionCommand::doApply(EditingState*)
+void ReplaceSelectionCommand::doApply(EditingState* editingState)
{
const VisibleSelection selection = endingSelection();
ASSERT(selection.isCaretOrRange());
@@ -974,7 +974,9 @@ void ReplaceSelectionCommand::doApply(EditingState*)
bool mergeBlocksAfterDelete = startIsInsideMailBlockquote || isEndOfParagraph(visibleEnd) || isStartOfBlock(visibleStart);
// FIXME: We should only expand to include fully selected special elements if we are copying a
// selection and pasting it on top of itself.
- deleteSelection(ASSERT_NO_EDITING_ABORT, false, mergeBlocksAfterDelete, false);
+ deleteSelection(editingState, false, mergeBlocksAfterDelete, false);
+ if (editingState->isAborted())
+ return;
if (fragment.hasInterchangeNewlineAtStart()) {
VisiblePosition startAfterDelete = endingSelection().visibleStart();
if (isEndOfParagraph(startAfterDelete) && !isStartOfParagraph(startAfterDelete) && !isEndOfEditableOrNonEditableContent(startAfterDelete))

Powered by Google App Engine
This is Rietveld 408576698