[webkit-changes] [WebKit/WebKit] a0c666: Text doesn't load properly in Lockdown mode
Vitor Roriz
noreply at github.com
Sun Dec 15 10:40:08 PST 2024
Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: a0c6667a0b87b8f7547a40186f41d003eb9f64fe
https://github.com/WebKit/WebKit/commit/a0c6667a0b87b8f7547a40186f41d003eb9f64fe
Author: Vitor Roriz <vitor.roriz at apple.com>
Date: 2024-12-15 (Sun, 15 Dec 2024)
Changed paths:
M Source/WebCore/loader/cache/CachedFontLoadRequest.h
M Source/WebCore/platform/graphics/coretext/FontCustomPlatformDataCoreText.cpp
A Tools/TestWebKitAPI/Tests/WebKitCocoa/Ahem-CFF.otf
M Tools/TestWebKitAPI/Tests/WebKitCocoa/LockdownModeFonts.mm
Log Message:
-----------
Text doesn't load properly in Lockdown mode
https://bugs.webkit.org/show_bug.cgi?id=284590
rdar://139031761
Reviewed by Brent Fulgham.
We are doing two related things on this patch:
1. We were failing to recgonize that Safe Font Parser could not handle a font.
When `softLinkCoreTextCTFontManagerCreateMemorySafeFontDescriptorFromData` fails
to produce a font description we should return a null FontCustomPlatformData instead
of trying to create a FontCustomPlatformData object with it.
2. Avoiding fontLoaded re-entry:
When [1] happens we will fail to load the font and will deleted the related
extracted data. We do that by calling setErrorAndDeleteData, that calls CachedResource::error.
`error` notifies this resource client's so that fontLoaded is invoked for each of them. However,
this whole operation already started from a fontLoaded notification. So we are adding a flag
to avoid processing it again for the same client, in this case, CachedFontLoadRequest object.
* Source/WebCore/loader/cache/CachedFontLoadRequest.h:
* Source/WebCore/platform/graphics/coretext/FontCustomPlatformDataCoreText.cpp:
(WebCore::FontCustomPlatformData::createMemorySafe):
* Tools/TestWebKitAPI/Tests/WebKitCocoa/Ahem-CFF.otf: Added.
* Tools/TestWebKitAPI/Tests/WebKitCocoa/LockdownModeFonts.mm:
(TestWebKitAPI::TEST(LockdownMode, NotSupportedFontLoadingAPI)):
Canonical link: https://commits.webkit.org/287854@main
To unsubscribe from these emails, change your notification settings at https://github.com/WebKit/WebKit/settings/notifications
More information about the webkit-changes
mailing list