Index: third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
diff --git a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
index c59b7d0c3f5f3f4fdab38629e7fae48b91f228fe..a1abd30b3395969b19f5e5528b2b0e638d7fe439 100644 |
--- a/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
+++ b/third_party/WebKit/Source/core/editing/commands/ReplaceSelectionCommand.cpp |
@@ -2126,6 +2126,22 @@ EphemeralRange ReplaceSelectionCommand::insertedRange() const { |
return EphemeralRange(m_startOfInsertedRange, m_endOfInsertedRange); |
} |
+String ReplaceSelectionCommand::textDataForInputEvent() const { |
+ return m_documentFragment->textContent(); |
chongz
2016/12/20 23:27:53
New implementation.
Xiaocheng
2016/12/21 02:56:39
What text data does the current implementation use
chongz
2016/12/21 23:59:24
Sorry for the confusion, this is actually the curr
|
+} |
+ |
+DataTransfer* ReplaceSelectionCommand::dataTransferForInputEvent() const { |
+ switch (m_inputType) { |
+ case InputEvent::InputType::InsertFromPaste: |
+ case InputEvent::InputType::InsertFromDrop: |
+ case InputEvent::InputType::InsertReplacementText: |
+ return DataTransfer::createForInputEvent( |
+ textDataForInputEvent(), createMarkup(m_documentFragment)); |
chongz
2016/12/20 23:27:53
New implementation.
Xiaocheng
2016/12/21 02:56:39
Similar question as above.
chongz
2016/12/21 23:59:24
Similar answer as above.
|
+ default: |
+ return CompositeEditCommand::dataTransferForInputEvent(); |
+ } |
+} |
+ |
DEFINE_TRACE(ReplaceSelectionCommand) { |
visitor->trace(m_startOfInsertedContent); |
visitor->trace(m_endOfInsertedContent); |