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

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

Issue 1684733003: Editing: Pass failure information of CompositeEditCommand::deleteSelection() to TypingCommand::doAp… (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/TypingCommand.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
diff --git a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
index 4fda678221102701737d0b8907a6ec3368860e0e..1909155b4475e573a327cd96a4d393df72842467 100644
--- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
@@ -120,7 +120,7 @@ void TypingCommand::deleteKeyPressed(Document& document, Options options, TextGr
if (lastTypingCommand->commandTypeOfOpenCommand() == DeleteKey) {
updateSelectionIfDifferentFromCurrentSelection(lastTypingCommand.get(), frame);
lastTypingCommand->setShouldPreventSpellChecking(options & PreventSpellChecking);
- lastTypingCommand->deleteKeyPressed(granularity, options & KillRing);
+ lastTypingCommand->deleteKeyPressed(granularity, options & KillRing, ASSERT_NO_EDITING_ABORT);
return;
}
}
@@ -246,7 +246,7 @@ void TypingCommand::closeTyping(LocalFrame* frame)
lastTypingCommand->closeTyping();
}
-void TypingCommand::doApply(EditingState*)
+void TypingCommand::doApply(EditingState* editingState)
{
if (!endingSelection().isNonOrphanedCaretOrRange())
return;
@@ -261,7 +261,7 @@ void TypingCommand::doApply(EditingState*)
deleteSelection(m_smartDelete);
return;
case DeleteKey:
- deleteKeyPressed(m_granularity, m_killRing);
+ deleteKeyPressed(m_granularity, m_killRing, editingState);
return;
case ForwardDeleteKey:
forwardDeleteKeyPressed(m_granularity, m_killRing);
@@ -408,7 +408,7 @@ bool TypingCommand::makeEditableRootEmpty()
return true;
}
-void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
+void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing, EditingState* editingState)
{
LocalFrame* frame = document().frame();
if (!frame)
@@ -508,7 +508,9 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity, bool killRing)
// more text than you insert. In that case all of the text that was around originally should be selected.
if (frame->editor().behavior().shouldUndoOfDeleteSelectText() && m_openedByBackwardDelete)
setStartingSelection(selectionAfterUndo);
- CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete);
+ CompositeEditCommand::deleteSelection(selectionToDelete, editingState, m_smartDelete);
+ if (editingState->isAborted())
+ return;
setSmartDelete(false);
typingAddedToOpenCommand(DeleteKey);
}
@@ -598,7 +600,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity, bool ki
// Make undo select what was deleted on Mac alone
if (frame->editor().behavior().shouldUndoOfDeleteSelectText())
setStartingSelection(selectionAfterUndo);
- CompositeEditCommand::deleteSelection(selectionToDelete, m_smartDelete);
+ CompositeEditCommand::deleteSelection(selectionToDelete, ASSERT_NO_EDITING_ABORT, m_smartDelete);
setSmartDelete(false);
typingAddedToOpenCommand(ForwardDeleteKey);
}
« no previous file with comments | « third_party/WebKit/Source/core/editing/commands/TypingCommand.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698