Chromium Code Reviews| Index: ui/gfx/render_text_harfbuzz.cc |
| diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc |
| index 3c71cff58c57c1b5dabf7aacff9bf7cc9764be6e..a60cc8499a388bd36d014376b810a1c55756ce2a 100644 |
| --- a/ui/gfx/render_text_harfbuzz.cc |
| +++ b/ui/gfx/render_text_harfbuzz.cc |
| @@ -1151,7 +1151,11 @@ void RenderTextHarfBuzz::ItemizeTextToRuns( |
| // Build the run list from the script items and ranged styles and baselines. |
| // Use an empty color BreakList to avoid breaking runs at color boundaries. |
| BreakList<SkColor> empty_colors; |
| - empty_colors.SetMax(text.length()); |
| + // StyleIterator is specified over the text, which can be different from |
| + // |text| variable given in the argument. Therefore its max should be |
| + // the text length, not "text->length()", otherwise it prevents to reach |
| + // to the end of the given text in the loop below. |
| + empty_colors.SetMax(this->text().length()); |
|
msw
2015/03/24 01:56:31
Just use colors().max() and remove this comment.
|
| internal::StyleIterator style(empty_colors, baselines(), styles()); |
| for (size_t run_break = 0; run_break < text.length();) { |