WebKit Bugzilla
Attachment 349420 Details for
Bug 189514
: [Cocoa] Dictionary hangs when searching
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
Remember
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
bug-189514-20180911121531.patch (text/plain), 9.32 KB, created by
Myles C. Maxfield
on 2018-09-11 12:15:32 PDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
Myles C. Maxfield
Created:
2018-09-11 12:15:32 PDT
Size:
9.32 KB
patch
obsolete
>Subversion Revision: 235906 >diff --git a/Source/WebCore/ChangeLog b/Source/WebCore/ChangeLog >index 363bd7bab31921d9f60066a85bd2f96a936fa581..33e841e8d9f5b3f871c7b417c9eb0d394e068ebe 100644 >--- a/Source/WebCore/ChangeLog >+++ b/Source/WebCore/ChangeLog >@@ -1,3 +1,30 @@ >+2018-09-11 Myles C. Maxfield <mmaxfield@apple.com> >+ >+ [Cocoa] Dictionary hangs when searching >+ https://bugs.webkit.org/show_bug.cgi?id=189514 >+ <rdar://problem/40027979> >+ >+ Reviewed by NOBODY (OOPS!). >+ >+ Hanging inside Core Text downloading downloadable font assets. >+ The solution is to pass kCTFontEnabledAttribute / kCFBooleanTrue to the font creation routines. >+ >+ Untestable. >+ >+ * page/cocoa/SettingsBaseCocoa.mm: >+ (WebCore::osakaMonoIsInstalled): >+ * platform/graphics/cocoa/FontCacheCoreText.cpp: >+ (WebCore::preparePlatformFont): >+ (WebCore::FontDatabase::collectionForFamily): >+ (WebCore::autoActivateFont): >+ (WebCore::lookupFallbackFont): >+ * platform/graphics/cocoa/FontDescriptionCocoa.cpp: >+ (WebCore::SystemFontDatabase::applyWeightItalicsAndFallbackBehavior): >+ * platform/graphics/cocoa/FontPlatformDataCocoa.mm: >+ (WebCore::cascadeToLastResortAndVariationsFontDescriptor): >+ * platform/graphics/mac/FontCacheMac.mm: >+ (WebCore::platformFontWithFamilySpecialCase): >+ > 2018-09-11 Michael Catanzaro <mcatanzaro@igalia.com> > > Unreviewed, fix some -Wreturn-type warnings >diff --git a/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm b/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >index fd7211ac12f8f4685bb3fde95e81565b9ee5a71a..f4c526c5c012ca3faee0ed4cfe6ee38101c24050 100644 >--- a/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >+++ b/Source/WebCore/page/cocoa/SettingsBaseCocoa.mm >@@ -58,7 +58,7 @@ static bool osakaMonoIsInstalled() > int one = 1; > RetainPtr<CFNumberRef> yes = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &one)); > CFTypeRef keys[] = { kCTFontEnabledAttribute, kCTFontNameAttribute }; >- CFTypeRef values[] = { yes.get(), CFSTR("Osaka-Mono") }; >+ CFTypeRef values[] = { kCFBooleanTrue, CFSTR("Osaka-Mono") }; > RetainPtr<CFDictionaryRef> attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(values), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > RetainPtr<CTFontDescriptorRef> descriptor = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); > RetainPtr<CFSetRef> mandatoryAttributes = adoptCF(CFSetCreate(kCFAllocatorDefault, keys, WTF_ARRAY_LENGTH(keys), &kCFTypeSetCallBacks)); >diff --git a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >index c48102036cb78ba6c59d019101f96c23449e47e0..15d603ce0bc2d7af98147bc26f98c214619d636c 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >+++ b/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp >@@ -628,6 +628,7 @@ RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, const FontDescr > #endif // ENABLE(VARIATION_FONTS) > > auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); >+ CFDictionaryAddValue(attributes.get(), kCTFontEnabledAttribute, kCFBooleanTrue); > if (!featuresToBeApplied.isEmpty()) { > auto featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features.size(), &kCFTypeArrayCallBacks)); > for (auto& p : featuresToBeApplied) { >@@ -891,6 +892,7 @@ public: > auto familyNameString = folded.createCFString(); > auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > CFDictionaryAddValue(attributes.get(), kCTFontFamilyNameAttribute, familyNameString.get()); >+ CFDictionaryAddValue(attributes.get(), kCTFontEnabledAttribute, kCFBooleanTrue); > addAttributesForInstalledFonts(attributes.get(), m_allowUserInstalledFonts); > auto fontDescriptorToMatch = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); > auto mandatoryAttributes = installedFontMandatoryAttributes(m_allowUserInstalledFonts); >@@ -1230,8 +1232,8 @@ static bool shouldAutoActivateFontIfNeeded(const AtomicString& family) > static void autoActivateFont(const String& name, CGFloat size) > { > auto fontName = name.createCFString(); >- CFTypeRef keys[] = { kCTFontNameAttribute }; >- CFTypeRef values[] = { fontName.get() }; >+ CFTypeRef keys[] = { kCTFontNameAttribute, kCTFontEnabledAttribute }; >+ CFTypeRef values[] = { fontName.get(), kCFBooleanTrue }; > auto attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > auto descriptor = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); > if (auto newFont = CTFontCreateWithFontDescriptor(descriptor.get(), size, nullptr)) >@@ -1320,8 +1322,8 @@ static RetainPtr<CTFontRef> lookupFallbackFont(CTFontRef font, FontSelectionValu > auto familyName = adoptCF(static_cast<CFStringRef>(CTFontCopyAttribute(result.get(), kCTFontFamilyNameAttribute))); > if (fontFamilyShouldNotBeUsedForArabic(familyName.get())) { > CFStringRef newFamilyName = isFontWeightBold(fontWeight) ? CFSTR("GeezaPro-Bold") : CFSTR("GeezaPro"); >- CFTypeRef keys[] = { kCTFontNameAttribute }; >- CFTypeRef values[] = { newFamilyName }; >+ CFTypeRef keys[] = { kCTFontNameAttribute, kCTFontEnabledAttribute }; >+ CFTypeRef values[] = { newFamilyName, kCFBooleanTrue }; > auto attributes = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, keys, values, WTF_ARRAY_LENGTH(keys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > auto modification = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); > result = adoptCF(CTFontCreateCopyWithAttributes(result.get(), CTFontGetSize(result.get()), nullptr, modification.get())); >diff --git a/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp b/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp >index 42afa48c55cec91bec29da1625b63cb1425d44f3..a647b7161b2fcf9d7a5ee48d6628433439efb742 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp >+++ b/Source/WebCore/platform/graphics/cocoa/FontDescriptionCocoa.cpp >@@ -161,6 +161,7 @@ private: > auto traitsDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, traitsKeys, traitsValues, WTF_ARRAY_LENGTH(traitsKeys), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > CFDictionaryAddValue(attributes.get(), kCTFontTraitsAttribute, traitsDictionary.get()); >+ CFDictionaryAddValue(attributes.get(), kCTFontEnabledAttribute, kCFBooleanTrue); > addAttributesForInstalledFonts(attributes.get(), allowUserInstalledFonts); > auto modification = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); > return adoptCF(CTFontCreateCopyWithAttributes(font, size, nullptr, modification.get())); >diff --git a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm b/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm >index aae492fdfbdc409da5dfdec04dd5efb0bed276ea..fff38e141b332428b136ceaf133dacd013c0f020 100644 >--- a/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm >+++ b/Source/WebCore/platform/graphics/cocoa/FontPlatformDataCocoa.mm >@@ -143,6 +143,7 @@ static RetainPtr<CTFontDescriptorRef> cascadeToLastResortAndVariationsFontDescri > } > #if WORKAROUND_CORETEXT_VARIATIONS_WITH_FALLBACK_LIST_BUG > auto mutableAttributes = adoptCF(CFDictionaryCreateMutableCopy(kCFAllocatorDefault, 2, attributes)); >+ CFDictionaryAddValue(attributes.get(), kCTFontEnabledAttribute, kCFBooleanTrue); > CFDictionaryAddValue(mutableAttributes.get(), kCTFontVariationAttribute, variations.get()); > return adoptCF(CTFontDescriptorCreateWithAttributes(mutableAttributes.get())); > #endif >diff --git a/Source/WebCore/platform/graphics/mac/FontCacheMac.mm b/Source/WebCore/platform/graphics/mac/FontCacheMac.mm >index 211d899cab7fb5cbb7597085a884d6d1b0c5efca..471e075a863f9ddde812b6337e7d835f1f884240 100644 >--- a/Source/WebCore/platform/graphics/mac/FontCacheMac.mm >+++ b/Source/WebCore/platform/graphics/mac/FontCacheMac.mm >@@ -101,6 +101,7 @@ RetainPtr<CTFontRef> platformFontWithFamilySpecialCase(const AtomicString& famil > auto attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 0, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks)); > CFDictionaryAddValue(attributes.get(), kCTFontFeatureSettingsAttribute, featureArray.get()); > addAttributesForInstalledFonts(attributes.get(), allowUserInstalledFonts); >+ CFDictionaryAddValue(attributes.get(), kCTFontEnabledAttribute, kCFBooleanTrue); > RetainPtr<CTFontRef> result = toCTFont([NSFont systemFontOfSize:size]); > auto modification = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get())); > return adoptCF(CTFontCreateCopyWithAttributes(result.get(), size, nullptr, modification.get()));
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Flags:
simon.fraser
:
review+
ews-watchlist
:
commit-queue-
Actions:
View
|
Formatted Diff
|
Diff
Attachments on
bug 189514
: 349420 |
349433
|
349438
|
349443