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

Issue 384953003: RenderText: handle center-aligned text in UpdateCachedBoundsAndOffset() (Closed)

Created:
6 years, 5 months ago by mohsen
Modified:
6 years, 5 months ago
Reviewers:
msw
CC:
chromium-reviews
Project:
chromium
Visibility:
Public.

Description

RenderText: handle center-aligned text in UpdateCachedBoundsAndOffset() In case display width is less than content width, UpdateCachedBoundsAndOffset() does not handle center-aligned text properly when content width is reduced (e.g. by deleting some characters) or display width is increased. BUG=none Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=284897

Patch Set 1 #

Total comments: 5

Patch Set 2 : Used SetDisplayOffset() in UpdateChachedBoundsAndOffset() #

Total comments: 8

Patch Set 3 : Cleaned up comments #

Patch Set 4 : Added test #

Total comments: 15

Patch Set 5 : Improved test + nits #

Patch Set 6 : Used cursor bounds instead of display offset #

Patch Set 7 : Disabled on mac #

Patch Set 8 : Rebased + Fixed off-by-one problem #

Patch Set 9 : Fixed off-by-one problem, more #

Total comments: 7

Patch Set 10 : nits #

Patch Set 11 : Added explanation for display offset range calculations #

Unified diffs Side-by-side diffs Delta from patch set Stats (+61 lines, -45 lines) Patch
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 8 9 10 3 chunks +22 lines, -42 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 9 2 chunks +39 lines, -3 lines 0 comments Download

Messages

Total messages: 18 (0 generated)
mohsen
Please take a look...
6 years, 5 months ago (2014-07-10 23:24:22 UTC) #1
msw
https://codereview.chromium.org/384953003/diff/1/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/1/ui/gfx/render_text.cc#newcode1344 ui/gfx/render_text.cc:1344: const int negate_rtl = horizontal_alignment_ == ALIGN_RIGHT ? -1 ...
6 years, 5 months ago (2014-07-11 22:33:04 UTC) #2
mohsen
Please take another look... https://codereview.chromium.org/384953003/diff/1/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/1/ui/gfx/render_text.cc#newcode1347 ui/gfx/render_text.cc:1347: if (display_width > (content_width + ...
6 years, 5 months ago (2014-07-14 20:57:01 UTC) #3
msw
Can you add a test that this CL fixes? https://codereview.chromium.org/384953003/diff/1/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/1/ui/gfx/render_text.cc#newcode1347 ui/gfx/render_text.cc:1347: ...
6 years, 5 months ago (2014-07-16 01:41:43 UTC) #4
mohsen
Added test and cleaned up comments. https://codereview.chromium.org/384953003/diff/20001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (left): https://codereview.chromium.org/384953003/diff/20001/ui/gfx/render_text.cc#oldcode1342 ui/gfx/render_text.cc:1342: // Reduce the ...
6 years, 5 months ago (2014-07-16 20:48:10 UTC) #5
msw
https://codereview.chromium.org/384953003/diff/60001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/60001/ui/gfx/render_text.cc#newcode1322 ui/gfx/render_text.cc:1322: // TODO(bidi): In left-aligned text, when overflow character is ...
6 years, 5 months ago (2014-07-16 21:55:54 UTC) #6
mohsen
https://codereview.chromium.org/384953003/diff/60001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/60001/ui/gfx/render_text.cc#newcode1322 ui/gfx/render_text.cc:1322: // TODO(bidi): In left-aligned text, when overflow character is ...
6 years, 5 months ago (2014-07-16 23:36:21 UTC) #7
msw
Thanks, this is looking better, but I still hope we can avoid explicitly computing an ...
6 years, 5 months ago (2014-07-16 23:51:59 UTC) #8
mohsen
GetGlyphBounds() returns a glyph bound relative to the text itself, not the display rect, and ...
6 years, 5 months ago (2014-07-17 15:56:12 UTC) #9
msw
On 2014/07/17 15:56:12, mohsen wrote: > GetGlyphBounds() returns a glyph bound relative to the text ...
6 years, 5 months ago (2014-07-17 17:24:53 UTC) #10
mohsen
Can you take another look, please, specifically changes in RenderText::SetDisplayOffset().
6 years, 5 months ago (2014-07-22 05:50:58 UTC) #11
msw
lgtm with nits. https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc#newcode916 ui/gfx/render_text.cc:916: min_offset = -(extra_content - cursor_width + ...
6 years, 5 months ago (2014-07-22 22:00:27 UTC) #12
mohsen
https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc#newcode916 ui/gfx/render_text.cc:916: min_offset = -(extra_content - cursor_width + 1) / 2 ...
6 years, 5 months ago (2014-07-22 23:38:35 UTC) #13
msw
https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc File ui/gfx/render_text.cc (right): https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc#newcode916 ui/gfx/render_text.cc:916: min_offset = -(extra_content - cursor_width + 1) / 2 ...
6 years, 5 months ago (2014-07-23 03:08:17 UTC) #14
mohsen
The CQ bit was checked by mohsen@chromium.org
6 years, 5 months ago (2014-07-23 04:55:38 UTC) #15
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/mohsen@chromium.org/384953003/400001
6 years, 5 months ago (2014-07-23 04:58:04 UTC) #16
mohsen
On 2014/07/23 03:08:17, msw wrote: > https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc > File ui/gfx/render_text.cc (right): > > https://codereview.chromium.org/384953003/diff/360001/ui/gfx/render_text.cc#newcode916 > ...
6 years, 5 months ago (2014-07-23 05:04:15 UTC) #17
commit-bot: I haz the power
6 years, 5 months ago (2014-07-23 09:37:03 UTC) #18
Message was sent while issue was closed.
Change committed as 284897

Powered by Google App Engine
This is Rietveld 408576698