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

Issue 2886313002: Prevent the IME candidate window from flickering on Chrome OS (Closed)

Created:
3 years, 7 months ago by Yusuke Sato
Modified:
3 years, 7 months ago
Reviewers:
Shu Chen, oshima
CC:
chromium-reviews, nona+watch_chromium.org, James Su, shuchen+watch_chromium.org, yusukes+watch_chromium.org, tfarina
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

Prevent the IME candidate window from flickering on Chrome OS On Chrome OS, IME candidate window is anchored to either bottom-left of the whole composition text (when its WindowPosition settings is "composition") or bottom-left of the cursor (when it's "cursor".) https://developer.chrome.com/extensions/input_ime#type-WindowPosition The former setting doesn't have any issues regarding IME candidate window positioning, but the latter (anchor to "cursor") does. The cursor position may change every single time when you press the convert key because for views::TextField, or more precisely for its gfx::RenderText, the cursor position is defined as the bottom-right of the selected range (if any) but the width of the selected range may change on each conversion. For example, when pressing the conversion key, a character in the selected range may change from a full-width Hiragana Japanese character to a half-width Katakana character. The CL swaps |start| and |end| of the selected range on Chrome OS so that the cursor position becomes bottom *left* of the range which never changes during conversion. Note that Blink does the same (i.e. placing the cursor at the beginning of the selection range) to prevent the window flicker. This CL is for Chrome OS only and doesn't change other platforms' behavior. This does not affect Chrome OS IMEs that use "composition" WindowPosition. Demo: Omnibox without this fix: https://goo.gl/WVpjhE Omnibox with this fix: https://goo.gl/FH1fs9 BUG=311206 TEST=Follow the repro steps in crbug.com/311206 to confirm Omnibox no longer has the issue. Do the same with the find bar (Ctrl+F). Review-Url: https://codereview.chromium.org/2886313002 Cr-Commit-Position: refs/heads/master@{#473984} Committed: https://chromium.googlesource.com/chromium/src/+/e635c3e1ed9ed9a0838beba6893b996a63c3e6a1

Patch Set 1 #

Patch Set 2 : add more tests #

Total comments: 5

Patch Set 3 : address a comment from shuchen@ #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+42 lines, -8 lines) Patch
M ui/views/controls/textfield/textfield_model.cc View 1 2 chunks +20 lines, -6 lines 2 comments Download
M ui/views/controls/textfield/textfield_model_unittest.cc View 1 2 3 chunks +22 lines, -2 lines 0 comments Download

Messages

Total messages: 38 (26 generated)
Yusuke Sato
oshima@, shuchen@, could you have a look? https://codereview.chromium.org/2886313002/diff/40001/ui/views/controls/textfield/textfield_model_unittest.cc File ui/views/controls/textfield/textfield_model_unittest.cc (left): https://codereview.chromium.org/2886313002/diff/40001/ui/views/controls/textfield/textfield_model_unittest.cc#oldcode913 ui/views/controls/textfield/textfield_model_unittest.cc:913: EXPECT_EQ(gfx::Range(5, 7), ...
3 years, 7 months ago (2017-05-18 17:14:32 UTC) #19
Shu Chen
lgtm https://codereview.chromium.org/2886313002/diff/40001/ui/views/controls/textfield/textfield_model_unittest.cc File ui/views/controls/textfield/textfield_model_unittest.cc (right): https://codereview.chromium.org/2886313002/diff/40001/ui/views/controls/textfield/textfield_model_unittest.cc#newcode938 ui/views/controls/textfield/textfield_model_unittest.cc:938: composition.selection = gfx::Range(0, 1); On 2017/05/18 17:14:31, Yusuke ...
3 years, 7 months ago (2017-05-21 03:54:30 UTC) #20
Yusuke Sato
https://codereview.chromium.org/2886313002/diff/40001/ui/views/controls/textfield/textfield_model_unittest.cc File ui/views/controls/textfield/textfield_model_unittest.cc (right): https://codereview.chromium.org/2886313002/diff/40001/ui/views/controls/textfield/textfield_model_unittest.cc#newcode938 ui/views/controls/textfield/textfield_model_unittest.cc:938: composition.selection = gfx::Range(0, 1); On 2017/05/21 03:54:30, Shu Chen ...
3 years, 7 months ago (2017-05-22 05:49:00 UTC) #22
Yusuke Sato
oshima@: please do an owner review. Thanks.
3 years, 7 months ago (2017-05-22 05:49:32 UTC) #24
oshima
https://codereview.chromium.org/2886313002/diff/60001/ui/views/controls/textfield/textfield_model.cc File ui/views/controls/textfield/textfield_model.cc (right): https://codereview.chromium.org/2886313002/diff/60001/ui/views/controls/textfield/textfield_model.cc#newcode299 ui/views/controls/textfield/textfield_model.cc:299: render_text->SelectRange(gfx::Range(cursor + start, cursor + end)); what's the reason ...
3 years, 7 months ago (2017-05-22 09:55:21 UTC) #27
Yusuke Sato
https://codereview.chromium.org/2886313002/diff/60001/ui/views/controls/textfield/textfield_model.cc File ui/views/controls/textfield/textfield_model.cc (right): https://codereview.chromium.org/2886313002/diff/60001/ui/views/controls/textfield/textfield_model.cc#newcode299 ui/views/controls/textfield/textfield_model.cc:299: render_text->SelectRange(gfx::Range(cursor + start, cursor + end)); On 2017/05/22 09:55:21, ...
3 years, 7 months ago (2017-05-22 16:55:02 UTC) #28
oshima
On 2017/05/22 16:55:02, Yusuke Sato wrote: > https://codereview.chromium.org/2886313002/diff/60001/ui/views/controls/textfield/textfield_model.cc > File ui/views/controls/textfield/textfield_model.cc (right): > > https://codereview.chromium.org/2886313002/diff/60001/ui/views/controls/textfield/textfield_model.cc#newcode299 ...
3 years, 7 months ago (2017-05-22 18:04:26 UTC) #29
Yusuke Sato
Answers inlined: On 2017/05/22 18:04:26, oshima wrote: > On 2017/05/22 16:55:02, Yusuke Sato wrote: > ...
3 years, 7 months ago (2017-05-22 19:57:41 UTC) #30
oshima
lgtm this CL so the better fix would be to fix RenderText to keep both ...
3 years, 7 months ago (2017-05-23 15:34:09 UTC) #31
Yusuke Sato
On 2017/05/23 15:34:09, oshima (OOO May 22-24) wrote: > lgtm this CL > > so ...
3 years, 7 months ago (2017-05-23 17:19:20 UTC) #32
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/2886313002/60001
3 years, 7 months ago (2017-05-23 17:19:54 UTC) #35
commit-bot: I haz the power
3 years, 7 months ago (2017-05-23 18:19:02 UTC) #38
Message was sent while issue was closed.
Committed patchset #3 (id:60001) as
https://chromium.googlesource.com/chromium/src/+/e635c3e1ed9ed9a0838beba6893b...

Powered by Google App Engine
This is Rietveld 408576698