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

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

Issue 2617753002: [InputEvent] Move attributes from |EditCommand| to |CompositeEditCommand| (2/11) (Closed)
Patch Set: Created 3 years, 11 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 007db2918c2625ba6ae8457123a26191281eaab7..9af08b291ac18bf1eda46a5e6735b82b10f32a4b 100644
--- a/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
+++ b/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp
@@ -56,6 +56,7 @@
#include "core/editing/commands/SplitElementCommand.h"
#include "core/editing/commands/SplitTextNodeCommand.h"
#include "core/editing/commands/SplitTextNodeContainingElementCommand.h"
+#include "core/editing/commands/TypingCommand.h"
#include "core/editing/commands/WrapContentsInDummySpanCommand.h"
#include "core/editing/iterators/TextIterator.h"
#include "core/editing/markers/DocumentMarkerController.h"
@@ -269,6 +270,28 @@ bool CompositeEditCommand::willApplyEditing(EditCommandSource,
return true;
}
+InputEvent::InputType CompositeEditCommand::inputType() const {
+ return InputEvent::InputType::None;
+}
+
+String CompositeEditCommand::textDataForInputEvent() const {
+ return nullAtom;
+}
+
+DataTransfer* CompositeEditCommand::dataTransferForInputEvent() const {
+ return nullptr;
+}
+
+RangeVector* CompositeEditCommand::targetRangesForInputEvent() const {
+ // TODO(chongz): We should return current selection for ContentEditable if no
+ // better choice.
+ // https://crbug.com/652429
+ if (inputType() == InputEvent::InputType::InsertReplacementText &&
+ document().frame()->editor().canEditRichly())
+ return new RangeVector(1, document().frame()->selection().firstRange());
+ return nullptr;
+}
+
bool CompositeEditCommand::preservesTypingStyle() const {
return false;
}

Powered by Google App Engine
This is Rietveld 408576698