Chromium Code Reviews| Index: third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| diff --git a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| index 29a17ac75d586f4724334baaaa8010122d4aa1ac..9a23b5229e635b613d77d69841e0ecc2d15c0cc4 100644 |
| --- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| +++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
| @@ -201,8 +201,9 @@ bool CompositeEditCommand::apply() { |
| case InputEvent::InputType::DeleteComposedCharacterBackward: |
| case InputEvent::InputType::DeleteWordBackward: |
| case InputEvent::InputType::DeleteWordForward: |
| - case InputEvent::InputType::DeleteLineBackward: |
| - case InputEvent::InputType::DeleteLineForward: |
| + case InputEvent::InputType::DeleteSoftLineBackward: |
| + case InputEvent::InputType::DeleteSoftLineForward: |
| + case InputEvent::InputType::DeleteContent: |
| case InputEvent::InputType::DeleteContentBackward: |
| case InputEvent::InputType::DeleteContentForward: |
| case InputEvent::InputType::DeleteByCut: |
| @@ -223,6 +224,11 @@ bool CompositeEditCommand::apply() { |
| // the creation of VisiblePositions). |
| document().updateStyleAndLayoutIgnorePendingStylesheets(); |
| + // Covers the initial TypingCommand and other top-level commands. |
| + // See TypingCommand::willAddTypingToOpenCommand(). |
| + if (!willApply()) |
| + return false; |
| + |
| LocalFrame* frame = document().frame(); |
| DCHECK(frame); |
| EditingState editingState; |
| @@ -430,6 +436,12 @@ void CompositeEditCommand::insertNodeAt(Node* insertChild, |
| } |
| } |
| +bool CompositeEditCommand::willApply() { |
| + LocalFrame* frame = document().frame(); |
| + DCHECK(frame); |
|
yosin_UTC9
2016/12/07 07:51:27
No need to have |DCHECK(frame)| since next line us
chongz
2016/12/07 15:22:21
Done.
|
| + return frame->editor().willApplyEditing(this); |
| +} |
| + |
| void CompositeEditCommand::appendNode(Node* node, |
| ContainerNode* parent, |
| EditingState* editingState) { |