| Index: Source/core/css/FontLoader.cpp
|
| diff --git a/Source/core/css/FontLoader.cpp b/Source/core/css/FontLoader.cpp
|
| index 66a604cc7943265330562569e878b3b660780029..585da7ce8074f4ca24e6152dfb4b09bde042bab7 100644
|
| --- a/Source/core/css/FontLoader.cpp
|
| +++ b/Source/core/css/FontLoader.cpp
|
| @@ -312,11 +312,6 @@ bool FontLoader::checkFont(const String& fontString, const String&)
|
| return true;
|
| }
|
|
|
| -static void applyPropertyToCurrentStyle(StyleResolver* styleResolver, CSSPropertyID id, const RefPtr<StylePropertySet>& parsedStyle)
|
| -{
|
| - styleResolver->applyPropertyToCurrentStyle(id, parsedStyle->getPropertyCSSValue(id).get());
|
| -}
|
| -
|
| bool FontLoader::resolveFontStyle(const String& fontString, Font& font)
|
| {
|
| // Interpret fontString in the same way as the 'font' attribute of CanvasRenderingContext2D.
|
| @@ -344,19 +339,16 @@ bool FontLoader::resolveFontStyle(const String& fontString, Font& font)
|
| style->font().update(style->font().fontSelector());
|
|
|
| // Now map the font property longhands into the style.
|
| + CSSPropertyValue properties[] = {
|
| + CSSPropertyValue(CSSPropertyFontFamily, *parsedStyle),
|
| + CSSPropertyValue(CSSPropertyFontStyle, *parsedStyle),
|
| + CSSPropertyValue(CSSPropertyFontVariant, *parsedStyle),
|
| + CSSPropertyValue(CSSPropertyFontWeight, *parsedStyle),
|
| + CSSPropertyValue(CSSPropertyFontSize, *parsedStyle),
|
| + CSSPropertyValue(CSSPropertyLineHeight, *parsedStyle),
|
| + };
|
| StyleResolver* styleResolver = m_document->styleResolver();
|
| - styleResolver->applyPropertyToStyle(CSSPropertyFontFamily, parsedStyle->getPropertyCSSValue(CSSPropertyFontFamily).get(), style.get());
|
| - applyPropertyToCurrentStyle(styleResolver, CSSPropertyFontStyle, parsedStyle);
|
| - applyPropertyToCurrentStyle(styleResolver, CSSPropertyFontVariant, parsedStyle);
|
| - applyPropertyToCurrentStyle(styleResolver, CSSPropertyFontWeight, parsedStyle);
|
| -
|
| - // As described in BUG66291, setting font-size and line-height on a font may entail a CSSPrimitiveValue::computeLengthDouble call,
|
| - // which assumes the fontMetrics are available for the affected font, otherwise a crash occurs (see http://trac.webkit.org/changeset/96122).
|
| - // The updateFont() calls below update the fontMetrics and ensure the proper setting of font-size and line-height.
|
| - styleResolver->updateFont();
|
| - applyPropertyToCurrentStyle(styleResolver, CSSPropertyFontSize, parsedStyle);
|
| - styleResolver->updateFont();
|
| - applyPropertyToCurrentStyle(styleResolver, CSSPropertyLineHeight, parsedStyle);
|
| + styleResolver->applyPropertiesToStyle(properties, WTF_ARRAY_LENGTH(properties), style.get());
|
|
|
| font = style->font();
|
| font.update(styleResolver->fontSelector());
|
|
|