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

Issue 1847583003: Fix setComposingText when newCursorPosition != 1 (Closed)

Created:
4 years, 8 months ago by yabinh
Modified:
4 years, 7 months ago
CC:
blink-reviews, chromium-reviews, darin-cc_chromium.org, jam, loading-reviews_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

After fixing, it behaves like this: Case1: When newCursorPosition < 1, the cursor will move to the left of the composing text. Specially, when cursor position exceeds the left boundary, it will move to the left boundary. Case2: When newCursorPosition > 1, the cursor will move to the right of the composing text. Specially, when cursor position exceeds the right boundary, it will move to the right boundary. BUG=570920 CQ_INCLUDE_TRYBOTS=tryserver.chromium.linux:linux_site_isolation Committed: https://crrev.com/25dec933e90def173fe9682a6d2b80d46283be52 Cr-Commit-Position: refs/heads/master@{#393198}

Patch Set 1 : Fix setComposingText when newCursorPosition < 1 #

Total comments: 13

Patch Set 2 : Fix setComposingText when newCursorPosition > 1 #

Patch Set 3 : Adding C++ unit test #

Total comments: 12

Patch Set 4 : Modified some C++ unit tests #

Total comments: 10

Patch Set 5 : Add some C++ unit tests. #

Total comments: 12

Patch Set 6 : Without changing PlainTextRange #

Total comments: 3

Patch Set 7 : For multiple nodes. #

Total comments: 3

Patch Set 8 : Use a different method to handle exceeding right boundary. #

Patch Set 9 : Avoid using innerText() #

Total comments: 5

Patch Set 10 : Store Position objects as local variables... #

Unified diffs Side-by-side diffs Delta from patch set Stats (+231 lines, -5 lines) Patch
M content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java View 1 2 3 4 5 6 7 2 chunks +50 lines, -0 lines 0 comments Download
M third_party/WebKit/Source/core/editing/InputMethodController.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M third_party/WebKit/Source/core/editing/InputMethodController.cpp View 1 2 3 4 5 6 7 8 9 2 chunks +25 lines, -4 lines 0 comments Download
M third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp View 1 2 3 4 5 6 1 chunk +155 lines, -0 lines 0 comments Download

Messages

