Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 1eb20f29b046c6a0bd2c7b96f2bb4b1b1d24bb63
https://github.com/WebKit/WebKit/commit/1eb20f29b046c6a0bd2c7b96f2bb4b1b1d24bb63
Author: Brent Fulgham <[email protected]>
Date: 2026-03-16 (Mon, 16 Mar 2026)
Changed paths:
M LayoutTests/fast/css/font-face-multiple-faces.html
M
LayoutTests/platform/glib/fast/css/font-face-locally-installed-expected.txt
M LayoutTests/platform/glib/fast/css/font-face-multiple-faces-expected.txt
M LayoutTests/platform/ios/fast/css/font-face-locally-installed-expected.txt
M LayoutTests/platform/mac/fast/css/font-face-multiple-faces-expected.png
M LayoutTests/platform/mac/fast/css/font-face-multiple-faces-expected.txt
M Source/WebCore/css/CSSFontFaceSet.cpp
Log Message:
-----------
Remove duplicate checks in CSSFontFaceSet::fontFace
https://bugs.webkit.org/show_bug.cgi?id=309822
rdar://172401655
Reviewed by Vitor Roriz.
The changes in Bug 120499 brought WebKit's font selection logic in alignment
with the web
standard. This allows us to make a further improvement: We no longer need the
`isItalic`
pre-filter lines that were used when considering candidate font faces. These
filters were
a shortcut that unconditionally excluded italic-only faces whenever the request
was non-italic.
But eliminatedCapabilities() already handles this correctly via the full CSS
5.2.6 matching
algorithm, so this is now redundant.
This change revealed that our existing test
fast/css/font-face-multiple-faces.html was
expecting incorrect behavior. Previously, when WebKit was rendering normal
(non-italic)
text, it would skip any candidate face with a minimum slope in the italic
range. This
violates the CSS 5.2 matching rules, which defines a priority order for
font-style: normal
requests when no exact match exists:
1. Normal faces
2. Oblique values greater than or equal to 0 are checked in ascending order.
3. If no match is found, italic values greater than or equal to 0 are checked
in ascending
4. If no match is found, oblique values less than 0deg are checked in
descending order until a match is found.
5. If no match is found, italic values less than 0 are checked in descending
order until a match is found.
Italic faces are explicitly included as a fallback for normal requests within
the same
font family, and we were improperly removing them, violating the standard.
Tests: fast/css/font-face-multiple-faces.html
* LayoutTests/fast/css/font-face-multiple-faces.html:
* LayoutTests/platform/glib/fast/css/font-face-locally-installed-expected.txt:
* LayoutTests/platform/glib/fast/css/font-face-multiple-faces-expected.txt:
* LayoutTests/platform/ios/fast/css/font-face-locally-installed-expected.txt:
* LayoutTests/platform/mac/fast/css/font-face-multiple-faces-expected.png:
* LayoutTests/platform/mac/fast/css/font-face-multiple-faces-expected.txt:
* Source/WebCore/css/CSSFontFaceSet.cpp:
(WebCore::CSSFontFaceSet::fontFace): Remove redundant italics checks.
Canonical link: https://commits.webkit.org/309352@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications