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

Unified Diff: third_party/WebKit/Source/core/editing/Editor.cpp

Issue 2693863003: [InputEvent] Change |getTargetRanges()| to return current selection by default (Closed)
Patch Set: Created 3 years, 10 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/Editor.cpp
diff --git a/third_party/WebKit/Source/core/editing/Editor.cpp b/third_party/WebKit/Source/core/editing/Editor.cpp
index 1e9f98c766d924d34c6a3084b3716a6c9677b110..e0a24456fbae199f34d474a7bb8bb2141b3f4b17 100644
--- a/third_party/WebKit/Source/core/editing/Editor.cpp
+++ b/third_party/WebKit/Source/core/editing/Editor.cpp
@@ -648,7 +648,8 @@ bool Editor::deleteSelectionAfterDraggingWithEvents(
// Dispatch 'beforeinput'.
const bool shouldDelete = dispatchBeforeInputEditorCommand(
dragSource, InputEvent::InputType::DeleteByDrag,
- nullptr) == DispatchEventResult::NotCanceled;
+ targetRangesForInputEvent(dragSource)) ==
+ DispatchEventResult::NotCanceled;
// 'beforeinput' event handler may destroy frame, return false to cancel
// remaining actions;
@@ -680,8 +681,8 @@ bool Editor::replaceSelectionAfterDraggingWithEvents(
dataTransfer->setSourceOperation(dragData->draggingSourceOperationMask());
const bool shouldInsert =
dispatchBeforeInputDataTransfer(
- dropTarget, InputEvent::InputType::InsertFromDrop, dataTransfer,
- nullptr) == DispatchEventResult::NotCanceled;
+ dropTarget, InputEvent::InputType::InsertFromDrop, dataTransfer) ==
+ DispatchEventResult::NotCanceled;
// 'beforeinput' event handler may destroy frame, return false to cancel
// remaining actions;
@@ -1082,7 +1083,7 @@ void Editor::cut(EditorCommandSource source) {
if (source == CommandFromMenuOrKeyBinding) {
if (dispatchBeforeInputDataTransfer(findEventTargetFromSelection(),
InputEvent::InputType::DeleteByCut,
- nullptr, nullptr) !=
+ nullptr) !=
DispatchEventResult::NotCanceled)
return;
// 'beforeinput' event handler may destroy target frame.
@@ -1144,7 +1145,7 @@ void Editor::paste(EditorCommandSource source) {
if (dispatchBeforeInputDataTransfer(findEventTargetFromSelection(),
InputEvent::InputType::InsertFromPaste,
- dataTransfer, nullptr) !=
+ dataTransfer) !=
DispatchEventResult::NotCanceled)
return;
// 'beforeinput' event handler may destroy target frame.

Powered by Google App Engine
This is Rietveld 408576698