Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 019aea777b7961f194d90264d039215f6fff8d4c
https://github.com/WebKit/WebKit/commit/019aea777b7961f194d90264d039215f6fff8d4c
Author: Vitor Roriz <[email protected]>
Date: 2026-03-16 (Mon, 16 Mar 2026)
Changed paths:
M LayoutTests/TestExpectations
A
LayoutTests/http/tests/text/font-face-unicode-range-failing-source-no-effect-expected.html
A
LayoutTests/http/tests/text/font-face-unicode-range-failing-source-no-effect.html
R LayoutTests/http/tests/text/primary-font-interstitial-expected.html
R LayoutTests/http/tests/text/primary-font-interstitial.html
A
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-face-unicode-range-no-match-no-download-expected.txt
A
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-face-unicode-range-no-match-no-download.html
M
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/matching/font-unicode-presented-as-emoji-outline.html
M LayoutTests/inspector/css/getComputedPrimaryFontForNode-expected.txt
M LayoutTests/inspector/css/getComputedPrimaryFontForNode.html
M Source/WebCore/platform/graphics/FontCascadeFonts.h
M Source/WebCore/platform/graphics/FontRanges.h
Log Message:
-----------
font downloaded despite no document characters contained within its
unicode-range
rdar://140674753
https://bugs.webkit.org/show_bug.cgi?id=283538
Reviewed by Elika Etemad and Brent Fulgham.
Fonts were being downloaded even when no document characters matched their
unicode-range. The root cause was primaryFont() using rangeAt(0) as an
unconditional fallback, which bypasses unicode-range and triggers a download
for the font at that range regardless of whether it's needed.
CSS Fonts 4 §5.2 defines the "first available font" as the first font whose
unicode-range includes U+0020 — whether the font actually contains a space
glyph doesn't matter, only the CSS descriptor.
Apply upstream WPT fix for font-unicode-presented-as-emoji-outline.html
(add U+0020 to unicode-range so the test font acts as first available font).
Rename primary-font-interstitial test to
font-face-unicode-range-failing-source-no-effect
since it tests that a failing @font-face source with non-matching unicode-range
doesn't affect rendering.
Tests: http/tests/text/font-face-unicode-range-failing-source-no-effect.html
imported/w3c/web-platform-tests/css/css-fonts/font-face-unicode-range-no-match-no-download.html
* LayoutTests/TestExpectations:
*
LayoutTests/http/tests/text/font-face-unicode-range-failing-source-no-effect-expected.html:
Added.
*
LayoutTests/http/tests/text/font-face-unicode-range-failing-source-no-effect.html:
Added.
* LayoutTests/http/tests/text/primary-font-interstitial-expected.html: Removed.
* LayoutTests/http/tests/text/primary-font-interstitial.html: Removed.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-face-unicode-range-no-match-no-download-expected.txt:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/font-face-unicode-range-no-match-no-download.html:
Added.
*
LayoutTests/imported/w3c/web-platform-tests/css/css-fonts/matching/font-unicode-presented-as-emoji-outline.html:
* LayoutTests/inspector/css/getComputedPrimaryFontForNode-expected.txt:
* LayoutTests/inspector/css/getComputedPrimaryFontForNode.html:
* Source/WebCore/platform/graphics/FontCascadeFonts.h:
(WebCore::FontCascadeFonts::primaryFont):
* Source/WebCore/platform/graphics/FontRanges.h:
(WebCore::FontRanges::hasRangeContaining const):
Canonical link: https://commits.webkit.org/309360@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications