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 120f00edb91517313206fc29f7f3060a85c5169a..14914480fc27cc19e03f73fa6ce583baf6d93871 100644 |
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp |
@@ -150,6 +150,11 @@ void EditCommandComposition::append(SimpleEditCommand* command) |
m_commands.append(command); |
} |
+void EditCommandComposition::append(EditCommandComposition* composition) |
+{ |
+ m_commands.appendVector(composition->m_commands); |
+} |
+ |
void EditCommandComposition::setStartingSelection(const VisibleSelection& selection) |
{ |
m_startingSelection = selection; |
@@ -185,12 +190,14 @@ CompositeEditCommand::~CompositeEditCommand() |
bool CompositeEditCommand::apply() |
{ |
+ DCHECK(!isCommandGroupWrapper()); |
if (!endingSelection().isContentRichlyEditable()) { |
switch (inputType()) { |
case InputEvent::InputType::InsertText: |
case InputEvent::InputType::InsertLineBreak: |
case InputEvent::InputType::InsertParagraph: |
case InputEvent::InputType::InsertFromPaste: |
+ case InputEvent::InputType::InsertFromDrop: |
case InputEvent::InputType::DeleteComposedCharacterForward: |
case InputEvent::InputType::DeleteComposedCharacterBackward: |
case InputEvent::InputType::DeleteWordBackward: |
@@ -200,7 +207,7 @@ bool CompositeEditCommand::apply() |
case InputEvent::InputType::DeleteContentBackward: |
case InputEvent::InputType::DeleteContentForward: |
case InputEvent::InputType::DeleteByCut: |
- case InputEvent::InputType::Drag: |
+ case InputEvent::InputType::DeleteByDrag: |
case InputEvent::InputType::SetWritingDirection: |
case InputEvent::InputType::None: |
break; |
@@ -252,6 +259,16 @@ bool CompositeEditCommand::isTypingCommand() const |
return false; |
} |
+bool CompositeEditCommand::isCommandGroupWrapper() const |
+{ |
+ return false; |
+} |
+ |
+bool CompositeEditCommand::isDragAndDropCommand() const |
+{ |
+ return false; |
+} |
+ |
bool CompositeEditCommand::isReplaceSelectionCommand() const |
{ |
return false; |
@@ -291,6 +308,13 @@ void CompositeEditCommand::applyCommandToComposite(CompositeEditCommand* command |
m_commands.append(command); |
} |
+void CompositeEditCommand::appendCommandToComposite(CompositeEditCommand* command) |
+{ |
+ ensureComposition()->append(command->ensureComposition()); |
+ command->setParent(this); |
+ m_commands.append(command); |
+} |
+ |
void CompositeEditCommand::applyStyle(const EditingStyle* style, EditingState* editingState) |
{ |
applyCommandToComposite(ApplyStyleCommand::create(document(), style, InputEvent::InputType::ChangeAttributes), editingState); |