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

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

Issue 2558643003: [InputEvent] Move 'beforeinput' logic into |CompositeEditCommand::willApplyEditing()| (3/3) (Closed)
Patch Set: xiaocheng's review 3: Rebase and remove updateStyleAndLayoutIgnorePendingStylesheets() Created 4 years 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/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 13c1cbdb9e22ac3f62d0301efcd3138549d45a62..e05a40d80742c344bf208213385a58a5df3259f9 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();
+}
+
+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));
+ default:
+ return CompositeEditCommand::dataTransferForInputEvent();
+ }
+}
+
DEFINE_TRACE(ReplaceSelectionCommand) {
visitor->trace(m_startOfInsertedContent);
visitor->trace(m_endOfInsertedContent);

Powered by Google App Engine
This is Rietveld 408576698