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

Issue 2374743002: [InputEvent] Support |deleteByDrag|, |insertFromDrop| and fire in sequential order (Closed)

Created:
4 years, 2 months ago by chongz
Modified:
4 years, 2 months ago
Reviewers:
yosin_UTC9, ojan
CC:
blink-reviews, chromium-reviews, dcheng
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[InputEvent] Support |deleteByDrag|, |insertFromDrop| and fire in sequential order Key point of the implementation: * We want to apply 2 commands but only push 1 undo entry. Solution: 1. Introduce empty wrapper command |DragAndDropCommand| and apply first 2. Apply |DeleteSelectionCommand| for |deleteByDrag| 3. Apply |ReplaceSelectionCommand| for |insertFromDrop| The wrapper command in 1. won't create undo entry by itself, but will act as a catcher and combine the following 2 commands into a single undo entry. --- After CL behavior * Event order: (See [1]) 1. 'drop' 2. 'beforeinput' InputType=|deleteByDrag| 3. (DOM update for deletion) 4. 'input' InputType=|deleteByDrag| 5. 'beforeinput' InputType=|insertFromDrop| 6. (DOM update for insertion) 7. 'input' InputType=|insertFromDrop| 8. 'dragend' * Canceling 'beforeinput' will only prevent DOM update for current 'beforeinput', and won't affect remaining events. e.g. Cancelling 'deleteByDrag' won't affect 'insertFromDrop' * |dataTransfer| field: 1. NULL for |deleteByDrag| 2. Readonly |dataTransfer| for |insertFromDrop| * Undo entry: 1. Creates a single undo entry for Drag&Drop, if no JS-triggered DOM mutation happened in between 2. Otherwise creates 2 separate undo entries For more detailed behavior please refer to LayoutTest. [1] Event order for |deleteByDrag| and |insertFromDrop|: https://github.com/w3c/input-events/issues/24#issuecomment-249153755 Intent to Implement: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/InputEvent/blink-dev/RrnitB0OElc/rirueVekCwAJ BUG=652393 Committed: https://crrev.com/93db3c3bb91fb3e02080e16a0bd0b813b3d10a3e Cr-Commit-Position: refs/heads/master@{#422915}

Patch Set 1 #

Total comments: 21

Patch Set 2 : Yosin's review #

Total comments: 16

Patch Set 3 : Yosin's review 2 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+654 lines, -72 lines) Patch
M third_party/WebKit/LayoutTests/editing/selection/drag-drop-events-expected.txt View 1 chunk +2 lines, -2 lines 0 comments Download
M third_party/WebKit/LayoutTests/fast/events/inputevents/beforeinput-remove-iframe-crash.html View 1 chunk +46 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-drag-drop.html View 1 1 chunk +293 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/resources/beforeinput-remove-iframe-crash-iframe.html View 1 chunk +9 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/BUILD.gn View 1 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.h View 1 2 6 chunks +24 lines, -9 lines 0 comments Download
M third_party/WebKit/Source/core/editing/Editor.cpp View 1 2 10 chunks +85 lines, -20 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.h View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp View 1 2 5 chunks +22 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.h View 1 2 3 chunks +6 lines, -3 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/DeleteSelectionCommand.cpp View 1 2 7 chunks +35 lines, -6 lines 0 comments Download
A third_party/WebKit/Source/core/editing/commands/DragAndDropCommand.h View 1 2 1 chunk +35 lines, -0 lines 0 comments Download
A third_party/WebKit/Source/core/editing/commands/DragAndDropCommand.cpp View 1 2 1 chunk +28 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/commands/EditCommand.cpp View 1 2 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/MoveSelectionCommand.cpp View 1 2 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/InputEvent.h View 1 2 3 chunks +2 lines, -2 lines 0 comments Download
M third_party/WebKit/Source/core/events/InputEvent.cpp View 1 2 3 chunks +2 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/page/DragController.cpp View 1 2 5 chunks +54 lines, -26 lines 0 comments Download

