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

Issue 252563003: Fix Views inline autocomplete with multi-char graphemes. (Closed)

Created:
6 years, 8 months ago by msw
Modified:
6 years, 7 months ago
CC:
chromium-reviews, yusukes+watch_chromium.org, Yuki, tfarina, penghuang+watch_chromium.org, Seigo Nonaka, James Su, ckocagil, jungshik at Google
Visibility:
Public.

Description

Fix Views inline autocomplete with multi-char graphemes. Allow RenderText selection bounds amid multi-char graphemes. Add a consolidated IsValidLogicalIndex implementation. (this is less strict than the renamed IsValidCursorIndex) Use adjacent cursor positions in MoveCursor as needed. (prevents invalid cursors when collapsing selections) Skip painting empty glyph ranges on Windows. Add a unit test; minor cleanup and comment changes. BUG=327903, 366786 TEST=Search for "จำลอง" in the omnibox; enter "จ" and get a valid selection of the inline autocomplete text. R=asvitkine@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=267752

Patch Set 1 #

Patch Set 2 : Add RenderText::IsValidLogicalIndex for SelectRange, etc. #

Patch Set 3 : Find adjacent indices in MoveCursorTo as needed; renaming and cleanup. #

Patch Set 4 : Skip painting empty glyph ranges; add unit test. #

Patch Set 5 : Fix RenderTextPango behavior similarly. #

Patch Set 6 : Consolidate IsValidLogicalIndex implementations. #

Total comments: 6

Patch Set 7 : Address comments. #

Total comments: 10

Patch Set 8 : Address comments. #

Patch Set 9 : Extrapolate on the comment. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+129 lines, -94 lines) Patch
M ui/gfx/render_text.h View 1 2 3 4 5 6 3 chunks +11 lines, -9 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 8 8 chunks +34 lines, -18 lines 0 comments Download
M ui/gfx/render_text_mac.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/render_text_mac.cc View 1 2 3 4 5 5 chunks +7 lines, -7 lines 0 comments Download
M ui/gfx/render_text_pango.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/render_text_pango.cc View 1 2 3 4 5 5 chunks +15 lines, -22 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 6 chunks +39 lines, -13 lines 0 comments Download
M ui/gfx/render_text_win.h View 1 2 3 4 5 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/render_text_win.cc View 1 2 3 4 5 6 4 chunks +19 lines, -21 lines 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 2 1 chunk +1 line, -1 line 0 comments Download

Messages

Total messages: 17 (0 generated)
msw
Hey Alexei, please take a look; thanks!
6 years, 7 months ago (2014-04-29 06:26:25 UTC) #1
msw
Friendly ping, will you have a chance to review soon? (others CC'ed are welcome to ...
6 years, 7 months ago (2014-04-30 19:39:06 UTC) #2
Alexei Svitkine (slow)
Sorry, will take a look now. Have been swarmed with reviews in the last couple ...
6 years, 7 months ago (2014-04-30 19:40:43 UTC) #3
Alexei Svitkine (slow)
https://codereview.chromium.org/252563003/diff/140001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/252563003/diff/140001/ui/gfx/render_text.cc#newcode777 ui/gfx/render_text.cc:777: index < GetLayoutText().length())); Hmm, I don't understand this logic ...
6 years, 7 months ago (2014-04-30 19:53:24 UTC) #4
msw
Please take another look; thanks! https://codereview.chromium.org/252563003/diff/140001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/252563003/diff/140001/ui/gfx/render_text.cc#newcode777 ui/gfx/render_text.cc:777: index < GetLayoutText().length())); On ...
6 years, 7 months ago (2014-05-01 20:40:04 UTC) #5
Alexei Svitkine (slow)
https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc#newcode776 ui/gfx/render_text.cc:776: (index <= text().length() && Nit: Since you check for ...
6 years, 7 months ago (2014-05-01 20:48:08 UTC) #6
msw
Thanks for the comments, please take another look. https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc#newcode776 ui/gfx/render_text.cc:776: (index ...
6 years, 7 months ago (2014-05-01 22:43:22 UTC) #7
Alexei Svitkine (slow)
LGTM, thanks for the detailed explanation! https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc#newcode777 ui/gfx/render_text.cc:777: (truncate_length_ == 0 ...
6 years, 7 months ago (2014-05-01 22:53:38 UTC) #8
msw
https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/252563003/diff/160001/ui/gfx/render_text.cc#newcode777 ui/gfx/render_text.cc:777: (truncate_length_ == 0 || index < truncate_length_) && On ...
6 years, 7 months ago (2014-05-01 23:04:34 UTC) #9
msw
The CQ bit was checked by msw@chromium.org
6 years, 7 months ago (2014-05-01 23:04:42 UTC) #10
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/252563003/200001
6 years, 7 months ago (2014-05-01 23:05:06 UTC) #11
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 7 months ago (2014-05-02 00:14:12 UTC) #12
commit-bot: I haz the power
Try jobs failed on following builders: mac_chromium_rel on tryserver.chromium
6 years, 7 months ago (2014-05-02 00:14:12 UTC) #13
msw
The CQ bit was checked by msw@chromium.org
6 years, 7 months ago (2014-05-02 00:38:19 UTC) #14
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/252563003/200001
6 years, 7 months ago (2014-05-02 00:38:49 UTC) #15
commit-bot: I haz the power
Change committed as 267752
6 years, 7 months ago (2014-05-02 05:15:15 UTC) #16
falken
6 years, 7 months ago (2014-05-02 09:13:24 UTC) #17
Message was sent while issue was closed.
A revert of this CL has been created in
https://codereview.chromium.org/263833010/ by falken@chromium.org.

The reason for reverting is: Sorry to revert. After this patch the following
test started failing on XP Tests (3):
RenderTextTest.MidGraphemeSelectionBounds

Log:
http://build.chromium.org/p/chromium.win/builders/XP%20Tests%20%283%29/builds...

Snippet from log:
c:\b\build\slave\cr-win-rel\build\src\ui\gfx\render_text_unittest.cc(930):
error: Value of: render_text->IsValidCursorIndex(1)
  Actual: true
Expected: false
.

Powered by Google App Engine
This is Rietveld 408576698