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

Issue 11535014: Replace StyleRange with BreakList; update RenderText, etc. (Closed)

Created:
8 years ago by msw
Modified:
7 years, 10 months ago
CC:
chromium-reviews, sail+watch_chromium.org, xji
Visibility:
Public.

Description

Replace StyleRange with BreakList; update RenderText, etc. This is a functional rewrite with no observable behavior/appearance changes. (it helps by merging adjacent equivalent styles, reducing artificial run breaks) (it helps disambiguate font/adornment styles for application in layout/drawing) Remove gfx::StyleRange and its use within gfx::RenderText[Win|Linux|Mac]. Add new BreakList class for managing [ranged] colors and styles; add/update tests. Add gfx::TextStyle enum for bold, italic, underline, strike, and diagonal strike. Split ApplyStyleRange into [Set|Apply]Color and [Set|Apply]Style. Split ApplyDefaultStyle and |default_style_| into the first colors_ and styles_. Split up SkiaTextRenderer::DrawDecorations for Underline/Strike/DiagonalStrike. Update ApplyCompositionAndSelectionStyles, add UndoCompositionAndSelectionStyles. Add temporary StyleIterator convenience class for RenderText subclass style iteration. Update RenderText[Win|Linux|Mac], Textfield classes, and other users. Simplify OmniboxResultView (nix bold font, and ClassificationData). Rename gfx::Font::FontStyle::UNDERLINE (was UNDERLINED); TODO(followup): Only break runs for bold/italic, color/adorn while drawing. TODO(followup): Support more custom/ranged colors; merge TextStyle/FontStyle? BUG=90426, 164047, 131660 TEST=No observable appearance/performance/behavior changes. R=asvitkine@chromium.org,pkasting@chromium.org,sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=180067

Patch Set 1 : Implement and test StyleStop. #

Patch Set 2 : Cleanup, get Windows working. #

Patch Set 3 : Rewrite ColorBreak and FlagBreak with std::pair. #

Patch Set 4 : Refinements, get RenderText[Win|Linux|Mac] working. #

Patch Set 5 : Simplify OmniboxResultView; Rename StyleBreak; cleanup. #

Total comments: 40

Patch Set 6 : Address comments. #

Total comments: 18

Patch Set 7 : Rewrite with BreakList; address comments. #

Patch Set 8 : Add GetNextBreak and AdvanceIterators convenience methods; cleanup. #

Total comments: 42

Patch Set 9 : Address comments; add StyleIterator helper class. #

Patch Set 10 : Restore RenderTextMac's |max_style_count|. #

Total comments: 4

Patch Set 11 : Fix RenderTextMac style iteration. #

Total comments: 8

Patch Set 12 : Update iteration and helpers; add tests; etc. #

Total comments: 26

Patch Set 13 : Address comments and lint errors. #

Total comments: 6

