Diff
Modified: trunk/Source/WTF/ChangeLog (212875 => 212876)
--- trunk/Source/WTF/ChangeLog 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Source/WTF/ChangeLog 2017-02-23 06:11:02 UTC (rev 212876)
@@ -1,3 +1,12 @@
+2017-02-22 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ [Cocoa] Remove Yosemite-specific font lookup code
+ https://bugs.webkit.org/show_bug.cgi?id=168682
+
+ Reviewed by Zalan Bujtas.
+
+ * wtf/Platform.h:
+
2017-02-22 Keith Miller <keith_mil...@apple.com>
Remove the demand executable allocator
Modified: trunk/Source/WTF/wtf/Platform.h (212875 => 212876)
--- trunk/Source/WTF/wtf/Platform.h 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Source/WTF/wtf/Platform.h 2017-02-23 06:11:02 UTC (rev 212876)
@@ -1109,10 +1109,6 @@
#define ENABLE_CSS3_TEXT_DECORATION_SKIP_INK 1
#endif
-#if PLATFORM(IOS) || (PLATFORM(MAC) && __MAC_OS_X_VERSION_MIN_REQUIRED > 101000)
-#define ENABLE_PLATFORM_FONT_LOOKUP 1
-#endif
-
#if COMPILER(MSVC)
#undef __STDC_FORMAT_MACROS
#define __STDC_FORMAT_MACROS
Modified: trunk/Source/WebCore/ChangeLog (212875 => 212876)
--- trunk/Source/WebCore/ChangeLog 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Source/WebCore/ChangeLog 2017-02-23 06:11:02 UTC (rev 212876)
@@ -1,3 +1,27 @@
+2017-02-22 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ [Cocoa] Remove Yosemite-specific font lookup code
+ https://bugs.webkit.org/show_bug.cgi?id=168682
+
+ Reviewed by Zalan Bujtas.
+
+ No new tests because there is no behavior change.
+
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::platformFontLookupWithFamily):
+ (WebCore::fontWithFamily):
+ * platform/graphics/mac/FontCacheMac.mm:
+ (WebCore::platformInvalidateFontCache):
+ (WebCore::acceptableChoice): Deleted.
+ (WebCore::betterChoice): Deleted.
+ (WebCore::desiredFamilyToAvailableFamilyMap): Deleted.
+ (WebCore::hasDesiredFamilyToAvailableFamilyMapping): Deleted.
+ (WebCore::rememberDesiredFamilyToAvailableFamilyMapping): Deleted.
+ (WebCore::toAppKitFontWeight): Deleted.
+ (WebCore::appkitWeightToFontWeight): Deleted.
+ (WebCore::toNSFontTraits): Deleted.
+ (WebCore::platformFontWithFamily): Deleted.
+
2017-02-22 Antoine Quint <grao...@apple.com>
[Modern Media Controls] Clicking on the video doesn't toggle playback state in fullscreen on macOS
Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (212875 => 212876)
--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp 2017-02-23 06:11:02 UTC (rev 212876)
@@ -791,7 +791,6 @@
whitelist.add(item);
}
-#if ENABLE(PLATFORM_FONT_LOOKUP)
static bool isSystemFont(const AtomicString& family)
{
return family.length() >= 1 && family[0] == '.';
@@ -805,7 +804,6 @@
return adoptCF(CTFontCreateForCSS(family.string().createCFString().get(), toCoreTextFontWeight(weight), requestedTraits, size));
}
-#endif
static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSymbolicTraits desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, const FontVariationSettings& variationSettings, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const TextRenderingMode& textRenderingMode, float size)
{
@@ -813,13 +811,8 @@
return nullptr;
auto foundFont = platformFontWithFamilySpecialCase(family, weight, desiredTraits, size);
- if (!foundFont) {
-#if ENABLE(PLATFORM_FONT_LOOKUP)
+ if (!foundFont)
foundFont = platformFontLookupWithFamily(family, desiredTraits, weight, size);
-#else
- foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
-#endif
- }
return preparePlatformFont(foundFont.get(), textRenderingMode, fontFaceFeatures, fontFaceVariantSettings, featureSettings, variantSettings, variationSettings);
}
Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (212875 => 212876)
--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm 2017-02-23 06:11:02 UTC (rev 212876)
@@ -52,146 +52,6 @@
#if PLATFORM(MAC)
-#if !ENABLE(PLATFORM_FONT_LOOKUP)
-
-#define SYNTHESIZED_FONT_TRAITS (NSBoldFontMask | NSItalicFontMask)
-
-#define IMPORTANT_FONT_TRAITS (0 \
- | NSCompressedFontMask \
- | NSCondensedFontMask \
- | NSExpandedFontMask \
- | NSItalicFontMask \
- | NSNarrowFontMask \
- | NSPosterFontMask \
- | NSSmallCapsFontMask \
-)
-
-static bool acceptableChoice(NSFontTraitMask desiredTraits, NSFontTraitMask candidateTraits)
-{
- desiredTraits &= ~SYNTHESIZED_FONT_TRAITS;
- return (candidateTraits & desiredTraits) == desiredTraits;
-}
-
-static bool betterChoice(NSFontTraitMask desiredTraits, int desiredWeight, NSFontTraitMask chosenTraits, int chosenWeight, NSFontTraitMask candidateTraits, int candidateWeight)
-{
- if (!acceptableChoice(desiredTraits, candidateTraits))
- return false;
-
- // A list of the traits we care about.
- // The top item in the list is the worst trait to mismatch; if a font has this
- // and we didn't ask for it, we'd prefer any other font in the family.
- const NSFontTraitMask masks[] = {
- NSPosterFontMask,
- NSSmallCapsFontMask,
- NSItalicFontMask,
- NSCompressedFontMask,
- NSCondensedFontMask,
- NSExpandedFontMask,
- NSNarrowFontMask,
- 0
- };
-
- int i = 0;
- NSFontTraitMask mask;
- while ((mask = masks[i++])) {
- bool desired = desiredTraits & mask;
- bool chosenHasUnwantedTrait = desired != (chosenTraits & mask);
- bool candidateHasUnwantedTrait = desired != (candidateTraits & mask);
- if (!candidateHasUnwantedTrait && chosenHasUnwantedTrait)
- return true;
- if (!chosenHasUnwantedTrait && candidateHasUnwantedTrait)
- return false;
- }
-
- int chosenWeightDeltaMagnitude = abs(chosenWeight - desiredWeight);
- int candidateWeightDeltaMagnitude = abs(candidateWeight - desiredWeight);
-
- // If both are the same distance from the desired weight, prefer the candidate if it is further from medium.
- if (chosenWeightDeltaMagnitude == candidateWeightDeltaMagnitude)
- return abs(candidateWeight - 6) > abs(chosenWeight - 6);
-
- // Otherwise, prefer the one closer to the desired weight.
- return candidateWeightDeltaMagnitude < chosenWeightDeltaMagnitude;
-}
-
-// Keep a cache for mapping desired font families to font families actually available on the system for performance.
-using AvailableFamilyMap = HashMap<std::pair<AtomicString, NSFontTraitMask>, AtomicString>;
-static AvailableFamilyMap& desiredFamilyToAvailableFamilyMap()
-{
- ASSERT(isMainThread());
- static NeverDestroyed<AvailableFamilyMap> map;
- return map;
-}
-
-static bool hasDesiredFamilyToAvailableFamilyMapping(const AtomicString& desiredFamily, NSFontTraitMask desiredTraits, NSString*& availableFamily)
-{
- AtomicString value = desiredFamilyToAvailableFamilyMap().get(std::make_pair(desiredFamily, desiredTraits));
- availableFamily = value.isEmpty() ? nil : static_cast<NSString*>(value);
- return !value.isNull();
-}
-
-static inline void rememberDesiredFamilyToAvailableFamilyMapping(const AtomicString& desiredFamily, NSFontTraitMask desiredTraits, NSString* availableFamily)
-{
- static const unsigned maxCacheSize = 128;
- auto& familyMapping = desiredFamilyToAvailableFamilyMap();
- ASSERT(familyMapping.size() <= maxCacheSize);
- if (familyMapping.size() >= maxCacheSize)
- familyMapping.remove(familyMapping.begin());
-
- // Store nil as an emptyAtom to distinguish from missing values (nullAtom).
- AtomicString value = availableFamily ? AtomicString(availableFamily) : emptyAtom;
- familyMapping.add(std::make_pair(desiredFamily, desiredTraits), value);
-}
-
-static int toAppKitFontWeight(FontWeight fontWeight)
-{
- static const int appKitFontWeights[] = {
- 2, // FontWeight100
- 3, // FontWeight200
- 4, // FontWeight300
- 5, // FontWeight400
- 6, // FontWeight500
- 8, // FontWeight600
- 9, // FontWeight700
- 10, // FontWeight800
- 12, // FontWeight900
- };
- return appKitFontWeights[fontWeight];
-}
-
-static inline FontWeight appkitWeightToFontWeight(NSInteger appKitWeight)
-{
- if (appKitWeight == 1)
- return FontWeight100;
- if (appKitWeight == 2)
- return FontWeight200;
- if (appKitWeight <= 4)
- return FontWeight300;
- if (appKitWeight == 5)
- return FontWeight400;
- if (appKitWeight == 6)
- return FontWeight500;
- if (appKitWeight <= 8)
- return FontWeight600;
- if (appKitWeight == 9)
- return FontWeight700;
- if (appKitWeight <= 11)
- return FontWeight800;
- return FontWeight900;
-}
-
-static NSFontTraitMask toNSFontTraits(CTFontSymbolicTraits traits)
-{
- NSFontTraitMask result = 0;
- if (traits & kCTFontBoldTrait)
- result |= NSBoldFontMask;
- if (traits & kCTFontItalicTrait)
- result |= NSItalicFontMask;
- return result;
-}
-
-#endif // PLATFORM_FONT_LOOKUP
-
static CGFloat toNSFontWeight(FontWeight fontWeight)
{
static const CGFloat nsFontWeights[] = {
@@ -247,136 +107,8 @@
return nullptr;
}
-#if !ENABLE(PLATFORM_FONT_LOOKUP)
-RetainPtr<CTFontRef> platformFontWithFamily(const AtomicString& family, CTFontSymbolicTraits requestedTraits, FontWeight weight, TextRenderingMode, float size)
-{
- NSFontManager *fontManager = [NSFontManager sharedFontManager];
- NSString *availableFamily;
- int chosenWeight;
- NSFont *font;
-
- NSFontTraitMask desiredTraits = toNSFontTraits(requestedTraits);
- NSFontTraitMask desiredTraitsForNameMatch = desiredTraits | (weight >= FontWeight600 ? NSBoldFontMask : 0);
- if (hasDesiredFamilyToAvailableFamilyMapping(family, desiredTraitsForNameMatch, availableFamily)) {
- if (!availableFamily) {
- // We already know the desired font family does not map to any available font family.
- return nil;
- }
- }
-
- if (!availableFamily) {
- NSString *desiredFamily = family;
-
- // Do a simple case insensitive search for a matching font family.
- // NSFontManager requires exact name matches.
- // This addresses the problem of matching arial to Arial, etc., but perhaps not all the issues.
- for (availableFamily in [fontManager availableFontFamilies]) {
- if ([desiredFamily caseInsensitiveCompare:availableFamily] == NSOrderedSame)
- break;
- }
-
- if (!availableFamily) {
- // Match by PostScript name.
- NSFont *nameMatchedFont = nil;
- for (NSString *availableFont in [fontManager availableFonts]) {
- if ([desiredFamily caseInsensitiveCompare:availableFont] == NSOrderedSame) {
- nameMatchedFont = [NSFont fontWithName:availableFont size:size];
-
- // Special case Osaka-Mono. According to <rdar://problem/3999467>, we need to
- // treat Osaka-Mono as fixed pitch.
- if ([desiredFamily caseInsensitiveCompare:@"Osaka-Mono"] == NSOrderedSame && !desiredTraitsForNameMatch)
- return toCTFont(nameMatchedFont);
-
- NSFontTraitMask traits = [fontManager traitsOfFont:nameMatchedFont];
- if ((traits & desiredTraitsForNameMatch) == desiredTraitsForNameMatch)
- return toCTFont([fontManager convertFont:nameMatchedFont toHaveTrait:desiredTraitsForNameMatch]);
-
- availableFamily = [nameMatchedFont familyName];
- break;
- }
- }
- }
-
- rememberDesiredFamilyToAvailableFamilyMapping(family, desiredTraitsForNameMatch, availableFamily);
- if (!availableFamily)
- return nil;
- }
-
- // Found a family, now figure out what weight and traits to use.
- bool choseFont = false;
- chosenWeight = 0;
- NSFontTraitMask chosenTraits = 0;
- NSString *chosenFullName = 0;
-
- int appKitDesiredWeight = toAppKitFontWeight(weight);
- NSArray *fonts = [fontManager availableMembersOfFontFamily:availableFamily];
- for (NSArray *fontInfo in fonts) {
- // Array indices must be hard coded because of lame AppKit API.
- NSString *fontFullName = [fontInfo objectAtIndex:0];
- NSInteger fontWeight = [[fontInfo objectAtIndex:2] intValue];
- NSFontTraitMask fontTraits = [[fontInfo objectAtIndex:3] unsignedIntValue];
-
- BOOL newWinner;
- if (!choseFont)
- newWinner = acceptableChoice(desiredTraits, fontTraits);
- else
- newWinner = betterChoice(desiredTraits, appKitDesiredWeight, chosenTraits, chosenWeight, fontTraits, fontWeight);
-
- if (newWinner) {
- choseFont = YES;
- chosenWeight = fontWeight;
- chosenTraits = fontTraits;
- chosenFullName = fontFullName;
-
- if (chosenWeight == appKitDesiredWeight && (chosenTraits & IMPORTANT_FONT_TRAITS) == (desiredTraits & IMPORTANT_FONT_TRAITS))
- break;
- }
- }
-
- if (!choseFont)
- return nil;
-
- font = [NSFont fontWithName:chosenFullName size:size];
-
- if (!font)
- return nil;
-
- NSFontTraitMask actualTraits = 0;
- if (desiredTraits & NSFontItalicTrait)
- actualTraits = [fontManager traitsOfFont:font];
- FontWeight actualWeight = appkitWeightToFontWeight([fontManager weightOfFont:font]);
-
- bool syntheticBold = isFontWeightBold(weight) && isFontWeightBold(actualWeight);
- bool syntheticOblique = (desiredTraits & NSFontItalicTrait) && !(actualTraits & NSFontItalicTrait);
-
- // There are some malformed fonts that will be correctly returned by -fontWithFamily:traits:weight:size: as a match for a particular trait,
- // though -[NSFontManager traitsOfFont:] incorrectly claims the font does not have the specified trait. This could result in applying
- // synthetic bold on top of an already-bold font, as reported in <http://bugs.webkit.org/show_bug.cgi?id=6146>. To work around this
- // problem, if we got an apparent exact match, but the requested traits aren't present in the matched font, we'll try to get a font from
- // the same family without those traits (to apply the synthetic traits to later).
- NSFontTraitMask nonSyntheticTraits = desiredTraits;
-
- if (syntheticBold)
- nonSyntheticTraits &= ~NSBoldFontMask;
-
- if (syntheticOblique)
- nonSyntheticTraits &= ~NSItalicFontMask;
-
- if (nonSyntheticTraits != desiredTraits) {
- NSFont *fontWithoutSyntheticTraits = [fontManager fontWithFamily:availableFamily traits:nonSyntheticTraits weight:chosenWeight size:size];
- if (fontWithoutSyntheticTraits)
- font = fontWithoutSyntheticTraits;
- }
-
- return toCTFont(font);
-}
-#endif
-
void platformInvalidateFontCache()
{
-#if !ENABLE(PLATFORM_FONT_LOOKUP)
- desiredFamilyToAvailableFamilyMap().clear();
-#endif
}
Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescription)
Modified: trunk/Tools/ChangeLog (212875 => 212876)
--- trunk/Tools/ChangeLog 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Tools/ChangeLog 2017-02-23 06:11:02 UTC (rev 212876)
@@ -1,3 +1,28 @@
+2017-02-22 Myles C. Maxfield <mmaxfi...@apple.com>
+
+ [Cocoa] Remove Yosemite-specific font lookup code
+ https://bugs.webkit.org/show_bug.cgi?id=168682
+
+ Reviewed by Zalan Bujtas.
+
+ * DumpRenderTree/mac/DumpRenderTree.mm:
+ (fontWhitelist):
+ (adjustFonts):
+ (createWebViewAndOffscreenWindow):
+ (drt_NSFontManager_availableFontFamilies): Deleted.
+ (drt_NSFontManager_availableFonts): Deleted.
+ (swizzleNSFontManagerMethods): Deleted.
+ * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
+ (WTR::activateFonts):
+ (WTR::allowedFontFamilySet): Deleted.
+ (WTR::systemHiddenFontFamilySet): Deleted.
+ (WTR::wtr_NSFontManager_availableFontFamilies): Deleted.
+ (WTR::wtr_NSFontManager_availableFonts): Deleted.
+ (WTR::swizzleNSFontManagerMethods): Deleted.
+ * WebKitTestRunner/mac/TestControllerMac.mm:
+ (WTR::generateWhitelist):
+ (WTR::TestController::platformInitializeContext):
+
2017-02-22 Carlos Alberto Lopez Perez <clo...@igalia.com>
AutoInstaller should not skip the install step if the package is downloaded but not installed
Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (212875 => 212876)
--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm 2017-02-23 06:11:02 UTC (rev 212876)
@@ -428,68 +428,6 @@
return fontFamilySet;
}
-#if !ENABLE(PLATFORM_FONT_LOOKUP)
-static IMP appKitAvailableFontFamiliesIMP;
-static IMP appKitAvailableFontsIMP;
-
-static NSArray *drt_NSFontManager_availableFontFamilies(id self, SEL _cmd)
-{
- static NSArray *availableFontFamilies;
- if (availableFontFamilies)
- return availableFontFamilies;
-
- NSArray *availableFamilies = wtfCallIMP<id>(appKitAvailableFontFamiliesIMP, self, _cmd);
-
- NSMutableSet *prunedFamiliesSet = [NSMutableSet setWithArray:availableFamilies];
- [prunedFamiliesSet intersectSet:allowedFontFamilySet()];
-
- availableFontFamilies = [[prunedFamiliesSet allObjects] retain];
- return availableFontFamilies;
-}
-
-static NSArray *drt_NSFontManager_availableFonts(id self, SEL _cmd)
-{
- static NSArray *availableFonts;
- if (availableFonts)
- return availableFonts;
-
- NSSet *allowedFamilies = allowedFontFamilySet();
- NSMutableArray *availableFontList = [[NSMutableArray alloc] initWithCapacity:[allowedFamilies count] * 2];
- for (NSString *fontFamily in allowedFontFamilySet()) {
- NSArray* fontsForFamily = [[NSFontManager sharedFontManager] availableMembersOfFontFamily:fontFamily];
- for (NSArray* fontInfo in fontsForFamily) {
- // Font name is the first entry in the array.
- [availableFontList addObject:[fontInfo objectAtIndex:0]];
- }
- }
-
- availableFonts = availableFontList;
- return availableFonts;
-}
-
-static void swizzleNSFontManagerMethods()
-{
- Method availableFontFamiliesMethod = class_getInstanceMethod(objc_getClass("NSFontManager"), @selector(availableFontFamilies));
- ASSERT(availableFontFamiliesMethod);
- if (!availableFontFamiliesMethod) {
- NSLog(@"Failed to swizzle the \"availableFontFamilies\" method on NSFontManager");
- return;
- }
-
- appKitAvailableFontFamiliesIMP = method_setImplementation(availableFontFamiliesMethod, (IMP)drt_NSFontManager_availableFontFamilies);
-
- Method availableFontsMethod = class_getInstanceMethod(objc_getClass("NSFontManager"), @selector(availableFonts));
- ASSERT(availableFontsMethod);
- if (!availableFontsMethod) {
- NSLog(@"Failed to swizzle the \"availableFonts\" method on NSFontManager");
- return;
- }
-
- appKitAvailableFontsIMP = method_setImplementation(availableFontsMethod, (IMP)drt_NSFontManager_availableFonts);
-}
-
-#else
-
static NSArray *fontWhitelist()
{
static NSArray *availableFonts;
@@ -509,7 +447,6 @@
availableFonts = availableFontList;
return availableFonts;
}
-#endif
// Activating system copies of these fonts overrides any others that could be preferred, such as ones
// in /Library/Fonts/Microsoft, and which don't always have the same metrics.
@@ -588,9 +525,6 @@
static void adjustFonts()
{
-#if !ENABLE(PLATFORM_FONT_LOOKUP)
- swizzleNSFontManagerMethods();
-#endif
activateSystemCoreWebFonts();
activateTestingFonts();
}
@@ -780,7 +714,7 @@
[WebView registerURLSchemeAsLocal:@"feeds"];
[WebView registerURLSchemeAsLocal:@"feedsearch"];
-#if PLATFORM(MAC) && ENABLE(PLATFORM_FONT_LOOKUP)
+#if PLATFORM(MAC)
[WebView _setFontWhitelist:fontWhitelist()];
#endif
Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm (212875 => 212876)
--- trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm 2017-02-23 06:11:02 UTC (rev 212876)
@@ -45,206 +45,6 @@
#if USE(APPKIT)
-#if !ENABLE(PLATFORM_FONT_LOOKUP)
-static NSSet *allowedFontFamilySet()
-{
- static NSSet *fontFamilySet = [[NSSet setWithObjects:
- @"Ahem",
- @"Al Bayan",
- @"American Typewriter",
- @"Andale Mono",
- @"Apple Braille",
- @"Apple Color Emoji",
- @"Apple Chancery",
- @"Apple Garamond BT",
- @"Apple LiGothic",
- @"Apple LiSung",
- @"Apple Symbols",
- @"AppleGothic",
- @"AppleMyungjo",
- @"Arial Black",
- @"Arial Hebrew",
- @"Arial Narrow",
- @"Arial Rounded MT Bold",
- @"Arial Unicode MS",
- @"Arial",
- @"Avenir Next",
- @"Ayuthaya",
- @"Baghdad",
- @"Baskerville",
- @"BiauKai",
- @"Big Caslon",
- @"Brush Script MT",
- @"Chalkboard",
- @"Chalkduster",
- @"Charcoal CY",
- @"Cochin",
- @"Comic Sans MS",
- @"Copperplate",
- @"Corsiva Hebrew",
- @"Courier New",
- @"Courier",
- @"DecoType Naskh",
- @"Devanagari MT",
- @"Didot",
- @"Euphemia UCAS",
- @"Futura",
- @"GB18030 Bitmap",
- @"Geeza Pro",
- @"Geneva CY",
- @"Geneva",
- @"Georgia",
- @"Gill Sans",
- @"Gujarati MT",
- @"GungSeo",
- @"Gurmukhi MT",
- @"HeadLineA",
- @"Hei",
- @"Heiti SC",
- @"Heiti TC",
- @"Helvetica CY",
- @"Helvetica Neue",
- @"Helvetica",
- @"Herculanum",
- @"Hiragino Kaku Gothic Pro",
- @"Hiragino Kaku Gothic ProN",
- @"Hiragino Kaku Gothic Std",
- @"Hiragino Kaku Gothic StdN",
- @"Hiragino Maru Gothic Pro",
- @"Hiragino Maru Gothic ProN",
- @"Hiragino Mincho Pro",
- @"Hiragino Mincho ProN",
- @"Hiragino Sans GB",
- @"Hoefler Text",
- @"Impact",
- @"InaiMathi",
- @"Kai",
- @"Kailasa",
- @"Kokonor",
- @"Krungthep",
- @"KufiStandardGK",
- @"LastResort",
- @"LiHei Pro",
- @"LiSong Pro",
- @"Lucida Grande",
- @"Marker Felt",
- @"Menlo",
- @"Microsoft Sans Serif",
- @"Monaco",
- @"Mshtakan",
- @"Nadeem",
- @"New Peninim MT",
- @"Optima",
- @"Osaka",
- @"Papyrus",
- @"PCMyungjo",
- @"PilGi",
- @"Plantagenet Cherokee",
- @"Raanana",
- @"Sathu",
- @"Silom",
- @"Skia",
- @"Songti SC",
- @"Songti TC",
- @"STFangsong",
- @"STHeiti",
- @"STIXGeneral",
- @"STIXSizeOneSym",
- @"STKaiti",
- @"STSong",
- @"Symbol",
- @"Tahoma",
- @"Thonburi",
- @"Times New Roman",
- @"Times",
- @"Trebuchet MS",
- @"Verdana",
- @"Webdings",
- @"WebKit WeightWatcher",
- @"FontWithFeaturesOTF",
- @"FontWithFeaturesTTF",
- @"Wingdings 2",
- @"Wingdings 3",
- @"Wingdings",
- @"Zapf Dingbats",
- @"Zapfino",
- nil] retain];
-
- return fontFamilySet;
-}
-
-static NSSet *systemHiddenFontFamilySet()
-{
- static NSSet *fontFamilySet = [[NSSet setWithObjects:
- @".LucidaGrandeUI",
- nil] retain];
-
- return fontFamilySet;
-}
-
-static IMP appKitAvailableFontFamiliesIMP;
-static IMP appKitAvailableFontsIMP;
-
-static NSArray *wtr_NSFontManager_availableFontFamilies(id self, SEL _cmd)
-{
- static NSArray *availableFontFamilies;
- if (availableFontFamilies)
- return availableFontFamilies;
-
- NSArray *availableFamilies = wtfCallIMP<id>(appKitAvailableFontFamiliesIMP, self, _cmd);
-
- NSMutableSet *prunedFamiliesSet = [NSMutableSet setWithArray:availableFamilies];
- [prunedFamiliesSet intersectSet:allowedFontFamilySet()];
-
- availableFontFamilies = [[prunedFamiliesSet allObjects] retain];
- return availableFontFamilies;
-}
-
-static NSArray *wtr_NSFontManager_availableFonts(id self, SEL _cmd)
-{
- static NSArray *availableFonts;
- if (availableFonts)
- return availableFonts;
-
- NSSet *allowedFamilies = allowedFontFamilySet();
- NSMutableArray *availableFontList = [[NSMutableArray alloc] initWithCapacity:[allowedFamilies count] * 2];
- for (NSString *fontFamily in allowedFontFamilySet()) {
- NSArray* fontsForFamily = [[NSFontManager sharedFontManager] availableMembersOfFontFamily:fontFamily];
- for (NSArray* fontInfo in fontsForFamily) {
- // Font name is the first entry in the array.
- [availableFontList addObject:[fontInfo objectAtIndex:0]];
- }
- }
-
- for (NSString *hiddenFontFamily in systemHiddenFontFamilySet())
- [availableFontList addObject:hiddenFontFamily];
-
- availableFonts = availableFontList;
- return availableFonts;
-}
-
-static void swizzleNSFontManagerMethods()
-{
- Method availableFontFamiliesMethod = class_getInstanceMethod(objc_getClass("NSFontManager"), @selector(availableFontFamilies));
- ASSERT(availableFontFamiliesMethod);
- if (!availableFontFamiliesMethod) {
- NSLog(@"Failed to swizzle the \"availableFontFamilies\" method on NSFontManager");
- return;
- }
-
- appKitAvailableFontFamiliesIMP = method_setImplementation(availableFontFamiliesMethod, (IMP)wtr_NSFontManager_availableFontFamilies);
-
- Method availableFontsMethod = class_getInstanceMethod(objc_getClass("NSFontManager"), @selector(availableFonts));
- ASSERT(availableFontsMethod);
- if (!availableFontsMethod) {
- NSLog(@"Failed to swizzle the \"availableFonts\" method on NSFontManager");
- return;
- }
-
- appKitAvailableFontsIMP = method_setImplementation(availableFontsMethod, (IMP)wtr_NSFontManager_availableFonts);
-}
-#endif
-
// Activating system copies of these fonts overrides any others that could be preferred, such as ones
// in /Library/Fonts/Microsoft, and which don't always have the same metrics.
// FIXME: Switch to a solution from <rdar://problem/19553550> once it's available.
@@ -322,9 +122,6 @@
}
#if USE(APPKIT)
-#if !ENABLE(PLATFORM_FONT_LOOKUP)
- swizzleNSFontManagerMethods();
-#endif
activateSystemCoreWebFonts();
#endif // USE(APPKIT)
}
Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (212875 => 212876)
--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2017-02-23 04:43:46 UTC (rev 212875)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm 2017-02-23 06:11:02 UTC (rev 212876)
@@ -143,7 +143,6 @@
#endif
}
-#if ENABLE(PLATFORM_FONT_LOOKUP)
static NSSet *allowedFontFamilySet()
{
static NSSet *fontFamilySet = [[NSSet setWithObjects:
@@ -299,7 +298,6 @@
return adoptWK(result);
}
-#endif
void TestController::platformInitializeContext()
{
@@ -312,9 +310,7 @@
diskPath:nil]);
[NSURLCache setSharedURLCache:sharedCache.get()];
-#if ENABLE(PLATFORM_FONT_LOOKUP)
WKContextSetFontWhitelist(m_context.get(), generateWhitelist().get());
-#endif
}
void TestController::setHidden(bool hidden)