Total messages: 58 (21 generated)
yabinh
On 2016/03/31 13:22:56, yabinh wrote: > mailto:yabinh@chromium.org changed reviewers: > + mailto:aelias@chromium.org, mailto:changwan@chromium.org I didn't ...
4 years, 8 months ago (2016-03-31 13:25:24 UTC) #5
Changwan Ryu
https://codereview.chromium.org/1847583003/diff/40001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java File content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java (right): https://codereview.chromium.org/1847583003/diff/40001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java#newcode109 content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java:109: public void testSetComposingTextWhennewCursorPositionsChanges() throws Throwable { WhenNewCursorPositionChanges --> This ...
4 years, 8 months ago (2016-04-01 00:37:26 UTC) #10
yabinh
https://codereview.chromium.org/1847583003/diff/40001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java File content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java (right): https://codereview.chromium.org/1847583003/diff/40001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java#newcode109 content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java:109: public void testSetComposingTextWhennewCursorPositionsChanges() throws Throwable { On 2016/04/01 00:37:26, ...
4 years, 8 months ago (2016-04-01 04:14:18 UTC) #12
Changwan Ryu
https://codereview.chromium.org/1847583003/diff/40001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/40001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode322 third_party/WebKit/Source/core/editing/InputMethodController.cpp:322: int start = std::min(std::max((int)baseOffset + selectionStart, 0), (int)extentOffset); On ...
4 years, 8 months ago (2016-04-01 05:36:15 UTC) #14
yabinh
Hi Changwan@, I added C++ unit test. Could you take another look?
4 years, 8 months ago (2016-04-04 06:04:42 UTC) #15
Changwan Ryu
https://codereview.chromium.org/1847583003/diff/100001/base/feature_list.cc File base/feature_list.cc (right): https://codereview.chromium.org/1847583003/diff/100001/base/feature_list.cc#newcode39 base/feature_list.cc:39: : initialized_(false), initialized_from_command_line_(false) {} please remove unnecessary changes from ...
4 years, 8 months ago (2016-04-04 06:23:13 UTC) #16
yabinh
https://codereview.chromium.org/1847583003/diff/100001/base/feature_list.cc File base/feature_list.cc (right): https://codereview.chromium.org/1847583003/diff/100001/base/feature_list.cc#newcode39 base/feature_list.cc:39: : initialized_(false), initialized_from_command_line_(false) {} On 2016/04/04 06:23:13, Changwan Ryu ...
4 years, 8 months ago (2016-04-04 08:31:51 UTC) #17
Changwan Ryu
On 2016/04/04 08:31:51, yabinh wrote: > https://codereview.chromium.org/1847583003/diff/100001/base/feature_list.cc > File base/feature_list.cc (right): > > https://codereview.chromium.org/1847583003/diff/100001/base/feature_list.cc#newcode39 > ...
4 years, 8 months ago (2016-04-04 09:18:14 UTC) #18
yabinh
changwan@, I uploaded a new patch. Please take another look.
4 years, 8 months ago (2016-04-05 07:20:03 UTC) #20
Changwan Ryu
https://codereview.chromium.org/1847583003/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/1847583003/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode180 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:180: EXPECT_EQ(6, range->endOffset()); I think you need more tests, e.g. ...
4 years, 8 months ago (2016-04-05 07:50:38 UTC) #22
yabinh
https://codereview.chromium.org/1847583003/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp File third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp (right): https://codereview.chromium.org/1847583003/diff/160001/third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp#newcode180 third_party/WebKit/Source/core/editing/InputMethodControllerTest.cpp:180: EXPECT_EQ(6, range->endOffset()); On 2016/04/05 07:50:37, Changwan Ryu wrote: > ...
4 years, 8 months ago (2016-04-05 08:06:42 UTC) #23
yabinh
@changwan, I uploaded a new patch. Could you take another look?
4 years, 8 months ago (2016-04-07 11:11:46 UTC) #24
Changwan Ryu
There are still test failures. Please fix them first. https://codereview.chromium.org/1847583003/diff/180001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java File content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java (right): https://codereview.chromium.org/1847583003/diff/180001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java#newcode124 content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java:124: ...
4 years, 8 months ago (2016-04-07 11:46:19 UTC) #25
yabinh
https://codereview.chromium.org/1847583003/diff/180001/third_party/WebKit/Source/core/editing/PlainTextRange.cpp File third_party/WebKit/Source/core/editing/PlainTextRange.cpp (right): https://codereview.chromium.org/1847583003/diff/180001/third_party/WebKit/Source/core/editing/PlainTextRange.cpp#newcode123 third_party/WebKit/Source/core/editing/PlainTextRange.cpp:123: if (foundStart && startOutOfBound) { On 2016/04/07 11:46:19, Changwan ...
4 years, 8 months ago (2016-04-08 01:21:30 UTC) #26
yabinh
4 years, 8 months ago (2016-04-08 01:21:35 UTC) #27
yabinh
https://codereview.chromium.org/1847583003/diff/180001/third_party/WebKit/Source/core/editing/PlainTextRange.cpp File third_party/WebKit/Source/core/editing/PlainTextRange.cpp (right): https://codereview.chromium.org/1847583003/diff/180001/third_party/WebKit/Source/core/editing/PlainTextRange.cpp#newcode123 third_party/WebKit/Source/core/editing/PlainTextRange.cpp:123: if (foundStart && startOutOfBound) { I was wrong about ...
4 years, 8 months ago (2016-04-11 05:53:25 UTC) #28
yabinh
changwan@, could you take another look?
4 years, 7 months ago (2016-05-02 02:09:00 UTC) #31
Changwan Ryu
https://codereview.chromium.org/1847583003/diff/220001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/220001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode341 third_party/WebKit/Source/core/editing/InputMethodController.cpp:341: int textEnd = textRange.endPosition().computeOffsetInContainerNode(); How about simply the following? ...
4 years, 7 months ago (2016-05-02 06:49:00 UTC) #32
yabinh
https://codereview.chromium.org/1847583003/diff/220001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/220001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode341 third_party/WebKit/Source/core/editing/InputMethodController.cpp:341: int textEnd = textRange.endPosition().computeOffsetInContainerNode(); Do you mean: int textEnd ...
4 years, 7 months ago (2016-05-02 09:48:10 UTC) #33
Changwan Ryu
https://codereview.chromium.org/1847583003/diff/220001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/220001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode341 third_party/WebKit/Source/core/editing/InputMethodController.cpp:341: int textEnd = textRange.endPosition().computeOffsetInContainerNode(); On 2016/05/02 09:48:10, yabinh wrote: ...
4 years, 7 months ago (2016-05-02 10:51:49 UTC) #34
yabinh
changwan@, can you take another look?
4 years, 7 months ago (2016-05-09 10:41:33 UTC) #35
Changwan Ryu
lgtm w/ nits aelias@, could you take a look? https://codereview.chromium.org/1847583003/diff/240001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java File content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java (right): https://codereview.chromium.org/1847583003/diff/240001/content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java#newcode159 content/public/android/javatests/src/org/chromium/content/browser/input/ImeTest.java:159: ...
4 years, 7 months ago (2016-05-09 12:52:23 UTC) #36
yabinh
https://codereview.chromium.org/1847583003/diff/240001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/240001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode344 third_party/WebKit/Source/core/editing/InputMethodController.cpp:344: const EphemeralRange startRange = PlainTextRange(0, start).createRange(*rootEditableElement); If both number1 ...
4 years, 7 months ago (2016-05-09 13:02:50 UTC) #37
Changwan Ryu
On 2016/05/09 13:02:50, yabinh wrote: > https://codereview.chromium.org/1847583003/diff/240001/third_party/WebKit/Source/core/editing/InputMethodController.cpp > File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): > > https://codereview.chromium.org/1847583003/diff/240001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode344 > ...
4 years, 7 months ago (2016-05-09 14:36:39 UTC) #38
yabinh
> Hmm... I thought that you were fixing PlainTextRange behavior at some point. Any > ...
4 years, 7 months ago (2016-05-10 02:18:10 UTC) #39
yabinh
changwan@, aelias@, can you take a look at the latest patch?
4 years, 7 months ago (2016-05-10 11:59:43 UTC) #40
aelias_OOO_until_Jul13
https://codereview.chromium.org/1847583003/diff/280001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/280001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode349 third_party/WebKit/Source/core/editing/InputMethodController.cpp:349: const EphemeralRange startRange = PlainTextRange(0, start).createRange(*rootEditableElement); These ranges are ...
4 years, 7 months ago (2016-05-10 20:44:11 UTC) #41
yabinh
https://codereview.chromium.org/1847583003/diff/280001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/280001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode349 third_party/WebKit/Source/core/editing/InputMethodController.cpp:349: const EphemeralRange startRange = PlainTextRange(0, start).createRange(*rootEditableElement); On 2016/05/10 20:44:11, ...
4 years, 7 months ago (2016-05-11 00:28:38 UTC) #42
aelias_OOO_until_Jul13
OK, lgtm modulo minor comment below, adding yosin@ for core/editing OWNERS. https://codereview.chromium.org/1847583003/diff/280001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): ...
4 years, 7 months ago (2016-05-11 02:49:35 UTC) #44
yosin_UTC9
Waiting for using Position's here. https://codereview.chromium.org/1847583003/diff/280001/third_party/WebKit/Source/core/editing/InputMethodController.cpp File third_party/WebKit/Source/core/editing/InputMethodController.cpp (right): https://codereview.chromium.org/1847583003/diff/280001/third_party/WebKit/Source/core/editing/InputMethodController.cpp#newcode349 third_party/WebKit/Source/core/editing/InputMethodController.cpp:349: const EphemeralRange startRange = ...
4 years, 7 months ago (2016-05-11 05:53:23 UTC) #45
yabinh
yosin@, can you take another look?
4 years, 7 months ago (2016-05-12 01:44:26 UTC) #46
yosin_UTC9
On 2016/05/12 at 01:44:26, yabinh wrote: > yosin@, can you take another look? lgtm Thanks!
4 years, 7 months ago (2016-05-12 04:04:10 UTC) #47
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1847583003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1847583003/300001
4 years, 7 months ago (2016-05-12 04:26:13 UTC) #51
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1847583003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1847583003/300001
4 years, 7 months ago (2016-05-12 05:41:42 UTC) #53
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/1847583003/300001 View timeline at https://chromium-cq-status.appspot.com/patch-timeline/1847583003/300001
4 years, 7 months ago (2016-05-12 05:42:55 UTC) #55
commit-bot: I haz the power
Committed patchset #10 (id:300001)
4 years, 7 months ago (2016-05-12 07:02:09 UTC) #56
commit-bot: I haz the power
4 years, 7 months ago (2016-05-12 07:03:12 UTC) #58
Message was sent while issue was closed.
Patchset 10 (id:??) landed as
https://crrev.com/25dec933e90def173fe9682a6d2b80d46283be52
Cr-Commit-Position: refs/heads/master@{#393198}

Powered by Google App Engine
This is Rietveld 408576698