| Index: Source/core/rendering/RenderTheme.cpp
|
| diff --git a/Source/core/rendering/RenderTheme.cpp b/Source/core/rendering/RenderTheme.cpp
|
| index 972bcf6c11a8177510972e7bc259e6dcc554732b..bdb0677ea7bf27b7439cad0f28a12584eee8eb42 100644
|
| --- a/Source/core/rendering/RenderTheme.cpp
|
| +++ b/Source/core/rendering/RenderTheme.cpp
|
| @@ -989,6 +989,61 @@ void RenderTheme::platformColorsDidChange()
|
| Page::scheduleForcedStyleRecalcForAllPages();
|
| }
|
|
|
| +static FontDescription& getCachedFontDescription(CSSValueID systemFontID)
|
| +{
|
| + DEFINE_STATIC_LOCAL(FontDescription, caption, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, icon, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, menu, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, messageBox, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, smallCaption, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, statusBar, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, webkitMiniControl, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, webkitSmallControl, ());
|
| + DEFINE_STATIC_LOCAL(FontDescription, webkitControl, ());
|
| + switch (systemFontID) {
|
| + case CSSValueCaption:
|
| + return caption;
|
| + case CSSValueIcon:
|
| + return icon;
|
| + case CSSValueMenu:
|
| + return menu;
|
| + case CSSValueMessageBox:
|
| + return messageBox;
|
| + case CSSValueSmallCaption:
|
| + return smallCaption;
|
| + case CSSValueStatusBar:
|
| + return statusBar;
|
| + case CSSValueWebkitMiniControl:
|
| + return webkitMiniControl;
|
| + case CSSValueWebkitSmallControl:
|
| + return webkitSmallControl;
|
| + case CSSValueWebkitControl:
|
| + return webkitControl;
|
| + default:
|
| + ASSERT_NOT_REACHED();
|
| + return caption;
|
| + }
|
| +}
|
| +
|
| +void RenderTheme::systemFont(CSSValueID systemFontID, FontDescription& fontDescription)
|
| +{
|
| + fontDescription = getCachedFontDescription(systemFontID);
|
| + if (fontDescription.isAbsoluteSize())
|
| + return;
|
| +
|
| + FontStyle fontStyle = FontStyleNormal;
|
| + FontWeight fontWeight = FontWeightNormal;
|
| + float fontSize = 0;
|
| + AtomicString fontFamily;
|
| + systemFont(systemFontID, fontStyle, fontWeight, fontSize, fontFamily);
|
| + fontDescription.setStyle(fontStyle);
|
| + fontDescription.setWeight(fontWeight);
|
| + fontDescription.setSpecifiedSize(fontSize);
|
| + fontDescription.setIsAbsoluteSize(true);
|
| + fontDescription.firstFamily().setFamily(fontFamily);
|
| + fontDescription.setGenericFamily(FontDescription::NoFamily);
|
| +}
|
| +
|
| Color RenderTheme::systemColor(CSSValueID cssValueId) const
|
| {
|
| switch (cssValueId) {
|
|
|