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

Issue 2493703002: Make "compositionend" event fired after setting caret position (Closed)

Created:
4 years, 1 month ago by yabinh
Modified:
3 years, 10 months ago
CC:
aelias_OOO_until_Jul13, blink-reviews, Changwan Ryu, chongz, chromium-reviews
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

Make "compositionend" event fired after setting caret position JS may want to listen to 'compositionend' and mutate DOM & move focus after IME finishes. Besides, according to the spec (https://www.w3.org/TR/uievents/#event-type-compositionend), we should fire 'compositionend' after all IME controls such as inserting text and moving caret. But we are resetting caret position after 'compositionend' event listeners now. This CL will make the order correct. BUG=663944 TEST=run_webkit_layout_test --gtest_filter=InputMethodControllerTest.* Committed: https://crrev.com/df699ce3ffd28396d0447fbc8072ebe7199857ca Cr-Commit-Position: refs/heads/master@{#433308}

Patch Set 1 : Not able to listen to selectionchange event #

Total comments: 1

Patch Set 2 : Ignore selectionchange event #

Patch Set 3 #

Patch Set 4 : Address yosin@'s review #

Total comments: 3

Patch Set 5 : Address yosin@'s 2nd review #

Patch Set 6 : simulate "Potential issue" #

Total comments: 8

Patch Set 7 #

Total comments: 4

Patch Set 8 : Add more test. #

Total comments: 24

Patch Set 9 : Refactor #

Total comments: 9

Patch Set 10 : A little change #

Patch Set 11 : Rebase #

Patch Set 12 : format #

Total comments: 1
Unified diffs Side-by-side diffs Delta from patch set Stats (+253 lines, -57 lines) Patch
M third_party/WebKit/Source/core/editing/InputMethodController.cpp View 1 2 3 4 5 6 7 8 9 10 4 chunks +16 lines, -6 lines 1 comment Download
M third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp View 1 2 3 4 5 6 7 8 9 10 11 16 chunks +237 lines, -51 lines 0 comments Download

Messages

Total messages: 88 (62 generated)
yabinh
PTAL~ https://codereview.chromium.org/2493703002/diff/1/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/1/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode860 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:860: "});" It seems that selectionchange doesn't work here. ...
4 years, 1 month ago (2016-11-10 07:57:42 UTC) #10
aelias_OOO_until_Jul13
I don't have much opinion on this one way or another, replacing myself with yosin@ ...
4 years, 1 month ago (2016-11-10 19:34:58 UTC) #13
yosin_UTC9
Code changes are fine. Could you add a test case checks selection is changed before ...
4 years, 1 month ago (2016-11-11 01:58:09 UTC) #14
yabinh
On 2016/11/11 01:58:09, Yosi_UTC9 wrote: > Code changes are fine. > Could you add a ...
4 years, 1 month ago (2016-11-11 03:55:10 UTC) #21
yosin_UTC9
https://codereview.chromium.org/2493703002/diff/60001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/60001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode858 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:858: " if (getSelection().anchorOffset != event.data.length)" nit: We should have ...
4 years, 1 month ago (2016-11-11 04:17:46 UTC) #22
yabinh
PTAL~ https://codereview.chromium.org/2493703002/diff/60001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/60001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode859 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:859: " document.title += 'Wrong selection! Expected ' " ...
4 years, 1 month ago (2016-11-11 05:23:52 UTC) #25
yosin_UTC9
On 2016/11/11 at 05:23:52, yabinh wrote: > PTAL~ > > https://codereview.chromium.org/2493703002/diff/60001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp > File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): ...
4 years, 1 month ago (2016-11-11 06:26:46 UTC) #26
yabinh
> Please update description why we do this, e.g. summary of "Potential Issue" in a ...
4 years, 1 month ago (2016-11-14 19:13:34 UTC) #36
yosin_UTC9
Please write description as: Title\n \n Description \n BUG=XXXX TEST=run_webkit_layout_test --gtest_filter=XXX The test is still ...
4 years, 1 month ago (2016-11-15 02:27:05 UTC) #39
yabinh
> It seems replaceCompositionAndMoveCaret() is good tester. commitText calls replaceCompositionAndMoveCaret most of the time. Also, ...
4 years, 1 month ago (2016-11-15 19:47:36 UTC) #43
yosin_UTC9
https://codereview.chromium.org/2493703002/diff/120001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/120001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode842 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:842: TEST_F(InputMethodControllerTest, CompositionInputEventData) { This test case is too long ...
4 years, 1 month ago (2016-11-16 02:02:10 UTC) #49
yabinh
https://codereview.chromium.org/2493703002/diff/120001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/120001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode842 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:842: TEST_F(InputMethodControllerTest, CompositionInputEventData) { On 2016/11/16 02:02:10, Yosi_UTC9 wrote: > ...
4 years, 1 month ago (2016-11-16 19:52:15 UTC) #53
yosin_UTC9
https://codereview.chromium.org/2493703002/diff/140001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/140001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode842 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:842: TEST_F(InputMethodControllerTest, CompositionInputEventForReplace) { Could you make another CL for ...
4 years, 1 month ago (2016-11-17 01:39:55 UTC) #56
yabinh
https://codereview.chromium.org/2493703002/diff/140001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/140001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode842 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:842: TEST_F(InputMethodControllerTest, CompositionInputEventForReplace) { On 2016/11/17 01:39:55, Yosi_UTC9 wrote: > ...
4 years, 1 month ago (2016-11-17 05:15:55 UTC) #59
yosin_UTC9
lgtm w/ nits https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (left): https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#oldcode821 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:821: document().body()->appendChild(script, ASSERT_NO_EXCEPTION); http://crrev.com/2506903005 is being committed. ...
4 years, 1 month ago (2016-11-17 05:38:06 UTC) #60
yabinh
https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode63 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:63: "event => document.title = `beforeinput.data:${event.data};`);" On 2016/11/17 05:38:06, Yosi_UTC9 ...
4 years, 1 month ago (2016-11-17 06:58:15 UTC) #63
yabinh
https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode63 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:63: "event => document.title = `beforeinput.data:${event.data};`);" On 2016/11/17 06:58:15, yabinh ...
4 years, 1 month ago (2016-11-17 18:18:45 UTC) #68
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/2493703002/200001
4 years, 1 month ago (2016-11-18 07:27:45 UTC) #73
commit-bot: I haz the power
Internal error: failed to checkout. Please try again.
4 years, 1 month ago (2016-11-18 07:32:52 UTC) #75
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/2493703002/200001
4 years, 1 month ago (2016-11-18 07:36:52 UTC) #77
yosin_UTC9
On 2016/11/17 at 18:18:45, yabinh wrote: > https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp > File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): > > https://codereview.chromium.org/2493703002/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode63 ...
4 years, 1 month ago (2016-11-18 07:39:02 UTC) #78
yabinh
> Oops, sorrty it is typo. I said add an indentation or adding two spaces ...
4 years, 1 month ago (2016-11-18 18:06:21 UTC) #82
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/2493703002/220001
4 years, 1 month ago (2016-11-18 18:06:52 UTC) #83
commit-bot: I haz the power
Committed patchset #12 (id:220001)
4 years, 1 month ago (2016-11-18 22:04:03 UTC) #85
commit-bot: I haz the power
Patchset 12 (id:??) landed as https://crrev.com/df699ce3ffd28396d0447fbc8072ebe7199857ca Cr-Commit-Position: refs/heads/master@{#433308}
4 years, 1 month ago (2016-11-18 22:05:56 UTC) #87
aelias_OOO_until_Jul13
3 years, 10 months ago (2017-01-27 02:23:40 UTC) #88
Message was sent while issue was closed.
https://codereview.chromium.org/2493703002/diff/220001/third_party/WebKit/Sou...
File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right):

https://codereview.chromium.org/2493703002/diff/220001/third_party/WebKit/Sou...
third_party/WebKit/Source/core/editing/InputMethodController.cpp:640: return
dispatchCompositionEndEvent(frame(), text);
This was reverted due to http://crbug.com/674295.  Not sure we want to reland
(rather we might change the spec to match the reality that implementations rely
on current ordering), but if we ever do, note that this change here is also
incorrect.  It should be in "if (hasComposition())" block, because otherwise
it's sending a CompositionEnd without a corresponding CompositionBegin.

Powered by Google App Engine
This is Rietveld 408576698