Patch Set 14 : Address comments. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+1109 lines, -978 lines) Patch
M ash/system/user/tray_user.cc View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -8 lines 0 comments Download
M chrome/browser/ui/views/extensions/extension_installed_bubble.cc View 1 2 3 4 5 6 7 8 11 1 chunk +5 lines, -13 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.h View 1 2 3 4 5 6 7 11 2 chunks +5 lines, -11 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_popup_contents_view.cc View 1 2 3 4 3 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_result_view.h View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +7 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_result_view.cc View 1 2 3 4 5 6 7 8 9 chunks +50 lines, -74 lines 0 comments Download
M chrome/browser/ui/views/omnibox/omnibox_view_views.cc View 1 3 chunks +9 lines, -25 lines 0 comments Download
M chrome/browser/ui/views/omnibox/touch_omnibox_popup_contents_view.h View 1 2 3 4 2 chunks +4 lines, -7 lines 0 comments Download
M chrome/browser/ui/views/omnibox/touch_omnibox_popup_contents_view.cc View 1 2 3 4 2 chunks +6 lines, -9 lines 0 comments Download
M ui/app_list/views/search_result_view.cc View 1 2 3 4 5 2 chunks +5 lines, -14 lines 0 comments Download
A ui/gfx/break_list.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +165 lines, -0 lines 0 comments Download
A ui/gfx/break_list_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +166 lines, -0 lines 0 comments Download
M ui/gfx/canvas_skia.cc View 1 2 3 4 5 18 chunks +48 lines, -60 lines 0 comments Download
M ui/gfx/font.h View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gfx/font_list.cc View 1 2 3 4 1 chunk +1 line, -2 lines 0 comments Download
M ui/gfx/pango_util.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/platform_font.h View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ui/gfx/platform_font_pango.cc View 1 2 3 4 1 chunk +2 lines, -2 lines 0 comments Download
M ui/gfx/platform_font_win.cc View 1 2 3 4 2 chunks +2 lines, -2 lines 0 comments Download
M ui/gfx/render_text.h View 1 2 3 4 5 6 7 8 9 10 11 12 10 chunks +61 lines, -35 lines 0 comments Download
M ui/gfx/render_text.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 chunks +168 lines, -222 lines 0 comments Download
M ui/gfx/render_text_linux.h View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +6 lines, -0 lines 0 comments Download
M ui/gfx/render_text_linux.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 5 chunks +73 lines, -86 lines 0 comments Download
M ui/gfx/render_text_mac.h View 1 2 3 1 chunk +3 lines, -1 line 0 comments Download
M ui/gfx/render_text_mac.cc View 1 2 3 4 5 6 7 8 9 10 11 12 6 chunks +34 lines, -30 lines 0 comments Download
M ui/gfx/render_text_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +136 lines, -263 lines 0 comments Download
M ui/gfx/render_text_win.h View 1 1 chunk +4 lines, -4 lines 0 comments Download
M ui/gfx/render_text_win.cc View 1 2 3 4 5 6 7 8 9 10 11 12 5 chunks +30 lines, -34 lines 0 comments Download
M ui/gfx/text_constants.h View 1 2 3 4 1 chunk +11 lines, -0 lines 0 comments Download
M ui/ui.gyp View 1 2 3 4 5 6 7 8 9 10 11 12 1 chunk +1 line, -0 lines 0 comments Download
M ui/ui_unittests.gypi View 1 2 3 4 5 6 7 8 11 1 chunk +1 line, -0 lines 0 comments Download
M ui/views/controls/link.cc View 1 2 3 4 5 1 chunk +6 lines, -8 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_views.h View 1 1 chunk +6 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_views.cc View 1 2 3 4 5 6 2 chunks +17 lines, -9 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_win.h View 1 2 3 4 5 6 7 11 1 chunk +6 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_win.cc View 1 2 3 4 5 6 7 11 1 chunk +12 lines, -2 lines 0 comments Download
M ui/views/controls/textfield/native_textfield_wrapper.h View 1 2 chunks +9 lines, -6 lines 0 comments Download
M ui/views/controls/textfield/textfield.h View 1 2 3 4 5 3 chunks +11 lines, -10 lines 0 comments Download
M ui/views/controls/textfield/textfield.cc View 1 2 3 1 chunk +16 lines, -4 lines 0 comments Download
M ui/views/examples/text_example.cc View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M ui/views/examples/textfield_example.cc View 1 2 3 4 5 6 7 11 1 chunk +11 lines, -14 lines 0 comments Download

Messages

