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

Issue 1752933002: [InputEvent] Fire 'beforeinput' during typing, pressing hot keys and IME composition (Closed)

Created:
4 years, 9 months ago by chongz
Modified:
4 years, 3 months ago
Reviewers:
dtapuska, yosin_UTC9, ojan
CC:
blink-reviews, chromium-reviews
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Fire 'beforeinput' during typing, pressing hot keys and IME composition Support |inputType| and |data| field. 'beforeinput' will be fired when: 1. Typing without IME 2. Pressing hot keys like Ctrl-Z 3. Typing with IME, will be fire before compositionUpdate 'beforeinput' will not be fired by Document.execCommand(). SPEC=http://w3c.github.io/editing/input-events.html#event-type-beforeinput BUG=585875 Committed: https://crrev.com/232c62972c919927922d08050749280f11ce4f2b Cr-Commit-Position: refs/heads/master@{#388519}

Patch Set 1 #

Total comments: 10

Patch Set 2 : dtapuska's review, also add layout tests #

Total comments: 8

Patch Set 3 : Yosi's review #

Total comments: 18

Patch Set 4 : Rebase on WebEditingCommandType & Yosin's review 2 #

Total comments: 32

Patch Set 5 : Yosin's review 3 #

Total comments: 27

Patch Set 6 : ojan's review #

Total comments: 1

Patch Set 7 : Use 'foo == enum' instead of static_cast<> #

Patch Set 8 : Rebase #

