| Index: third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
|
| diff --git a/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp b/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
|
| index 47e6e63e040e414729a7a7b6f0f30b4184bfa28d..138efd024b1388d9d43a83fbb76c1594ed67a420 100644
|
| --- a/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
|
| +++ b/third_party/WebKit/Source/core/layout/LayoutTextControlSingleLine.cpp
|
| @@ -231,15 +231,16 @@ LayoutUnit LayoutTextControlSingleLine::preferredContentLogicalWidth(float charW
|
| LayoutUnit result = LayoutUnit::fromFloatCeil(charWidth * factor);
|
|
|
| float maxCharWidth = 0.f;
|
| - AtomicString family = styleRef().font().getFontDescription().family().family();
|
| + const Font& font = style()->font();
|
| + AtomicString family = font.getFontDescription().family().family();
|
| // Match the default system font to the width of MS Shell Dlg, the default
|
| // font for textareas in Firefox, Safari Win and IE for some encodings (in
|
| // IE, the default font is encoding specific). 4027 is the (xMax - xMin)
|
| // value in the "head" font table for MS Shell Dlg.
|
| if (LayoutTheme::theme().needsHackForTextControlWithFontFamily(family))
|
| maxCharWidth = scaleEmToUnits(4027);
|
| - else if (hasValidAvgCharWidth(family))
|
| - maxCharWidth = roundf(styleRef().font().primaryFont()->maxCharWidth());
|
| + else if (hasValidAvgCharWidth(font.primaryFont(), family))
|
| + maxCharWidth = roundf(font.primaryFont()->maxCharWidth());
|
|
|
| // For text inputs, IE adds some extra width.
|
| if (maxCharWidth > 0.f)
|
|
|