Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 671f52fa7c4105fd659496bb55a6199aa8483612
https://github.com/WebKit/WebKit/commit/671f52fa7c4105fd659496bb55a6199aa8483612
Author: Brent Fulgham <[email protected]>
Date: 2026-04-01 (Wed, 01 Apr 2026)
Changed paths:
M LayoutTests/TestExpectations
M
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-synthesis-style-valid-expected.txt
M Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml
M Source/WebCore/css/CSSPrimitiveValueMappings.h
M Source/WebCore/css/CSSProperties.json
M Source/WebCore/css/CSSSegmentedFontFace.cpp
M Source/WebCore/css/CSSValueKeywords.in
M Source/WebCore/css/parser/CSSParserContext.cpp
M Source/WebCore/css/parser/CSSParserContext.h
M Source/WebCore/platform/graphics/FontCascadeCache.h
M Source/WebCore/platform/graphics/FontDescription.cpp
M Source/WebCore/platform/graphics/FontDescription.h
M Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp
M Source/WebCore/platform/graphics/FontSelectionAlgorithm.h
M Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp
M Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp
M Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp
M Source/WebCore/platform/text/TextFlags.cpp
M Source/WebCore/platform/text/TextFlags.h
M Source/WebCore/style/StyleBuilderState.h
M Source/WebCore/style/StyleBuilderStateInlines.h
M Source/WebCore/style/computed/StyleComputedStyleBase.h
M
Source/WebCore/style/computed/StyleComputedStyleProperties+GettersCustomInlines.h
M
Source/WebCore/style/computed/StyleComputedStyleProperties+SettersCustomInlines.h
Log Message:
-----------
Add support for font-synthesis-style: oblique-only
https://bugs.webkit.org/show_bug.cgi?id=311144
rdar://173730766
Reviewed by Vitor Roriz.
The CSS Fonts 4 specification adds an 'oblique-only' value for the
font-synthesis-style
property. When set, it blocks italic-to-obliqueface fallback in the font
selection
algorithm and prevents italic synthesis, while still permitting oblique
synthesis from
normal faces.
This behavior is gated behind a new feature flag:
CSSFontSynthesisStyleObliqueOnlyEnabled
Tests:
imported/w3c/web-platform-tests/css/css-fonts/font-synthesis-style-oblique-only.html
imported/w3c/web-platform-tests/css/css-fonts/parsing/font-synthesis-style-valid
parsing test.
* LayoutTests/TestExpectations:
*
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/parsing/font-synthesis-style-valid-expected.txt:
* Source/WTF/Scripts/Preferences/UnifiedWebPreferences.yaml: Add new feature
flag in 'preview' state.
* Source/WebCore/css/CSSPrimitiveValueMappings.h:
* Source/WebCore/css/CSSProperties.json: Added 'oblique-only' keyword.
* Source/WebCore/css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::fontRanges):
* Source/WebCore/css/CSSValueKeywords.in: Added 'oblique-only' keyword.
* Source/WebCore/css/parser/CSSParserContext.cpp:
(WebCore::add):
* Source/WebCore/css/parser/CSSParserContext.h:
* Source/WebCore/platform/graphics/FontCascadeCache.h:
(WebCore::FontDescriptionKey::makeFlagsKey):
* Source/WebCore/platform/graphics/FontDescription.cpp:
* Source/WebCore/platform/graphics/FontDescription.h:
(WebCore::FontDescription::fontSynthesisStyle const):
(WebCore::FontDescription::hasAutoFontSynthesisStyle const):
(WebCore::FontDescription::allowsItalicOrObliqueFontSynthesisStyle const):
Added.
(WebCore::FontDescription::setFontStyleAxis):
(WebCore::FontDescription::setFontSynthesisStyle): Ditto.
(WebCore::FontDescription::updatePenalizeObliqueFontSelection):
* Source/WebCore/platform/graphics/FontSelectionAlgorithm.cpp:
(WebCore::FontSelectionAlgorithm::styleDistance const): Update to handle
oblique-only case.
* Source/WebCore/platform/graphics/FontSelectionAlgorithm.h:
(WebCore::add):
* Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::computeNecessarySynthesis):
* Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::getFontPropertiesFromPattern):
* Source/WebCore/platform/graphics/skia/FontCacheSkia.cpp:
(WebCore::computeSynthesisProperties):
* Source/WebCore/platform/text/TextFlags.cpp:
(WebCore::operator<<):
* Source/WebCore/platform/text/TextFlags.h:
* Source/WebCore/style/StyleBuilderState.h:
* Source/WebCore/style/StyleBuilderStateInlines.h:
(WebCore::Style::BuilderState::setFontDescriptionFontSynthesisStyle):
* Source/WebCore/style/computed/StyleComputedStyleBase.h:
*
Source/WebCore/style/computed/StyleComputedStyleProperties+GettersCustomInlines.h:
(WebCore::Style::ComputedStyleProperties::fontSynthesisStyle const):
*
Source/WebCore/style/computed/StyleComputedStyleProperties+SettersCustomInlines.h:
(WebCore::Style::ComputedStyleProperties::setFontSynthesisStyle):
Canonical link: https://commits.webkit.org/310409@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications