Chromium Code Reviews| 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..cb072e1c27494ea7bb8847373ea0b1b8b4f7c444 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,16 @@ void LayoutText::computePreferredLogicalWidths( |
| float wordTrailingSpaceWidth = 0; |
| if (isSpace && |
| (f.getFontDescription().getTypesettingFeatures() & Kerning)) { |
| - ASSERT(textDirection >= 0 && textDirection <= 1); |
| - if (!cachedWordTrailingSpaceWidth[textDirection]) |
| - cachedWordTrailingSpaceWidth[textDirection] = |
| + unsigned textDirectionIndex = static_cast<unsigned>(textDirection); |
|
napper
2016/12/07 05:27:13
const unsigned textDirectionIndex = static_cast<un
sashab
2016/12/07 05:40:26
Done
|
| + 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; |