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 25acb328504464c1ea1f1dd7ea270a5ad58c23d0..7dc52d43d4c4221f51832f85949df02bbf5b34b9 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; |
@@ -191,6 +196,7 @@ bool CompositeEditCommand::apply() |
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 +206,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; |
@@ -291,6 +297,13 @@ void CompositeEditCommand::applyCommandToComposite(CompositeEditCommand* command |
m_commands.append(command); |
} |
+void CompositeEditCommand::appendCommandToComposite(CompositeEditCommand* command) |
yosin_UTC9
2016/09/28 04:19:03
Good invention!
We can implement Undo/Redo for dra
chongz
2016/09/29 02:36:22
Thanks! :>
|
+{ |
+ 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); |