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

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

Created:
7 years ago by Anuj
Modified:
6 years, 11 months 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 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: - Changed ellipsis width check to use render text (render_Text.cc) - Modify tests to never have a scenario where the input is less wide than the elided. 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=242828

Patch Set 1 #

Patch Set 2 : Fixed patch #

Patch Set 3 : Addressed comments from crrev.com/107513011 #

Total comments: 32

Patch Set 4 : Addressed comments from msw #1 #

Total comments: 10

Patch Set 5 : Addressed comments from msw #2 #

Total comments: 2

Patch Set 6 : Ready for commit #

Patch Set 7 : Rebase, recompile, retest #

Patch Set 8 : Reloading after setting core.autocrlf false #

Patch Set 9 : Fixed merge issue #

Unified diffs Side-by-side diffs Delta from patch set Stats (+438 lines, -300 lines) Patch
M base/i18n/rtl.h View 1 2 chunks +3 lines, -1 line 0 comments Download
M base/i18n/rtl.cc View 1 1 chunk +15 lines, -0 lines 0 comments Download
M base/i18n/rtl_unittest.cc View 1 2 chunks +64 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_result_view.h View 1 1 chunk +0 lines, -16 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_result_view.cc View 1 2 3 4 5 6 7 8 1 chunk +45 lines, -201 lines 0 comments Download
M ui/gfx/render_text.h View 1 2 3 4 5 6 7 8 5 chunks +15 lines, -0 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 8 8 chunks +121 lines, -8 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 1 chunk +85 lines, -0 lines 0 comments Download
M ui/gfx/text_elider.h View 1 2 3 4 5 6 7 8 2 chunks +35 lines, -1 line 0 comments Download
M ui/gfx/text_elider.cc View 1 2 3 4 5 6 7 8 4 chunks +55 lines, -73 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
Anuj
Created Revert of Revert of Implement eliding/truncating at end in RenderText
7 years ago (2013-12-20 06:24:37 UTC) #1
Anuj
Patch Set 1 was created by "Revert of Revert". Patch Set 2 has additional changes ...
7 years ago (2013-12-20 07:03:28 UTC) #2
Anuj
FYI https://codereview.chromium.org/119813002/diff/4/chrome/browser/ui/views/omnibox/omnibox_result_view.cc File chrome/browser/ui/views/omnibox/omnibox_result_view.cc (right): https://codereview.chromium.org/119813002/diff/4/chrome/browser/ui/views/omnibox/omnibox_result_view.cc#newcode397 chrome/browser/ui/views/omnibox/omnibox_result_view.cc:397: (remaining_width < render_text->GetContentWidth())) { Will remove this block. ...
7 years ago (2013-12-20 08:25:32 UTC) #3
Anuj
Awaiting review. PTAL.
6 years, 12 months ago (2013-12-26 22:39:08 UTC) #4
msw
https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc#newcode1151 ui/gfx/render_text.cc:1151: if (text.empty()) nit: consider an early return (text or ...
6 years, 12 months ago (2013-12-27 22:54:32 UTC) #5
Anuj
https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc#newcode1151 ui/gfx/render_text.cc:1151: if (text.empty()) That check exists on line 1137. I ...
6 years, 11 months ago (2013-12-30 22:46:57 UTC) #6
msw
https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc#newcode1151 ui/gfx/render_text.cc:1151: if (text.empty()) On 2013/12/30 22:46:58, Anuj wrote: > That ...
6 years, 11 months ago (2013-12-30 23:17:59 UTC) #7
Anuj
https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc#newcode1151 ui/gfx/render_text.cc:1151: if (text.empty()) On 2013/12/30 23:17:59, msw wrote: > On ...
6 years, 11 months ago (2013-12-31 00:04:03 UTC) #8
msw
LGTM with a q/nit. https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc#newcode1151 ui/gfx/render_text.cc:1151: if (text.empty()) ok, lol https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text_unittest.cc ...
6 years, 11 months ago (2013-12-31 00:24:52 UTC) #9
Peter Kasting
https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text.cc#newcode1151 ui/gfx/render_text.cc:1151: if (text.empty()) On 2013/12/31 00:04:03, Anuj wrote: > I ...
6 years, 11 months ago (2013-12-31 00:27:17 UTC) #10
Anuj
https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text_unittest.cc File ui/gfx/render_text_unittest.cc (right): https://codereview.chromium.org/119813002/diff/4/ui/gfx/render_text_unittest.cc#newcode461 ui/gfx/render_text_unittest.cc:461: input += WideToUTF16(L" MMMMMMMMMMM"); On 2013/12/31 00:24:52, msw wrote: ...
6 years, 11 months ago (2013-12-31 00:42:03 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/119813002/430001
6 years, 11 months ago (2013-12-31 00:42:52 UTC) #12
commit-bot: I haz the power
Failed to apply patch for chrome/browser/ui/views/omnibox/omnibox_result_view.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 11 months ago (2013-12-31 00:43:03 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/119813002/390002
6 years, 11 months ago (2013-12-31 01:15:03 UTC) #14
commit-bot: I haz the power
Failed to apply patch for chrome/browser/ui/views/omnibox/omnibox_result_view.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 11 months ago (2013-12-31 01:15:07 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/119813002/520001
6 years, 11 months ago (2013-12-31 01:27:07 UTC) #16
commit-bot: I haz the power
Failed to apply patch for chrome/browser/ui/views/omnibox/omnibox_result_view.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 11 months ago (2013-12-31 01:27:11 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/119813002/520001
6 years, 11 months ago (2013-12-31 01:27:57 UTC) #18
commit-bot: I haz the power
Failed to apply patch for chrome/browser/ui/views/omnibox/omnibox_result_view.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 11 months ago (2013-12-31 01:28:01 UTC) #19
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/119813002/570001
6 years, 11 months ago (2013-12-31 01:40:35 UTC) #20
commit-bot: I haz the power
Retried try job too often on chromium_presubmit for step(s) presubmit http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=chromium_presubmit&number=42951
6 years, 11 months ago (2013-12-31 01:55:19 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/119813002/570001
6 years, 11 months ago (2014-01-01 02:57:01 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/skanuj@chromium.org/119813002/570001
6 years, 11 months ago (2014-01-02 02:51:59 UTC) #23
commit-bot: I haz the power
6 years, 11 months ago (2014-01-02 23:06:49 UTC) #24
Message was sent while issue was closed.
Change committed as 242828

Powered by Google App Engine
This is Rietveld 408576698