Chromium Code Reviews| Index: Source/core/rendering/RenderText.cpp |
| diff --git a/Source/core/rendering/RenderText.cpp b/Source/core/rendering/RenderText.cpp |
| index d60eac1bd18d6904e6c73b16bf977a4694d396ea..5adf2fb388ad1054d679c4a7fbbe13d445742e05 100644 |
| --- a/Source/core/rendering/RenderText.cpp |
| +++ b/Source/core/rendering/RenderText.cpp |
| @@ -938,9 +938,10 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si |
| bool breakAll = (styleToUse->wordBreak() == BreakAllWordBreak || styleToUse->wordBreak() == BreakWordBreak) && styleToUse->autoWrap(); |
| TextRun textRun(text()); |
| - textRun.setDirection(textDirection); |
| BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver; |
| - bidiResolver.setStatus(BidiStatus(textRun.direction(), textRun.directionalOverride())); |
| + BidiStatus status; |
| + status.context = BidiContext::create(0, WTF::Unicode::OtherNeutral); |
| + bidiResolver.setStatus(status); |
| bidiResolver.setPositionIgnoringNestedIsolates(TextRunIterator(&textRun, 0)); |
| bool hardLineBreak = false; |
| bool reorderRuns = false; |
| @@ -951,11 +952,11 @@ void RenderText::computePreferredLogicalWidths(float leadWidth, HashSet<const Si |
| for (int i = 0; i < len; i++) { |
| UChar c = uncheckedCharacterAt(i); |
| - while (i > run->stop()) |
| + while (i > run->stop() || (run->next() && run->next()->direction() == run->direction())) |
|
leviw_travelin_and_unemployed
2014/03/03 19:27:46
Add a comment explaining what this does, and LGTM.
|
| run = run->next(); |
| ASSERT(run); |
| - ASSERT(i >= run->start() && i <= run->stop()); |
| + ASSERT(i <= run->stop()); |
| TextDirection textDirection = run->direction(); |
| bool previousCharacterIsSpace = isSpace; |