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

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: Yosin's review 2 Created 4 years, 2 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 84765323156dcf6078e143ed189a390c12142f37..448c3b9fda768de6bbe14a0f0d9e6b4e4a2b2c0c 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -150,6 +150,10 @@ 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;
@@ -180,12 +184,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:
@@ -195,7 +201,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;
@@ -245,6 +251,14 @@ bool CompositeEditCommand::isTypingCommand() const {
return false;
}
+bool CompositeEditCommand::isCommandGroupWrapper() const {
+ return false;
+}
+
+bool CompositeEditCommand::isDragAndDropCommand() const {
+ return false;
+}
+
bool CompositeEditCommand::isReplaceSelectionCommand() const {
return false;
}
@@ -283,6 +297,13 @@ void CompositeEditCommand::applyCommandToComposite(
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(

Powered by Google App Engine
This is Rietveld 408576698