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

Issue 7841056: fix know issues in RenderText (Closed)

Created:
9 years, 3 months ago by xji
Modified:
9 years, 3 months ago
CC:
chromium-reviews, brettw-cc_chromium.org, dhollowa, jshin+watch_chromium.org, Paweł Hajdan Jr.
Visibility:
Public.

Description

This is a reapply of http://src.chromium.org/viewvc/chrome?view=rev&revision=102006 fix know issues in RenderText 1. add tests. 2. change SelectWord() to use BreakIterator, so it works for Chinese and Complex script. 3. DELETE/ReplaceChar delete/replace a whole grapheme. ReplaceTextInternal should only replace one grapheme when there is no selection. 4. pointing to position outside of text returns HOME/END position. 5. based on Chrome Linux omnibox and gedit, given "abc| def", double click should select " " instead of "abc". Change test expectation. BUG=90426 TEST=compile with touchui=1 test omnibox. run views_unittests.NativeTextfieldViewsTest/TextfieldViewsModelTest Committed: http://src.chromium.org/viewvc/chrome?view=rev&revision=102160

Patch Set 1 #

Total comments: 66

Patch Set 2 : '' #

Patch Set 3 : aupdate RenderTextWin. update test for Win platform. upload RenderTextTest that was missed #

Total comments: 27

Patch Set 4 : '' #

Patch Set 5 : '' #

Patch Set 6 : fix Win test failure #

Total comments: 18

Patch Set 7 : address comments #

Total comments: 1

Patch Set 8 : fix linux_clang compilation #

Patch Set 9 : fix a capitalization in break_iterator.h #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1156 lines, -126 lines) Patch
M base/i18n/break_iterator.h View 1 2 3 4 5 6 7 8 1 chunk +6 lines, -0 lines 0 comments Download
M base/i18n/break_iterator.cc View 1 2 3 4 5 6 7 1 chunk +21 lines, -0 lines 0 comments Download
M ui/gfx/render_text.h View 1 2 3 4 5 6 7 4 chunks +16 lines, -3 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 5 chunks +31 lines, -38 lines 0 comments Download
M ui/gfx/render_text_linux.h View 1 2 3 4 5 6 7 1 chunk +7 lines, -13 lines 0 comments Download
M ui/gfx/render_text_linux.cc View 1 2 3 4 5 6 7 6 chunks +23 lines, -15 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 10 chunks +323 lines, -14 lines 0 comments Download
M ui/gfx/render_text_win.h View 1 2 3 4 5 6 7 2 chunks +5 lines, -7 lines 0 comments Download
M ui/gfx/render_text_win.cc View 1 2 3 4 5 6 7 3 chunks +37 lines, -24 lines 0 comments Download
M views/controls/textfield/native_textfield_views_unittest.cc View 1 2 3 4 5 6 7 6 chunks +394 lines, -0 lines 0 comments Download
M views/controls/textfield/textfield_views_model.cc View 1 2 3 4 5 6 7 3 chunks +8 lines, -3 lines 0 comments Download
M views/controls/textfield/textfield_views_model_unittest.cc View 1 2 3 4 5 6 7 6 chunks +285 lines, -9 lines 0 comments Download

Messages

Total messages: 13 (0 generated)
xji
Note: some tests will fail in Win. I am thinking to disable them temporarily and ...
9 years, 3 months ago (2011-09-09 01:08:27 UTC) #1
behdad_google
LGTM
9 years, 3 months ago (2011-09-09 18:12:11 UTC) #2
msw
Great tests and fixes, thanks! See comments. Some of the tests might be better suited ...
9 years, 3 months ago (2011-09-09 23:03:23 UTC) #3
xji
http://codereview.chromium.org/7841056/diff/1/base/i18n/break_iterator.h File base/i18n/break_iterator.h (right): http://codereview.chromium.org/7841056/diff/1/base/i18n/break_iterator.h#newcode93 base/i18n/break_iterator.h:93: // BREAK_NEWLINE modes, On 2011/09/09 23:03:24, msw wrote: > ...
9 years, 3 months ago (2011-09-12 21:31:48 UTC) #4
msw
Thanks for moving some tests to RenderText! If you can use more constants to define ...
9 years, 3 months ago (2011-09-14 02:43:48 UTC) #5
xji
http://codereview.chromium.org/7841056/diff/17001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): http://codereview.chromium.org/7841056/diff/17001/ui/gfx/render_text.cc#newcode460 ui/gfx/render_text.cc:460: return std::min(static_cast<long>(position + 1), On 2011/09/14 02:43:48, msw wrote: ...
9 years, 3 months ago (2011-09-15 23:38:13 UTC) #6
msw
Mostly nits. http://codereview.chromium.org/7841056/diff/17001/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): http://codereview.chromium.org/7841056/diff/17001/ui/gfx/render_text_unittest.cc#newcode196 ui/gfx/render_text_unittest.cc:196: SelectionModel sel = expected[num_of_selection_entry - 1]; On ...
9 years, 3 months ago (2011-09-16 17:39:08 UTC) #7
xji
http://codereview.chromium.org/7841056/diff/25001/ui/gfx/render_text_linux.cc File ui/gfx/render_text_linux.cc (right): http://codereview.chromium.org/7841056/diff/25001/ui/gfx/render_text_linux.cc#newcode276 ui/gfx/render_text_linux.cc:276: size_t utf8_index_of_current_grapheme, bool next) const { On 2011/09/16 17:39:08, ...
9 years, 3 months ago (2011-09-16 20:29:24 UTC) #8
msw
LGTM; make sure trybots pass before landing!
9 years, 3 months ago (2011-09-16 21:54:39 UTC) #9
xji
Hi Evan, Could you please review the change in base/i18n? Thanks, xiaomei
9 years, 3 months ago (2011-09-16 23:02:24 UTC) #10
Evan Martin
base LGTM http://codereview.chromium.org/7841056/diff/25002/base/i18n/break_iterator.h File base/i18n/break_iterator.h (right): http://codereview.chromium.org/7841056/diff/25002/base/i18n/break_iterator.h#newcode92 base/i18n/break_iterator.h:92: // at the start of word. It ...
9 years, 3 months ago (2011-09-16 23:09:20 UTC) #11
xji
patchset 8 fix clang compilation error in render_text_linux.cc: ui/gfx/render_text_linux.cc:252:20: error: comparison of unsigned expression >= ...
9 years, 3 months ago (2011-09-21 18:15:49 UTC) #12
msw
9 years, 3 months ago (2011-09-21 18:16:55 UTC) #13
According to xji, the clang build error was:
ui/gfx/render_text_linux.cc:252:20: error: comparison of unsigned expression >=
0 is always true
The fix was:
return (position >= 0 && position < static_cast<size_t>(num_log_attrs_) &&
changed to:
return (position < static_cast<size_t>(num_log_attrs_) &&
fix LGTM

Powered by Google App Engine
This is Rietveld 408576698