diff options
author | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-10-26 13:57:00 +0200 |
---|---|---|
committer | Allan Sandfeld Jensen <allan.jensen@qt.io> | 2021-11-02 11:31:01 +0000 |
commit | 1943b3c2a1dcee36c233724fc4ee7613d71b9cf6 (patch) | |
tree | 8c1b5f12357025c197da5427ae02cfdc2f3570d6 /chromium/third_party/blink/renderer/core/layout/layout_theme_font_provider_win.cc | |
parent | 21ba0c5d4bf8fba15dddd97cd693bad2358b77fd (diff) | |
download | qtwebengine-chromium-1943b3c2a1dcee36c233724fc4ee7613d71b9cf6.tar.gz |
BASELINE: Update Chromium to 94.0.4606.111
Change-Id: I924781584def20fc800bedf6ff41fdb96c438193
Reviewed-by: Allan Sandfeld Jensen <allan.jensen@qt.io>
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.cc | 57 |
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); } } |