Title: [193517] branches/safari-601-branch/Source/WebCore

Diff

Modified: branches/safari-601-branch/Source/WebCore/ChangeLog (193516 => 193517)


--- branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-05 18:30:06 UTC (rev 193516)
+++ branches/safari-601-branch/Source/WebCore/ChangeLog	2015-12-05 18:30:10 UTC (rev 193517)
@@ -1,5 +1,34 @@
 2015-12-05  Matthew Hanson  <matthew_han...@apple.com>
 
+        Merge r188168. rdar://problem/23769732
+
+    2015-08-07  Myles C. Maxfield  <mmaxfi...@apple.com>
+
+            Post-review comments on r188146
+            https://bugs.webkit.org/show_bug.cgi?id=147793
+
+            Reviewed by Daniel Bates.
+
+            No new tests because there is no behavior change.
+
+            * platform/graphics/FontCache.h:
+            * platform/graphics/cocoa/FontCacheCoreText.cpp:
+            (WebCore::appendTrueTypeFeature):
+            (WebCore::appendOpenTypeFeature):
+            (WebCore::applyFontFeatureSettings):
+            * platform/graphics/ios/FontCacheIOS.mm:
+            (WebCore::FontCache::getSystemFontFallbackForCharacters):
+            (WebCore::FontCache::createFontPlatformData):
+            * platform/graphics/mac/FontCacheMac.mm:
+            (WebCore::fontWithFamily):
+            (WebCore::FontCache::systemFallbackForCharacters):
+            * platform/graphics/mac/FontCustomPlatformData.cpp:
+            (WebCore::FontCustomPlatformData::fontPlatformData):
+            * rendering/RenderThemeIOS.mm:
+            (WebCore::RenderThemeIOS::updateCachedSystemFontDescription):
+
+2015-12-05  Matthew Hanson  <matthew_han...@apple.com>
+
         Merge r188146. rdar://problem/23769732
 
     2015-08-07  Myles C. Maxfield  <mmaxfi...@apple.com>

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/FontCache.h (193516 => 193517)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/FontCache.h	2015-12-05 18:30:06 UTC (rev 193516)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/FontCache.h	2015-12-05 18:30:10 UTC (rev 193517)
@@ -182,7 +182,7 @@
 };
 
 #if PLATFORM(COCOA)
-RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef, const FontFeatureSettings&);
+RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef, const FontFeatureSettings*);
 #endif
 
 #if !PLATFORM(MAC)

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (193516 => 193517)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2015-12-05 18:30:06 UTC (rev 193516)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp	2015-12-05 18:30:10 UTC (rev 193517)
@@ -28,11 +28,9 @@
 
 namespace WebCore {
 
-static inline void appendTrueTypeFeature(CFMutableArrayRef features, const FontFeature& feature)
+static inline void appendTrueTypeFeature(CFMutableArrayRef, const FontFeature&)
 {
-    // FIXME: We should map OpenType feature strings to the TrueType feature type identifiers listed in <CoreText/SFNTLayoutTypes.h>
-    UNUSED_PARAM(features);
-    UNUSED_PARAM(feature);
+    // FIXME: We should map OpenType feature strings to the TrueType feature type identifiers listed in <CoreText/SFNTLayoutTypes.h>.
 }
 
 static inline void appendOpenTypeFeature(CFMutableArrayRef features, const FontFeature& feature)
@@ -41,9 +39,9 @@
     RetainPtr<CFStringRef> featureKey = feature.tag().string().createCFString();
     int rawFeatureValue = feature.value();
     RetainPtr<CFNumberRef> featureValue = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &rawFeatureValue));
-    CFStringRef featureDictionaryKeys[] = {kCTFontOpenTypeFeatureTag, kCTFontOpenTypeFeatureValue};
-    CFTypeRef featureDictionaryValues[] = {featureKey.get(), featureValue.get()};
-    RetainPtr<CFDictionaryRef> featureDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, (const void**)featureDictionaryKeys, featureDictionaryValues, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
+    CFStringRef featureDictionaryKeys[] = { kCTFontOpenTypeFeatureTag, kCTFontOpenTypeFeatureValue };
+    CFTypeRef featureDictionaryValues[] = { featureKey.get(), featureValue.get() };
+    RetainPtr<CFDictionaryRef> featureDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, (const void**)featureDictionaryKeys, featureDictionaryValues, WTF_ARRAY_LENGTH(featureDictionaryValues), &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
     CFArrayAppendValue(features, featureDictionary.get());
 #else
     UNUSED_PARAM(features);
@@ -51,12 +49,15 @@
 #endif
 }
 
-RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef originalFont, const FontFeatureSettings& features)
+RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef originalFont, const FontFeatureSettings* features)
 {
-    RetainPtr<CFMutableArrayRef> featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features.size(), &kCFTypeArrayCallBacks));
-    for (size_t i = 0; i < features.size(); ++i) {
-        appendTrueTypeFeature(featureArray.get(), features[i]);
-        appendOpenTypeFeature(featureArray.get(), features[i]);
+    if (!originalFont || !features || !features->size())
+        return originalFont;
+
+    RetainPtr<CFMutableArrayRef> featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features->size(), &kCFTypeArrayCallBacks));
+    for (size_t i = 0; i < features->size(); ++i) {
+        appendTrueTypeFeature(featureArray.get(), features->at(i));
+        appendOpenTypeFeature(featureArray.get(), features->at(i));
     }
     CFArrayRef featureArrayPtr = featureArray.get();
     RetainPtr<CFDictionaryRef> dictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, (const void**)&kCTFontFeatureSettingsAttribute, (const void**)&featureArrayPtr, 1, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (193516 => 193517)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2015-12-05 18:30:06 UTC (rev 193516)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm	2015-12-05 18:30:10 UTC (rev 193517)
@@ -85,8 +85,7 @@
     if (!substituteFont)
         return nullptr;
 
-    if (substituteFont && description.featureSettings() && description.featureSettings()->size())
-        substituteFont = applyFontFeatureSettings(substituteFont.get(), *description.featureSettings());
+    substituteFont = applyFontFeatureSettings(substituteFont.get(), description.featureSettings());
 
     CTFontSymbolicTraits originalTraits = CTFontGetSymbolicTraits(ctFont);
     CTFontSymbolicTraits actualTraits = 0;
@@ -702,8 +701,7 @@
     if (!ctFont)
         return nullptr;
 
-    if (ctFont && fontDescription.featureSettings() && fontDescription.featureSettings()->size())
-        ctFont = applyFontFeatureSettings(ctFont.get(), *fontDescription.featureSettings());
+    ctFont = applyFontFeatureSettings(ctFont.get(), fontDescription.featureSettings());
 
     CTFontSymbolicTraits actualTraits = 0;
     if (isFontWeightBold(fontDescription.weight()) || fontDescription.italic())

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (193516 => 193517)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2015-12-05 18:30:06 UTC (rev 193516)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm	2015-12-05 18:30:10 UTC (rev 193517)
@@ -287,10 +287,9 @@
 
     NSString *desiredFamily = family;
     RetainPtr<CTFontRef> foundFont = adoptCF(CTFontCreateForCSS((CFStringRef)desiredFamily, toCoreTextFontWeight(weight), requestedTraits, size));
+    foundFont = applyFontFeatureSettings(foundFont.get(), featureSettings);
     if (!foundFont)
         return nil;
-    if (featureSettings && featureSettings->size())
-        foundFont = applyFontFeatureSettings(foundFont.get(), *featureSettings);
     font = CFBridgingRelease(CFRetain(foundFont.get()));
     availableFamily = [font familyName];
     chosenWeight = [fontManager weightOfFont:font];
@@ -511,8 +510,7 @@
     const FontPlatformData& platformData = originalFontData->platformData();
     NSFont *nsFont = platformData.nsFont();
     RetainPtr<CTFontRef> result = lookupCTFont(platformData.font(), platformData.size(), characters, length);
-    if (result && description.featureSettings() && description.featureSettings()->size())
-        result = applyFontFeatureSettings(result.get(), *description.featureSettings());
+    result = applyFontFeatureSettings(result.get(), description.featureSettings());
     if (!result)
         return nullptr;
 

Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (193516 => 193517)


--- branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp	2015-12-05 18:30:06 UTC (rev 193516)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp	2015-12-05 18:30:10 UTC (rev 193517)
@@ -37,8 +37,7 @@
 {
 #if CORETEXT_WEB_FONTS
     RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(m_fontDescriptor.get(), size, nullptr));
-    if (font && fontDescription.featureSettings() && fontDescription.featureSettings()->size())
-        font = applyFontFeatureSettings(font.get(), *fontDescription.featureSettings());
+    font = applyFontFeatureSettings(font.get(), fontDescription.featureSettings());
     return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant);
 #else
     return FontPlatformData(m_cgFont.get(), size, bold, italic, orientation, widthVariant);

Modified: branches/safari-601-branch/Source/WebCore/rendering/RenderThemeIOS.mm (193516 => 193517)


--- branches/safari-601-branch/Source/WebCore/rendering/RenderThemeIOS.mm	2015-12-05 18:30:06 UTC (rev 193516)
+++ branches/safari-601-branch/Source/WebCore/rendering/RenderThemeIOS.mm	2015-12-05 18:30:10 UTC (rev 193517)
@@ -1271,8 +1271,7 @@
 
     ASSERT(fontDescriptor);
     RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 0, nullptr));
-    if (font && fontDescription.featureSettings() && fontDescription.featureSettings()->size())
-        font = applyFontFeatureSettings(font.get(), *fontDescription.featureSettings());
+    font = applyFontFeatureSettings(font.get(), fontDescription.featureSettings());
     fontDescription.setIsAbsoluteSize(true);
     fontDescription.setOneFamily(textStyle);
     fontDescription.setSpecifiedSize(CTFontGetSize(font.get()));
_______________________________________________
webkit-changes mailing list
webkit-changes@lists.webkit.org
https://lists.webkit.org/mailman/listinfo/webkit-changes

Reply via email to