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

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

Issue 2374743002: [InputEvent] Support |deleteByDrag|, |insertFromDrop| and fire in sequential order (Closed)
Patch Set: Created 4 years, 3 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
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);

Powered by Google App Engine
This is Rietveld 408576698