| 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 e47b8b27d0ba607435d0a760bdd461d957cb98f9..239d2ecf2d7bc16c429202d15e71ca9ac56ceddf 100644
|
| --- a/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/commands/TypingCommand.cpp
|
| @@ -36,6 +36,7 @@
|
| #include "core/editing/VisiblePosition.h"
|
| #include "core/editing/VisibleUnits.h"
|
| #include "core/editing/commands/BreakBlockquoteCommand.h"
|
| +#include "core/editing/commands/DeleteSelectionCommand.h"
|
| #include "core/editing/commands/InsertIncrementalTextCommand.h"
|
| #include "core/editing/commands/InsertLineBreakCommand.h"
|
| #include "core/editing/commands/InsertParagraphSeparatorCommand.h"
|
| @@ -175,6 +176,20 @@ void TypingCommand::deleteSelection(Document& document, Options options) {
|
| TypingCommand::create(document, DeleteSelection, "", options)->apply();
|
| }
|
|
|
| +void TypingCommand::deleteSelectionIfRange(const VisibleSelection& selection,
|
| + EditingState* editingState,
|
| + bool smartDelete,
|
| + bool mergeBlocksAfterDelete,
|
| + bool expandForSpecialElements,
|
| + bool sanitizeMarkup) {
|
| + if (!selection.isRange())
|
| + return;
|
| + applyCommandToComposite(DeleteSelectionCommand::create(
|
| + selection, smartDelete, mergeBlocksAfterDelete,
|
| + expandForSpecialElements, sanitizeMarkup),
|
| + editingState);
|
| +}
|
| +
|
| void TypingCommand::deleteKeyPressed(Document& document,
|
| Options options,
|
| TextGranularity granularity) {
|
| @@ -813,8 +828,7 @@ void TypingCommand::deleteKeyPressed(TextGranularity granularity,
|
| if (frame->editor().behavior().shouldUndoOfDeleteSelectText() &&
|
| m_openedByBackwardDelete)
|
| setStartingSelection(selectionAfterUndo);
|
| - CompositeEditCommand::deleteSelection(selectionToDelete, editingState,
|
| - m_smartDelete);
|
| + deleteSelectionIfRange(selectionToDelete, editingState, m_smartDelete);
|
| if (editingState->isAborted())
|
| return;
|
| setSmartDelete(false);
|
| @@ -941,8 +955,7 @@ void TypingCommand::forwardDeleteKeyPressed(TextGranularity granularity,
|
| // Make undo select what was deleted on Mac alone
|
| if (frame->editor().behavior().shouldUndoOfDeleteSelectText())
|
| setStartingSelection(selectionAfterUndo);
|
| - CompositeEditCommand::deleteSelection(selectionToDelete, editingState,
|
| - m_smartDelete);
|
| + deleteSelectionIfRange(selectionToDelete, editingState, m_smartDelete);
|
| if (editingState->isAborted())
|
| return;
|
| setSmartDelete(false);
|
|
|