| Index: ui/gfx/render_text_harfbuzz.cc
|
| diff --git a/ui/gfx/render_text_harfbuzz.cc b/ui/gfx/render_text_harfbuzz.cc
|
| index a2610f3787288305adb7f9d3c7b07044d8391511..d6c26c0ab1446b53ec9d6afb7322b76cc39b7d37 100644
|
| --- a/ui/gfx/render_text_harfbuzz.cc
|
| +++ b/ui/gfx/render_text_harfbuzz.cc
|
| @@ -1165,6 +1165,7 @@ void RenderTextHarfBuzz::ItemizeTextToRuns(
|
| run->underline = style.style(UNDERLINE);
|
| int32 script_item_break = 0;
|
| bidi_iterator.GetLogicalRun(run_break, &script_item_break, &run->level);
|
| +
|
| // Odd BiDi embedding levels correspond to RTL runs.
|
| run->is_rtl = (run->level % 2) == 1;
|
| // Find the length and script of this script run.
|
| @@ -1183,6 +1184,9 @@ void RenderTextHarfBuzz::ItemizeTextToRuns(
|
| if (run_break > run->range.start())
|
| run_break = FindRunBreakingCharacter(text, run->range.start(), run_break);
|
|
|
| + if (run_break <= run->range.start())
|
| + run_break = std::max(script_item_break, run_break + 1);
|
| +
|
| DCHECK(IsValidCodePointIndex(text, run_break));
|
| style.UpdatePosition(DisplayIndexToTextIndex(run_break));
|
| run->range.set_end(run_break);
|
|
|