RESOLVED FIXED223062
[macOS] MobileAsset fonts are broken in Reader mode in Safari
https://bugs.webkit.org/show_bug.cgi?id=223062
Summary [macOS] MobileAsset fonts are broken in Reader mode in Safari
Myles C. Maxfield
Reported 2021-03-11 01:11:00 PST
MobileAsset fonts are broken in Reader mode in Safari
Attachments
WIP (4.58 KB, patch)
2021-03-11 01:11 PST, Myles C. Maxfield
no flags
WIP (12.77 KB, patch)
2021-03-11 02:14 PST, Myles C. Maxfield
no flags
Needs test (12.28 KB, patch)
2021-03-11 18:24 PST, Myles C. Maxfield
no flags
Patch (24.08 KB, patch)
2021-03-11 19:17 PST, Myles C. Maxfield
no flags
Patch (26.02 KB, patch)
2021-03-11 19:32 PST, Myles C. Maxfield
no flags
Patch (26.75 KB, patch)
2021-03-11 23:01 PST, Myles C. Maxfield
no flags
Patch (26.06 KB, patch)
2021-03-11 23:05 PST, Myles C. Maxfield
simon.fraser: review+
Patch for committing (27.44 KB, patch)
2021-03-12 11:23 PST, Myles C. Maxfield
ews-feeder: commit-queue-
Patch for committing (27.27 KB, patch)
2021-03-12 11:48 PST, Myles C. Maxfield
no flags
Myles C. Maxfield
Comment 1 2021-03-11 01:11:24 PST
Myles C. Maxfield
Comment 2 2021-03-11 02:14:36 PST
Myles C. Maxfield
Comment 3 2021-03-11 18:24:19 PST
Created attachment 423003 [details] Needs test
Myles C. Maxfield
Comment 4 2021-03-11 19:17:35 PST
Myles C. Maxfield
Comment 5 2021-03-11 19:32:04 PST
Myles C. Maxfield
Comment 6 2021-03-11 23:01:38 PST
Myles C. Maxfield
Comment 7 2021-03-11 23:05:31 PST
Simon Fraser (smfr)
Comment 8 2021-03-11 23:39:35 PST
Comment on attachment 423017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423017&action=review > Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:550 > -// Defaults to false. > +// Defaults to true. Is this a correction to the comment, or a indicative of a behavior change? Changelog needs to explain. > Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:2242 > +- (void)_switchFromStaticFontRegistryToUserFontRegistry Since readers probably won't understand the implications of static vs. user font registries, a comment would help. > Source/WebKit/UIProcess/WebPageProxy.cpp:7868 > SandboxExtension::Handle fontMachExtensionHandle; > SandboxExtension::createHandleForMachLookup("com.apple.fonts"_s, WTF::nullopt, fontMachExtensionHandle); It's a bit odd to see this in two places? Share with switchFromStaticFontRegistryToUserFontRegistry()?
Alex Christensen
Comment 9 2021-03-12 07:53:24 PST
Comment on attachment 423017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423017&action=review > Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:453 > +- (void)_switchFromStaticFontRegistryToUserFontRegistry WK_API_AVAILABLE(macos(WK_MAC_TBA)); Is there a way to switch back?
Myles C. Maxfield
Comment 10 2021-03-12 11:16:23 PST
Comment on attachment 423017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423017&action=review >> Source/WebKit/UIProcess/API/C/WKPreferencesRefPrivate.h:550 >> +// Defaults to true. > > Is this a correction to the comment, or a indicative of a behavior change? Changelog needs to explain. A correction. I'll explain in the ChangeLog. >> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:2242 >> +- (void)_switchFromStaticFontRegistryToUserFontRegistry > > Since readers probably won't understand the implications of static vs. user font registries, a comment would help. Good idea. >> Source/WebKit/UIProcess/API/Cocoa/WKWebViewPrivate.h:453 >> +- (void)_switchFromStaticFontRegistryToUserFontRegistry WK_API_AVAILABLE(macos(WK_MAC_TBA)); > > Is there a way to switch back? Nope!
Myles C. Maxfield
Comment 11 2021-03-12 11:23:01 PST
Created attachment 423068 [details] Patch for committing
Myles C. Maxfield
Comment 12 2021-03-12 11:48:16 PST
Created attachment 423070 [details] Patch for committing
EWS
Comment 13 2021-03-12 16:01:05 PST
Committed r274374: <https://commits.webkit.org/r274374> All reviewed patches have been landed. Closing bug and clearing flags on attachment 423070 [details].
Radar WebKit Bug Importer
Comment 14 2021-03-12 16:02:16 PST
Per Arne Vollan
Comment 15 2021-03-16 08:47:42 PDT
Comment on attachment 423017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423017&action=review >> Source/WebKit/UIProcess/WebPageProxy.cpp:7868 >> SandboxExtension::createHandleForMachLookup("com.apple.fonts"_s, WTF::nullopt, fontMachExtensionHandle); > > It's a bit odd to see this in two places? Share with switchFromStaticFontRegistryToUserFontRegistry()? Should CTFontManagerEnableAllUserFonts(true) be called when this extension is consumed in WP? > Source/WebKit/WebProcess/cocoa/WebProcessCocoa.mm:1169 > + m_fontMachExtension->consume(); To avoid storing the extension, you could also call SandboxExtension::consumePermanently here.
Per Arne Vollan
Comment 16 2021-03-16 08:48:53 PDT
Comment on attachment 423017 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=423017&action=review >>> Source/WebKit/UIProcess/API/Cocoa/WKWebView.mm:2242 >>> +- (void)_switchFromStaticFontRegistryToUserFontRegistry >> >> Since readers probably won't understand the implications of static vs. user font registries, a comment would help. > > Good idea. Is this SPI strictly needed, since the client can use the preference shouldAllowUserInstalledFonts to enable this behavior?
Note You need to log in before you can comment on or make changes to this bug.