| 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 428331d3e5ae2796fbebc10dec8be0ffe18ef462..463af6a2d7102545212a546af54db6ae19331501 100644
|
| --- a/third_party/WebKit/Source/core/editing/Editor.cpp
|
| +++ b/third_party/WebKit/Source/core/editing/Editor.cpp
|
| @@ -104,14 +104,21 @@ void dispatchInputEvent(Element* target, InputEvent::InputType inputType, const
|
| return;
|
| if (!target)
|
| return;
|
| - // TODO(chongz): Pass appreciate |ranges| after it's defined on spec.
|
| - // http://w3c.github.io/editing/input-events.html#dom-inputevent-inputtype
|
| InputEvent* inputEvent = InputEvent::createInput(inputType, data, isComposing, nullptr);
|
| target->dispatchScopedEvent(inputEvent);
|
| }
|
|
|
| void dispatchInputEventEditableContentChanged(Element* startRoot, Element* endRoot, InputEvent::InputType inputType, const String& data, InputEvent::EventIsComposing isComposing)
|
| {
|
| + if (inputType == InputEvent::InputType::MoveByDragDrop) {
|
| + // Drag&Drop will be combined into one |MoveSelectionCommand|, we need to split it into |DeleteByDrag| and |InsertFromDrop|.
|
| + if (startRoot)
|
| + dispatchInputEvent(startRoot, InputEvent::InputType::DeleteByDrag, data, isComposing);
|
| + if (endRoot)
|
| + dispatchInputEvent(endRoot, InputEvent::InputType::InsertFromDrop, data, isComposing);
|
| + return;
|
| + }
|
| +
|
| if (startRoot)
|
| dispatchInputEvent(startRoot, inputType, data, isComposing);
|
| if (endRoot && endRoot != startRoot)
|
| @@ -560,7 +567,7 @@ void Editor::replaceSelectionAfterDragging(DocumentFragment* fragment, bool smar
|
| if (plainText)
|
| options |= ReplaceSelectionCommand::MatchStyle;
|
| DCHECK(frame().document());
|
| - ReplaceSelectionCommand::create(*frame().document(), fragment, options, InputEvent::InputType::Drag)->apply();
|
| + ReplaceSelectionCommand::create(*frame().document(), fragment, options, InputEvent::InputType::InsertFromDrop)->apply();
|
| }
|
|
|
| void Editor::moveSelectionAfterDragging(DocumentFragment* fragment, const Position& pos, bool smartInsert, bool smartDelete)
|
|
|