Unified diffs Side-by-side diffs Delta from patch set Stats (+332 lines, -3 lines) Patch
A third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html View 1 2 3 4 5 1 chunk +39 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-inputtype.html View 1 2 3 4 1 chunk +50 lines, -0 lines 0 comments Download
A third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-order-typing-command.html View 1 2 3 4 5 1 chunk +41 lines, -0 lines 0 comments Download
M third_party/WebKit/LayoutTests/webexposed/global-interface-listing-expected.txt View 1 2 3 4 5 1 chunk +2 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.h View 1 2 3 4 5 2 chunks +10 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditingUtilities.cpp View 1 2 3 4 5 6 1 chunk +30 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp View 1 2 2 chunks +5 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/InputMethodController.cpp View 1 2 3 4 5 6 4 chunks +17 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp View 1 2 3 4 5 6 2 chunks +40 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/EventTypeNames.in View 1 2 3 1 chunk +1 line, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/InputEvent.h View 1 2 3 4 5 2 chunks +26 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/InputEvent.cpp View 1 2 3 4 5 6 2 chunks +65 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/events/InputEvent.idl View 1 2 3 4 5 1 chunk +3 lines, -1 line 0 comments Download
M third_party/WebKit/Source/core/events/InputEventInit.idl View 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 44 (14 generated)
chongz
Hi dtapuska@, PTAL, thanks! https://codereview.chromium.org/1752933002/diff/1/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp File third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp (right): https://codereview.chromium.org/1752933002/diff/1/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp#newcode66 third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp:66: RefPtrWillBeRawPtr<InputEvent> beforeInputEvent = InputEvent::createBeforeInput("insertText", evt->keyEvent()->text()); ...
4 years, 9 months ago (2016-03-01 20:41:10 UTC) #2
dtapuska
https://codereview.chromium.org/1752933002/diff/1/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp File third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp (right): https://codereview.chromium.org/1752933002/diff/1/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp#newcode66 third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp:66: RefPtrWillBeRawPtr<InputEvent> beforeInputEvent = InputEvent::createBeforeInput("insertText", evt->keyEvent()->text()); On 2016/03/01 20:41:10, chongz ...
4 years, 9 months ago (2016-03-01 21:49:51 UTC) #3
chongz
PTAL, thanks! https://codereview.chromium.org/1752933002/diff/1/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp File third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp (right): https://codereview.chromium.org/1752933002/diff/1/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp#newcode69 third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp:69: return true; On 2016/03/01 21:49:51, dtapuska wrote: ...
4 years, 9 months ago (2016-03-04 19:46:50 UTC) #6
chongz
On 2016/03/04 19:46:50, chongz wrote: > PTAL, thanks! > > https://codereview.chromium.org/1752933002/diff/1/third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp > File third_party/WebKit/Source/core/editing/EditorKeyBindings.cpp (right): ...
4 years, 9 months ago (2016-03-14 14:46:38 UTC) #8
yosin_UTC9
https://codereview.chromium.org/1752933002/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html File third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html (right): https://codereview.chromium.org/1752933002/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html#newcode11 third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html:11: nit: please remove an extra blank line. https://codereview.chromium.org/1752933002/diff/20001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html#newcode24 third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html:24: ...
4 years, 9 months ago (2016-03-15 08:32:32 UTC) #10
chongz
Hi Yosi, thank you so much for the review! I've updated CL as per your ...
4 years, 9 months ago (2016-03-15 19:19:11 UTC) #11
yosin_UTC9
https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode296 third_party/WebKit/Source/core/editing/InputMethodController.cpp:296: // If text is empty, then delete the old ...
4 years, 9 months ago (2016-03-16 01:46:52 UTC) #12
yosin_UTC9
https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp File third_party/WebKit/Source/core/events/InputEvent.cpp (right): https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp#newcode13 third_party/WebKit/Source/core/events/InputEvent.cpp:13: String InputTypeToString(InputEvent::InputType inputType) On 2016/03/16 at 01:46:51, Yosi_UTC9 wrote: ...
4 years, 9 months ago (2016-03-16 01:51:10 UTC) #13
chongz
Thanks for the review! But I got a few questions that I want to clarify ...
4 years, 9 months ago (2016-03-16 21:51:45 UTC) #14
yosin_UTC9
https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp File third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp (right): https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp#newcode1545 third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp:1545: { "MoveBackward", 53, executeMoveBackward, supportedFromMenuOrKeyBinding, enabledInEditableTextOrCaretBrowsing, stateNone, valueNull, notTextInsertion, ...
4 years, 9 months ago (2016-03-17 01:52:23 UTC) #15
ojan
https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp File third_party/WebKit/Source/core/events/InputEvent.cpp (right): https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp#newcode13 third_party/WebKit/Source/core/events/InputEvent.cpp:13: String InputTypeToString(InputEvent::InputType inputType) On 2016/03/17 at 01:52:23, Yosi_UTC9 wrote: ...
4 years, 9 months ago (2016-03-17 18:12:59 UTC) #16
ojan
https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp File third_party/WebKit/Source/core/events/InputEvent.cpp (right): https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp#newcode13 third_party/WebKit/Source/core/events/InputEvent.cpp:13: String InputTypeToString(InputEvent::InputType inputType) On 2016/03/17 at 18:12:59, ojan wrote: ...
4 years, 9 months ago (2016-03-17 18:21:10 UTC) #17
dtapuska
On 2016/03/17 18:21:10, ojan wrote: > https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp > File third_party/WebKit/Source/core/events/InputEvent.cpp (right): > > https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp#newcode13 > ...
4 years, 9 months ago (2016-03-17 18:26:33 UTC) #18
dtapuska
On 2016/03/17 18:26:33, dtapuska wrote: > On 2016/03/17 18:21:10, ojan wrote: > > > https://codereview.chromium.org/1752933002/diff/40001/third_party/WebKit/Source/core/events/InputEvent.cpp ...
4 years, 9 months ago (2016-03-17 18:27:39 UTC) #19
ojan
I see. That's fine w me. Please loop in esprehn on discussons around things in ...
4 years, 9 months ago (2016-03-17 18:29:19 UTC) #20
chongz
Hi yosin@, I've rebased on the new |WebEditingCommandType| enum and updated as per your comments ...
4 years, 8 months ago (2016-04-13 00:34:28 UTC) #21
yosin_UTC9
https://codereview.chromium.org/1752933002/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html File third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html (right): https://codereview.chromium.org/1752933002/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html#newcode12 third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html:12: var lastData = ""; Please use single-quote in script ...
4 years, 8 months ago (2016-04-13 06:13:09 UTC) #22
chongz
Hi Yosin, PTAL, thanks! https://codereview.chromium.org/1752933002/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html File third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html (right): https://codereview.chromium.org/1752933002/diff/60001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html#newcode12 third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html:12: var lastData = ""; On ...
4 years, 8 months ago (2016-04-13 23:53:09 UTC) #24
yosin_UTC9
lgtm Thanks so much!
4 years, 8 months ago (2016-04-14 06:47:50 UTC) #25
chongz
Hi ojan@, can you take a look at this CL please? I still need an ...
4 years, 8 months ago (2016-04-14 14:27:14 UTC) #26
ojan
Very close. Just a few more things (mostly adding TODOs). https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html File third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html (right): https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html#newcode30 ...
4 years, 8 months ago (2016-04-16 00:11:46 UTC) #27
chongz
Hi ojan, I've updated as per your comments, PTAL, thanks! https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html File third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html (right): https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/LayoutTests/fast/events/inputevents/before-input-data.html#newcode30 ...
4 years, 8 months ago (2016-04-18 22:54:48 UTC) #28
chongz
https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp File third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp (right): https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp#newcode138 third_party/WebKit/Source/core/editing/commands/EditorCommand.cpp:138: return InputEvent::InputType::InsertText; On 2016/04/18 22:54:47, chongz wrote: > On ...
4 years, 8 months ago (2016-04-19 21:17:02 UTC) #29
ojan
lgtm https://codereview.chromium.org/1752933002/diff/100001/third_party/WebKit/Source/core/events/InputEvent.cpp File third_party/WebKit/Source/core/events/InputEvent.cpp (right): https://codereview.chromium.org/1752933002/diff/100001/third_party/WebKit/Source/core/events/InputEvent.cpp#newcode71 third_party/WebKit/Source/core/events/InputEvent.cpp:71: inputEventInit.setCancelable(static_cast<bool>(cancelable)); Typically we avoid casting unless really necessary. ...
4 years, 8 months ago (2016-04-19 21:45:59 UTC) #30
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1752933002/120001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1752933002/120001
4 years, 8 months ago (2016-04-19 22:12:28 UTC) #33
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel_ng on tryserver.chromium.mac (JOB_FAILED, http://build.chromium.org/p/tryserver.chromium.mac/builders/mac_chromium_rel_ng/builds/213977)
4 years, 8 months ago (2016-04-19 23:59:26 UTC) #35
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1752933002/140001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1752933002/140001
4 years, 8 months ago (2016-04-20 14:47:40 UTC) #38
commit-bot: I haz the power
Committed patchset #8 (id:140001)
4 years, 8 months ago (2016-04-20 16:38:21 UTC) #40
ojan
https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1752933002/diff/80001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode471 third_party/WebKit/Source/core/editing/InputMethodController.cpp:471: // TODO(chongz): According to spec |data| should be "forward" ...
4 years, 8 months ago (2016-04-20 16:58:57 UTC) #41
commit-bot: I haz the power
4 years, 8 months ago (2016-04-22 19:24:20 UTC) #43
Message was sent while issue was closed.
Patchset 8 (id:??) landed as
https://crrev.com/232c62972c919927922d08050749280f11ce4f2b
Cr-Commit-Position: refs/heads/master@{#388519}

Powered by Google App Engine
This is Rietveld 408576698