Messages

Total messages: 69 (56 generated)
chongz
yosin@ PTAL, thanks! https://codereview.chromium.org/2374743002/diff/40001/third_party/WebKit/Source/core/editing/Editor.cpp File third_party/WebKit/Source/core/editing/Editor.cpp (right): https://codereview.chromium.org/2374743002/diff/40001/third_party/WebKit/Source/core/editing/Editor.cpp#newcode724 third_party/WebKit/Source/core/editing/Editor.cpp:724: m_lastEditCommand = cmd; Has potential issue. ...
4 years, 2 months ago (2016-09-28 02:19:26 UTC) #19
yosin_UTC9
https://codereview.chromium.org/2374743002/diff/40001/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt File third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt (right): https://codereview.chromium.org/2374743002/diff/40001/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt#newcode2 third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt:2: EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification I'll convert "drag-drop-modifies-page.html" to use w3c ...
4 years, 2 months ago (2016-09-28 04:19:03 UTC) #20
chongz
yosin@ PTAL again, thanks! https://codereview.chromium.org/2374743002/diff/40001/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt File third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt (right): https://codereview.chromium.org/2374743002/diff/40001/third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt#newcode2 third_party/WebKit/LayoutTests/platform/linux/editing/pasteboard/drag-drop-modifies-page-expected.txt:2: EDITING DELEGATE: webViewDidChangeSelection:WebViewDidChangeSelectionNotification On 2016/09/28 ...
4 years, 2 months ago (2016-09-29 02:36:22 UTC) #34
yosin_UTC9
https://codereview.chromium.org/2374743002/diff/90001/third_party/WebKit/Source/core/editing/Editor.h File third_party/WebKit/Source/core/editing/Editor.h (right): https://codereview.chromium.org/2374743002/diff/90001/third_party/WebKit/Source/core/editing/Editor.h#newcode62 third_party/WebKit/Source/core/editing/Editor.h:62: enum class SmartDelete { Yes, No }; How about ...
4 years, 2 months ago (2016-10-03 09:19:03 UTC) #37
chongz
yosin@ I've updated as per your comments, PTAL again, thanks! https://codereview.chromium.org/2374743002/diff/90001/third_party/WebKit/Source/core/editing/Editor.h File third_party/WebKit/Source/core/editing/Editor.h (right): https://codereview.chromium.org/2374743002/diff/90001/third_party/WebKit/Source/core/editing/Editor.h#newcode62 ...
4 years, 2 months ago (2016-10-04 02:18:39 UTC) #52
yosin_UTC9
lgtm
4 years, 2 months ago (2016-10-04 07:37:43 UTC) #53
chongz
ojan@ PTAL, thanks!
4 years, 2 months ago (2016-10-04 13:53:20 UTC) #55
chongz
CCing dtapuska@
4 years, 2 months ago (2016-10-04 19:14:35 UTC) #56
ojan
lgtm The code changes look good. Would be good to have the change description describe ...
4 years, 2 months ago (2016-10-04 19:55:19 UTC) #57
chongz
On 2016/10/04 19:55:19, ojan wrote: > lgtm > > The code changes look good. Would ...
4 years, 2 months ago (2016-10-04 20:13:06 UTC) #62
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2374743002/150001
4 years, 2 months ago (2016-10-04 20:31:24 UTC) #65
commit-bot: I haz the power
Committed patchset #3 (id:150001)
4 years, 2 months ago (2016-10-04 20:38:22 UTC) #67
commit-bot: I haz the power
4 years, 2 months ago (2016-10-04 20:41:36 UTC) #69
Message was sent while issue was closed.
Patchset 3 (id:??) landed as
https://crrev.com/93db3c3bb91fb3e02080e16a0bd0b813b3d10a3e
Cr-Commit-Position: refs/heads/master@{#422915}

Powered by Google App Engine
This is Rietveld 408576698