[Cocoa] Disable Core Text's font cascade explicitly instead of setting the cascade to just point to LastResort
Created attachment 428101 [details] Patch
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).
<rdar://problem/78066207>