NEW225567
[Cocoa] Disable Core Text's font cascade explicitly instead of setting the cascade to just point to LastResort
https://bugs.webkit.org/show_bug.cgi?id=225567
Summary [Cocoa] Disable Core Text's font cascade explicitly instead of setting the ca...
Myles C. Maxfield
Reported 2021-05-08 17:29:42 PDT
[Cocoa] Disable Core Text's font cascade explicitly instead of setting the cascade to just point to LastResort
Attachments
Patch (3.94 KB, patch)
2021-05-08 17:31 PDT, Myles C. Maxfield
ews-feeder: commit-queue-
Myles C. Maxfield
Comment 1 2021-05-08 17:31:27 PDT
Darin Adler
Comment 2 2021-05-08 21:04:32 PDT
Comment on attachment 428101 [details] Patch View in context: https://bugs.webkit.org/attachment.cgi?id=428101&action=review > Source/WebCore/platform/graphics/coretext/FontPlatformDataCoreText.cpp:100 > + static NeverDestroyed<RetainPtr<CTFontDescriptorRef>> descriptor; > + if (descriptor.get()) > + return descriptor.get().get(); We don’t need to use this null checking style. It’s more elegant to just use "initialized the first time this is called" style. static NeverDestroyed<RetainPtr<CTFontDescriptorRef>> descriptor = [] { // body of the function, ending with ... return adoptCF(CTFontDescriptorCreateWithAttributes(dictionary.get())); }; return descriptor.get().get(); > Source/WebCore/platform/graphics/coretext/FontPlatformDataCoreText.cpp:103 > + CTFontFallbackOption fallbackOption = kCTFontFallbackOptionNone; > + auto fallbackOptionNumber = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberSInt64Type, &fallbackOption)); To make this obviously correct, since we are using kCFNumberSInt64Type, our local variable should be of type int64_t, not CTFontFallbackOption, even though that’s what we are storing there.. > Source/WebCore/platform/graphics/coretext/FontPlatformDataCoreText.cpp:107 > + auto dictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); Should use std::size(keys) instead of WTF_ARRAY_LENGTH(keys).
Radar WebKit Bug Importer
Comment 3 2021-05-15 17:30:17 PDT
Note You need to log in before you can comment on or make changes to this bug.