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

Issue 107513011: Implement eliding/truncating at end in RenderText (Closed)

Created:
7 years ago by Anuj
Modified:
7 years ago
CC:
chromium-reviews, tfarina, James Su, erikwright+watch_chromium.org, jshin+watch_chromium.org
Visibility:
Public.

Description

Implement eliding/truncating at end in RenderText patch from issue 112063003 The eliding is determined using binary search similar to the ElideText in ui/gfx/text_elider.cc. The mixed LTR-RTL handling for ellipsis is done using LTR/RTL markers. There is no other way of rendering the ellipsis with the directionality of preceding strong-directional characters. Previous scheme worked because it rendered LTR and RTL sub-strings as different RenderText instances. Added helper method to be able to determine directionality of the trailing text. Made StringSlicer used by text_elider.cc public to be shared by RenderText. Additional Fix: - Call UpdateLayoutText from SetDisplayRect. - Disable erratic tests on versions of windows older than Vista. BUG=327833 TEST=ui_unittests,base_unittests R=msw@chromium.org TBR=jshin@chromium.org,pkasting@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=241000

Patch Set 1 : Fixed patch #

Patch Set 2 : Original patch #

Patch Set 3 : Fixed patch #

Total comments: 8

Patch Set 4 : Addressed comments #

Total comments: 14
Unified diffs Side-by-side diffs Delta from patch set Stats (+439 lines, -299 lines) Patch
M base/i18n/rtl.h View 2 chunks +3 lines, -1 line 0 comments Download
M base/i18n/rtl.cc View 1 chunk +15 lines, -0 lines 0 comments Download
M base/i18n/rtl_unittest.cc View 2 chunks +64 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_result_view.h View 1 chunk +0 lines, -16 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_result_view.cc View 1 chunk +45 lines, -200 lines 12 comments Download
M ui/gfx/render_text.h View 5 chunks +16 lines, -0 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 7 chunks +120 lines, -8 lines 2 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 1 chunk +86 lines, -0 lines 0 comments Download
M ui/gfx/text_elider.h View 2 chunks +35 lines, -1 line 0 comments Download
M ui/gfx/text_elider.cc View 4 chunks +55 lines, -73 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
Anuj
PTAL.
7 years ago (2013-12-14 02:41:14 UTC) #1
msw
LGTM with a couple comments. https://codereview.chromium.org/107513011/diff/120001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/107513011/diff/120001/ui/gfx/render_text.cc#newcode448 ui/gfx/render_text.cc:448: UpdateLayoutText(); Just do this ...
7 years ago (2013-12-14 03:11:41 UTC) #2
Anuj
FYI. https://codereview.chromium.org/107513011/diff/120001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/107513011/diff/120001/ui/gfx/render_text.cc#newcode448 ui/gfx/render_text.cc:448: UpdateLayoutText(); On 2013/12/14 03:11:41, msw wrote: > Just ...
7 years ago (2013-12-14 03:35:03 UTC) #3
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/107513011/140001
7 years ago (2013-12-14 03:35:59 UTC) #4
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=202242
7 years ago (2013-12-14 04:44:45 UTC) #5
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/107513011/140001
7 years ago (2013-12-14 05:38:39 UTC) #6
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=204045
7 years ago (2013-12-14 06:16:34 UTC) #7
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/107513011/140001
7 years ago (2013-12-14 09:23:21 UTC) #8
commit-bot: I haz the power
Retried try job too often on linux_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=linux_rel&number=204140
7 years ago (2013-12-14 10:33:41 UTC) #9
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/107513011/140001
7 years ago (2013-12-14 10:46:35 UTC) #10
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=202424
7 years ago (2013-12-14 13:56:14 UTC) #11
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/107513011/140001
7 years ago (2013-12-15 01:21:31 UTC) #12
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=202615
7 years ago (2013-12-15 04:13:01 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/107513011/140001
7 years ago (2013-12-16 01:51:37 UTC) #14
commit-bot: I haz the power
Retried try job too often on mac_rel for step(s) browser_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=mac_rel&number=202821
7 years ago (2013-12-16 04:45:44 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/107513011/140001
7 years ago (2013-12-16 18:44:44 UTC) #16
commit-bot: I haz the power
Change committed as 241000
7 years ago (2013-12-16 20:19:07 UTC) #17
szym
On 2013/12/16 20:19:07, I haz the power (commit-bot) wrote: > Change committed as 241000 Fails ...
7 years ago (2013-12-16 22:05:50 UTC) #18
szym
A revert of this CL has been created in https://codereview.chromium.org/103053014/ by szym@chromium.org. The reason for ...
7 years ago (2013-12-16 22:11:16 UTC) #19
msw
https://codereview.chromium.org/107513011/diff/140001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/107513011/diff/140001/ui/gfx/render_text.cc#newcode1220 ui/gfx/render_text.cc:1220: hi = guess - 1; I hit a weird ...
7 years ago (2013-12-17 02:14:32 UTC) #20
Peter Kasting
https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views/omnibox/omnibox_result_view.cc File chrome/browser/ui/views/omnibox/omnibox_result_view.cc (right): https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views/omnibox/omnibox_result_view.cc#newcode376 chrome/browser/ui/views/omnibox/omnibox_result_view.cc:376: std::min(classifications[i + 1].offset, text_length) : text_length; Nit: Indent 4, ...
7 years ago (2013-12-17 21:30:55 UTC) #21
Anuj
https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views/omnibox/omnibox_result_view.cc File chrome/browser/ui/views/omnibox/omnibox_result_view.cc (right): https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views/omnibox/omnibox_result_view.cc#newcode376 chrome/browser/ui/views/omnibox/omnibox_result_view.cc:376: std::min(classifications[i + 1].offset, text_length) : text_length; On 2013/12/17 21:30:56, ...
7 years ago (2013-12-20 07:02:41 UTC) #22
Peter Kasting
https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views/omnibox/omnibox_result_view.cc File chrome/browser/ui/views/omnibox/omnibox_result_view.cc (right): https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views/omnibox/omnibox_result_view.cc#newcode396 chrome/browser/ui/views/omnibox/omnibox_result_view.cc:396: (remaining_width < render_text->GetContentWidth())) { On 2013/12/20 07:02:42, Anuj wrote: ...
7 years ago (2013-12-20 07:32:30 UTC) #23
Anuj
7 years ago (2013-12-20 08:21:55 UTC) #24
Message was sent while issue was closed.
https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views...
File chrome/browser/ui/views/omnibox/omnibox_result_view.cc (right):

https://codereview.chromium.org/107513011/diff/140001/chrome/browser/ui/views...
chrome/browser/ui/views/omnibox/omnibox_result_view.cc:396: (remaining_width <
render_text->GetContentWidth())) {
> > Also, I thought {} is required when "if conditional has a line-break"
> 
> No, it's a matter of when the body takes up more than one physical line.

See comment from Scott Hess  on line 118.
https://codereview.chromium.org/98463012/diff/120001/chrome/browser/autocompl...

Powered by Google App Engine
This is Rietveld 408576698