| Index: third_party/WebKit/Source/core/layout/LayoutText.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutText.cpp b/third_party/WebKit/Source/core/layout/LayoutText.cpp
|
| index d6cc72e451eedaad34ef2b71ad43a2af188884a5..1d1d770f8ab98efa83f2e32b9e8452b65e6ba39e 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutText.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutText.cpp
|
| @@ -1084,7 +1084,7 @@ void LayoutText::computePreferredLogicalWidths(
|
| BidiResolver<TextRunIterator, BidiCharacterRun> bidiResolver;
|
| BidiCharacterRun* run;
|
| TextDirection textDirection = styleToUse.direction();
|
| - if ((is8Bit() && textDirection == LTR) ||
|
| + if ((is8Bit() && textDirection == TextDirection::Ltr) ||
|
| isOverride(styleToUse.unicodeBidi())) {
|
| run = 0;
|
| } else {
|
| @@ -1197,13 +1197,17 @@ void LayoutText::computePreferredLogicalWidths(
|
| float wordTrailingSpaceWidth = 0;
|
| if (isSpace &&
|
| (f.getFontDescription().getTypesettingFeatures() & Kerning)) {
|
| - ASSERT(textDirection >= 0 && textDirection <= 1);
|
| - if (!cachedWordTrailingSpaceWidth[textDirection])
|
| - cachedWordTrailingSpaceWidth[textDirection] =
|
| + const unsigned textDirectionIndex =
|
| + static_cast<unsigned>(textDirection);
|
| + DCHECK_GE(textDirectionIndex, 0U);
|
| + DCHECK_LE(textDirectionIndex, 1U);
|
| + if (!cachedWordTrailingSpaceWidth[textDirectionIndex])
|
| + cachedWordTrailingSpaceWidth[textDirectionIndex] =
|
| f.width(constructTextRun(f, &spaceCharacter, 1, styleToUse,
|
| textDirection)) +
|
| wordSpacing;
|
| - wordTrailingSpaceWidth = cachedWordTrailingSpaceWidth[textDirection];
|
| + wordTrailingSpaceWidth =
|
| + cachedWordTrailingSpaceWidth[textDirectionIndex];
|
| }
|
|
|
| float w;
|
|
|