Total messages: 24 (0 generated)
msw
Hey everyone, please take a look at the following (or as much as you'd like): ...
7 years, 11 months ago (2013-01-22 07:23:40 UTC) #1
Alexei Svitkine (slow)
Can you split this into several smaller CLs so that it's easier to review? For ...
7 years, 11 months ago (2013-01-22 15:00:12 UTC) #2
sky
LGTM
7 years, 11 months ago (2013-01-22 15:46:55 UTC) #3
msw
On 2013/01/22 15:00:12, Alexei Svitkine wrote: > Can you split this into several smaller CLs ...
7 years, 11 months ago (2013-01-22 18:26:41 UTC) #4
Alexei Svitkine (slow)
On 2013/01/22 18:26:41, msw wrote: > On 2013/01/22 15:00:12, Alexei Svitkine wrote: > > Can ...
7 years, 11 months ago (2013-01-22 18:29:46 UTC) #5
msw
On 2013/01/22 18:29:46, Alexei Svitkine wrote: > I guess it's okay for this CL - ...
7 years, 11 months ago (2013-01-22 18:37:45 UTC) #6
Alexei Svitkine (slow)
Sorry, I haven't yet managed to get through the entire CL since it's so large, ...
7 years, 11 months ago (2013-01-22 19:20:20 UTC) #7
Alexei Svitkine (slow)
https://codereview.chromium.org/11535014/diff/46003/ui/gfx/render_text_mac.cc File ui/gfx/render_text_mac.cc (right): https://codereview.chromium.org/11535014/diff/46003/ui/gfx/render_text_mac.cc#newcode217 ui/gfx/render_text_mac.cc:217: end = std::min(end, style_end[i]); I find requiring this logic ...
7 years, 11 months ago (2013-01-22 19:41:03 UTC) #8
msw
Alexei, please take another look; thanks! https://codereview.chromium.org/11535014/diff/46003/ui/app_list/views/search_result_view.cc File ui/app_list/views/search_result_view.cc (right): https://codereview.chromium.org/11535014/diff/46003/ui/app_list/views/search_result_view.cc#newcode80 ui/app_list/views/search_result_view.cc:80: if (it->styles & ...
7 years, 11 months ago (2013-01-22 22:27:24 UTC) #9
Alexei Svitkine (slow)
Here's another round of comments. Still haven't gotten through the entire CL, so expect more. ...
7 years, 11 months ago (2013-01-23 16:52:54 UTC) #10
msw
Please take another look; a lot has changed with the BreakList rewrite; thanks. https://codereview.chromium.org/11535014/diff/45060/ui/gfx/render_text.cc File ...
7 years, 11 months ago (2013-01-25 09:10:02 UTC) #11
Alexei Svitkine (slow)
I have an offsite today, so I won't get a chance to review this more ...
7 years, 11 months ago (2013-01-25 13:06:55 UTC) #12
msw
Thanks for the thoughts, I'll wait to hear back as you have time. https://codereview.chromium.org/11535014/diff/52007/ui/gfx/render_text.h File ...
7 years, 11 months ago (2013-01-25 13:33:32 UTC) #13
Peter Kasting
c/b/ui/views/omnibox LGTM https://codereview.chromium.org/11535014/diff/52007/chrome/browser/ui/views/omnibox/omnibox_result_view.cc File chrome/browser/ui/views/omnibox/omnibox_result_view.cc (right): https://codereview.chromium.org/11535014/diff/52007/chrome/browser/ui/views/omnibox/omnibox_result_view.cc#newcode115 chrome/browser/ui/views/omnibox/omnibox_result_view.cc:115: font_height_(font.DeriveFont(0, gfx::BOLD).GetHeight()), How do you know this ...
7 years, 10 months ago (2013-01-28 00:47:38 UTC) #14
Alexei Svitkine (slow)
Here's another volley of comments. Believe or not, I still haven't looked through the entire ...
7 years, 10 months ago (2013-01-28 20:52:30 UTC) #15
msw
Comments addressed, fixing Mac RenderTextTest.StringSizeSanity crashes. Please take another look in the mean time, I ...
7 years, 10 months ago (2013-01-29 17:17:24 UTC) #16
Alexei Svitkine (slow)
https://codereview.chromium.org/11535014/diff/55006/ui/gfx/break_list.h File ui/gfx/break_list.h (right): https://codereview.chromium.org/11535014/diff/55006/ui/gfx/break_list.h#newcode119 ui/gfx/break_list.h:119: typename std::vector<std::pair<size_t, T> >::iterator BreakList<T>::GetBreak( Nit: std::vector<Break>? https://codereview.chromium.org/11535014/diff/55006/ui/gfx/break_list.h#newcode139 ui/gfx/break_list.h:139: ...
7 years, 10 months ago (2013-01-29 22:07:25 UTC) #17
msw
Comment addressed, please take another look. Alexei, I can't thank you enough for your patience ...
7 years, 10 months ago (2013-01-31 01:48:54 UTC) #18
Alexei Svitkine (slow)
A few more comments your way. Getting close. :) https://codereview.chromium.org/11535014/diff/68064/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): https://codereview.chromium.org/11535014/diff/68064/ash/system/user/tray_user.cc#newcode286 ash/system/user/tray_user.cc:286: ...
7 years, 10 months ago (2013-01-31 16:33:34 UTC) #19
msw
Please take another look; thanks! https://codereview.chromium.org/11535014/diff/68064/ash/system/user/tray_user.cc File ash/system/user/tray_user.cc (right): https://codereview.chromium.org/11535014/diff/68064/ash/system/user/tray_user.cc#newcode286 ash/system/user/tray_user.cc:286: display_name.Intersect(line_range)); On 2013/01/31 16:33:34, ...
7 years, 10 months ago (2013-01-31 20:27:39 UTC) #20
Alexei Svitkine (slow)
LGTM with a few last comments. Thanks for addressing all the other ones! https://codereview.chromium.org/11535014/diff/69016/ui/gfx/break_list.h File ...
7 years, 10 months ago (2013-01-31 21:25:06 UTC) #21
msw
Done; I'll land with green tryjobs unless anyone has more feedback. Thanks everyone, especially Alexei, ...
7 years, 10 months ago (2013-02-01 00:08:08 UTC) #22
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/msw@chromium.org/11535014/57050
7 years, 10 months ago (2013-02-01 01:30:45 UTC) #23
commit-bot: I haz the power
7 years, 10 months ago (2013-02-01 04:42:21 UTC) #24
Message was sent while issue was closed.
Change committed as 180067

Powered by Google App Engine
This is Rietveld 408576698