summaryrefslogtreecommitdiff
path: root/chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc
diff options
context:
space:
mode:
Diffstat (limited to 'chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc')
-rw-r--r--chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc57
1 files changed, 33 insertions, 24 deletions
diff --git a/chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc b/chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc
index 0d690783e4e..b806f1ac5b9 100644
--- a/chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc
+++ b/chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc
@@ -32,8 +32,6 @@
namespace blink {
-constexpr float kDefaultFontSize = 16.0;
-
// Converts |points| to pixels. One point is 1/72 of an inch.
static float PointsToPixels(float points) {
const float kPixelsPerInch = 96.0f;
@@ -42,38 +40,49 @@ static float PointsToPixels(float points) {
}
// static
-void LayoutThemeFontProvider::SystemFont(CSSValueID system_font_id,
- FontSelectionValue& font_style,
- FontSelectionValue& font_weight,
- float& font_size,
- AtomicString& font_family) {
- font_style = NormalSlopeValue();
- font_weight = NormalWeightValue();
+const FontSelectionValue& LayoutThemeFontProvider::SystemFontStyle(
+ CSSValueID system_font_id) {
+ return NormalSlopeValue();
+}
+
+// static
+const FontSelectionValue& LayoutThemeFontProvider::SystemFontWeight(
+ CSSValueID system_font_id) {
+ return NormalWeightValue();
+}
+// static
+const AtomicString& LayoutThemeFontProvider::SystemFontFamily(
+ CSSValueID system_font_id) {
+ switch (system_font_id) {
+ case CSSValueID::kSmallCaption:
+ return FontCache::SmallCaptionFontFamily();
+ case CSSValueID::kMenu:
+ return FontCache::MenuFontFamily();
+ case CSSValueID::kStatusBar:
+ return FontCache::StatusFontFamily();
+ default:
+ return DefaultGUIFont();
+ }
+}
+
+// static
+float LayoutThemeFontProvider::SystemFontSize(CSSValueID system_font_id,
+ const Document* document) {
switch (system_font_id) {
case CSSValueID::kSmallCaption:
- font_size = FontCache::SmallCaptionFontHeight();
- font_family = FontCache::SmallCaptionFontFamily();
- break;
+ return FontCache::SmallCaptionFontHeight();
case CSSValueID::kMenu:
- font_size = FontCache::MenuFontHeight();
- font_family = FontCache::MenuFontFamily();
- break;
+ return FontCache::MenuFontHeight();
case CSSValueID::kStatusBar:
- font_size = FontCache::StatusFontHeight();
- font_family = FontCache::StatusFontFamily();
- break;
+ return FontCache::StatusFontHeight();
case CSSValueID::kWebkitMiniControl:
case CSSValueID::kWebkitSmallControl:
case CSSValueID::kWebkitControl:
// Why 2 points smaller? Because that's what Gecko does.
- font_size = kDefaultFontSize - PointsToPixels(2);
- font_family = DefaultGUIFont();
- break;
+ return DefaultFontSize(document) - PointsToPixels(2);
default:
- font_size = kDefaultFontSize;
- font_family = DefaultGUIFont();
- break;
+ return DefaultFontSize(document);
}
}