|dataTransfer| field is used to carry rich data in 'beforeinput'. (where |data| field is used for plain text). An overview of |dataTransfer| and |data|: https://w3c.github.io/input-events/#h-overview (Basically only InputType 'cut'/'paste'/'drag'/'drop'/'insertNonText' has |dataTransfer|.) Discussion outcome from July F2F: https://docs.google.com/document/d/1XxIEF0So-kMF5mcJ03Yj0zsYMFRHEgXw1fV1K5FOwuQ/edit#heading=h.ofol1qgk582l
The following revision refers to this bug: https://chromium.googlesource.com/chromium/src.git/+/952c4101425ed85bf53ded777e5a882895646980 commit 952c4101425ed85bf53ded777e5a882895646980 Author: chongz <chongz@chromium.org> Date: Fri Aug 26 06:33:31 2016 [InputEvent] Support |deleteByCut|&|insertFromPaste| with |dataTransfer| field * Event order: (see July F2F[1] and GitHub discussion[2]) 1. Clipboard API cut 2. (Clipboard update) 3. 'beforeinput' InputType=|deleteByCut| 4. (DOM update) 5. 'input' InputType=|deleteByCut| * Canceling 'beforeinput' will only prevent DOM update. * |dataTransfer| field: (see Editing spec discussion[3]) 1. NULL for |deleteByCut| (JS could always get from selection) 2. Readonly |dataTransfer| for |insertFromPaste| [1] Editing TF July F2F: https://docs.google.com/document/d/1XxIEF0So-kMF5mcJ03Yj0zsYMFRHEgXw1fV1K5FOwuQ/edit#heading=h.l9vlzb1oc68r [2] GitHub discussion for event order: https://github.com/w3c/editing/issues/144#issuecomment-240892363 [3] Editing spec discussion: https://github.com/w3c/editing/issues/144#issuecomment-240259209 Intent to Implement: https://groups.google.com/a/chromium.org/forum/#!searchin/blink-dev/InputEvent/blink-dev/RrnitB0OElc/rirueVekCwAJ BUG= 639139 Review-Url: https://codereview.chromium.org/2258663003 Cr-Commit-Position: refs/heads/master@{#414659} [add] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/LayoutTests/fast/events/inputevents/beforeinput-remove-iframe-crash.html [add] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-cut-paste.html [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/LayoutTests/fast/events/inputevents/inputevent-execcommand.html [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/editing/EditingUtilities.cpp [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/editing/EditingUtilities.h [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/editing/Editor.cpp [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/editing/Editor.h [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/editing/commands/CompositeEditCommand.cpp [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/editing/spellcheck/SpellChecker.cpp [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/events/InputEvent.cpp [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/events/InputEvent.h [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/events/InputEvent.idl [modify] https://crrev.com/952c4101425ed85bf53ded777e5a882895646980/third_party/WebKit/Source/core/events/InputEventInit.idl
Comment 1 by chongz@chromium.org
, Aug 25 2016