<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.1//EN"
"http://www.w3.org/TR/xhtml11/DTD/xhtml11.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head><meta http-equiv="content-type" content="text/html; charset=utf-8" />
<title>[193540] branches/safari-601.1.46-branch/Source/WebCore</title>
</head>
<body>

<style type="text/css"><!--
#msg dl.meta { border: 1px #006 solid; background: #369; padding: 6px; color: #fff; }
#msg dl.meta dt { float: left; width: 6em; font-weight: bold; }
#msg dt:after { content:':';}
#msg dl, #msg dt, #msg ul, #msg li, #header, #footer, #logmsg { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt;  }
#msg dl a { font-weight: bold}
#msg dl a:link    { color:#fc3; }
#msg dl a:active  { color:#ff0; }
#msg dl a:visited { color:#cc6; }
h3 { font-family: verdana,arial,helvetica,sans-serif; font-size: 10pt; font-weight: bold; }
#msg pre { overflow: auto; background: #ffc; border: 1px #fa0 solid; padding: 6px; }
#logmsg { background: #ffc; border: 1px #fa0 solid; padding: 1em 1em 0 1em; }
#logmsg p, #logmsg pre, #logmsg blockquote { margin: 0 0 1em 0; }
#logmsg p, #logmsg li, #logmsg dt, #logmsg dd { line-height: 14pt; }
#logmsg h1, #logmsg h2, #logmsg h3, #logmsg h4, #logmsg h5, #logmsg h6 { margin: .5em 0; }
#logmsg h1:first-child, #logmsg h2:first-child, #logmsg h3:first-child, #logmsg h4:first-child, #logmsg h5:first-child, #logmsg h6:first-child { margin-top: 0; }
#logmsg ul, #logmsg ol { padding: 0; list-style-position: inside; margin: 0 0 0 1em; }
#logmsg ul { text-indent: -1em; padding-left: 1em; }#logmsg ol { text-indent: -1.5em; padding-left: 1.5em; }
#logmsg > ul, #logmsg > ol { margin: 0 0 1em 0; }
#logmsg pre { background: #eee; padding: 1em; }
#logmsg blockquote { border: 1px solid #fa0; border-left-width: 10px; padding: 1em 1em 0 1em; background: white;}
#logmsg dl { margin: 0; }
#logmsg dt { font-weight: bold; }
#logmsg dd { margin: 0; padding: 0 0 0.5em 0; }
#logmsg dd:before { content:'\00bb';}
#logmsg table { border-spacing: 0px; border-collapse: collapse; border-top: 4px solid #fa0; border-bottom: 1px solid #fa0; background: #fff; }
#logmsg table th { text-align: left; font-weight: normal; padding: 0.2em 0.5em; border-top: 1px dotted #fa0; }
#logmsg table td { text-align: right; border-top: 1px dotted #fa0; padding: 0.2em 0.5em; }
#logmsg table thead th { text-align: center; border-bottom: 1px solid #fa0; }
#logmsg table th.Corner { text-align: left; }
#logmsg hr { border: none 0; border-top: 2px dashed #fa0; height: 1px; }
#header, #footer { color: #fff; background: #636; border: 1px #300 solid; padding: 6px; }
#patch { width: 100%; }
#patch h4 {font-family: verdana,arial,helvetica,sans-serif;font-size:10pt;padding:8px;background:#369;color:#fff;margin:0;}
#patch .propset h4, #patch .binary h4 {margin:0;}
#patch pre {padding:0;line-height:1.2em;margin:0;}
#patch .diff {width:100%;background:#eee;padding: 0 0 10px 0;overflow:auto;}
#patch .propset .diff, #patch .binary .diff  {padding:10px 0;}
#patch span {display:block;padding:0 10px;}
#patch .modfile, #patch .addfile, #patch .delfile, #patch .propset, #patch .binary, #patch .copfile {border:1px solid #ccc;margin:10px 0;}
#patch ins {background:#dfd;text-decoration:none;display:block;padding:0 10px;}
#patch del {background:#fdd;text-decoration:none;display:block;padding:0 10px;}
#patch .lines, .info {color:#888;background:#fff;}
--></style>
<div id="msg">
<dl class="meta">
<dt>Revision</dt> <dd><a href="http://trac.webkit.org/projects/webkit/changeset/193540">193540</a></dd>
<dt>Author</dt> <dd>ddkilzer@apple.com</dd>
<dt>Date</dt> <dd>2015-12-05 17:54:25 -0800 (Sat, 05 Dec 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Merge <a href="http://trac.webkit.org/projects/webkit/changeset/188168">r188168</a>. rdar://problem/23769683</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601146branchSourceWebCoreChangeLog">branches/safari-601.1.46-branch/Source/WebCore/ChangeLog</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformgraphicsFontCacheh">branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp">branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformgraphicsiosFontCacheIOSmm">branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformgraphicsmacFontCacheMacmm">branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm</a></li>
<li><a href="#branchessafari601146branchSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp">branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp</a></li>
<li><a href="#branchessafari601146branchSourceWebCorerenderingRenderThemeIOSmm">branches/safari-601.1.46-branch/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601146branchSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/ChangeLog (193539 => 193540)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-06 01:54:22 UTC (rev 193539)
+++ branches/safari-601.1.46-branch/Source/WebCore/ChangeLog        2015-12-06 01:54:25 UTC (rev 193540)
</span><span class="lines">@@ -1,5 +1,34 @@
</span><span class="cx"> 2015-12-05  Matthew Hanson  &lt;matthew_hanson@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Merge r188168. rdar://problem/23769683
+
+    2015-08-07  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+            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  &lt;matthew_hanson@apple.com&gt;
+
</ins><span class="cx">         Merge r188146. rdar://problem/23769683
</span><span class="cx"> 
</span><span class="cx">     2015-08-07  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCache.h (193539 => 193540)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCache.h        2015-12-06 01:54:22 UTC (rev 193539)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/FontCache.h        2015-12-06 01:54:25 UTC (rev 193540)
</span><span class="lines">@@ -182,7 +182,7 @@
</span><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-RetainPtr&lt;CTFontRef&gt; applyFontFeatureSettings(CTFontRef, const FontFeatureSettings&amp;);
</del><ins>+RetainPtr&lt;CTFontRef&gt; applyFontFeatureSettings(CTFontRef, const FontFeatureSettings*);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if !PLATFORM(MAC)
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (193539 => 193540)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2015-12-06 01:54:22 UTC (rev 193539)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2015-12-06 01:54:25 UTC (rev 193540)
</span><span class="lines">@@ -28,11 +28,9 @@
</span><span class="cx"> 
</span><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><del>-static inline void appendTrueTypeFeature(CFMutableArrayRef features, const FontFeature&amp; feature)
</del><ins>+static inline void appendTrueTypeFeature(CFMutableArrayRef, const FontFeature&amp;)
</ins><span class="cx"> {
</span><del>-    // FIXME: We should map OpenType feature strings to the TrueType feature type identifiers listed in &lt;CoreText/SFNTLayoutTypes.h&gt;
-    UNUSED_PARAM(features);
-    UNUSED_PARAM(feature);
</del><ins>+    // FIXME: We should map OpenType feature strings to the TrueType feature type identifiers listed in &lt;CoreText/SFNTLayoutTypes.h&gt;.
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static inline void appendOpenTypeFeature(CFMutableArrayRef features, const FontFeature&amp; feature)
</span><span class="lines">@@ -41,9 +39,9 @@
</span><span class="cx">     RetainPtr&lt;CFStringRef&gt; featureKey = feature.tag().string().createCFString();
</span><span class="cx">     int rawFeatureValue = feature.value();
</span><span class="cx">     RetainPtr&lt;CFNumberRef&gt; featureValue = adoptCF(CFNumberCreate(kCFAllocatorDefault, kCFNumberIntType, &amp;rawFeatureValue));
</span><del>-    CFStringRef featureDictionaryKeys[] = {kCTFontOpenTypeFeatureTag, kCTFontOpenTypeFeatureValue};
-    CFTypeRef featureDictionaryValues[] = {featureKey.get(), featureValue.get()};
-    RetainPtr&lt;CFDictionaryRef&gt; featureDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, (const void**)featureDictionaryKeys, featureDictionaryValues, 2, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
</del><ins>+    CFStringRef featureDictionaryKeys[] = { kCTFontOpenTypeFeatureTag, kCTFontOpenTypeFeatureValue };
+    CFTypeRef featureDictionaryValues[] = { featureKey.get(), featureValue.get() };
+    RetainPtr&lt;CFDictionaryRef&gt; featureDictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, (const void**)featureDictionaryKeys, featureDictionaryValues, WTF_ARRAY_LENGTH(featureDictionaryValues), &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
</ins><span class="cx">     CFArrayAppendValue(features, featureDictionary.get());
</span><span class="cx"> #else
</span><span class="cx">     UNUSED_PARAM(features);
</span><span class="lines">@@ -51,12 +49,15 @@
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RetainPtr&lt;CTFontRef&gt; applyFontFeatureSettings(CTFontRef originalFont, const FontFeatureSettings&amp; features)
</del><ins>+RetainPtr&lt;CTFontRef&gt; applyFontFeatureSettings(CTFontRef originalFont, const FontFeatureSettings* features)
</ins><span class="cx"> {
</span><del>-    RetainPtr&lt;CFMutableArrayRef&gt; featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features.size(), &amp;kCFTypeArrayCallBacks));
-    for (size_t i = 0; i &lt; features.size(); ++i) {
-        appendTrueTypeFeature(featureArray.get(), features[i]);
-        appendOpenTypeFeature(featureArray.get(), features[i]);
</del><ins>+    if (!originalFont || !features || !features-&gt;size())
+        return originalFont;
+
+    RetainPtr&lt;CFMutableArrayRef&gt; featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features-&gt;size(), &amp;kCFTypeArrayCallBacks));
+    for (size_t i = 0; i &lt; features-&gt;size(); ++i) {
+        appendTrueTypeFeature(featureArray.get(), features-&gt;at(i));
+        appendOpenTypeFeature(featureArray.get(), features-&gt;at(i));
</ins><span class="cx">     }
</span><span class="cx">     CFArrayRef featureArrayPtr = featureArray.get();
</span><span class="cx">     RetainPtr&lt;CFDictionaryRef&gt; dictionary = adoptCF(CFDictionaryCreate(kCFAllocatorDefault, (const void**)&amp;kCTFontFeatureSettingsAttribute, (const void**)&amp;featureArrayPtr, 1, &amp;kCFTypeDictionaryKeyCallBacks, &amp;kCFTypeDictionaryValueCallBacks));
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformgraphicsiosFontCacheIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (193539 => 193540)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2015-12-06 01:54:22 UTC (rev 193539)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2015-12-06 01:54:25 UTC (rev 193540)
</span><span class="lines">@@ -86,8 +86,7 @@
</span><span class="cx">     if (!substituteFont)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (substituteFont &amp;&amp; description.featureSettings() &amp;&amp; description.featureSettings()-&gt;size())
-        substituteFont = applyFontFeatureSettings(substituteFont.get(), *description.featureSettings());
</del><ins>+    substituteFont = applyFontFeatureSettings(substituteFont.get(), description.featureSettings());
</ins><span class="cx"> 
</span><span class="cx">     CTFontSymbolicTraits originalTraits = CTFontGetSymbolicTraits(ctFont);
</span><span class="cx">     CTFontSymbolicTraits actualTraits = 0;
</span><span class="lines">@@ -720,8 +719,7 @@
</span><span class="cx">     if (!ctFont)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><del>-    if (ctFont &amp;&amp; fontDescription.featureSettings() &amp;&amp; fontDescription.featureSettings()-&gt;size())
-        ctFont = applyFontFeatureSettings(ctFont.get(), *fontDescription.featureSettings());
</del><ins>+    ctFont = applyFontFeatureSettings(ctFont.get(), fontDescription.featureSettings());
</ins><span class="cx"> 
</span><span class="cx">     CTFontSymbolicTraits actualTraits = 0;
</span><span class="cx">     if (isFontWeightBold(fontDescription.weight()) || fontDescription.italic())
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformgraphicsmacFontCacheMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (193539 => 193540)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2015-12-06 01:54:22 UTC (rev 193539)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2015-12-06 01:54:25 UTC (rev 193540)
</span><span class="lines">@@ -287,10 +287,9 @@
</span><span class="cx"> 
</span><span class="cx">     NSString *desiredFamily = family;
</span><span class="cx">     RetainPtr&lt;CTFontRef&gt; foundFont = adoptCF(CTFontCreateForCSS((CFStringRef)desiredFamily, toCoreTextFontWeight(weight), requestedTraits, size));
</span><ins>+    foundFont = applyFontFeatureSettings(foundFont.get(), featureSettings);
</ins><span class="cx">     if (!foundFont)
</span><span class="cx">         return nil;
</span><del>-    if (featureSettings &amp;&amp; featureSettings-&gt;size())
-        foundFont = applyFontFeatureSettings(foundFont.get(), *featureSettings);
</del><span class="cx">     font = CFBridgingRelease(CFRetain(foundFont.get()));
</span><span class="cx">     availableFamily = [font familyName];
</span><span class="cx">     chosenWeight = [fontManager weightOfFont:font];
</span><span class="lines">@@ -511,8 +510,7 @@
</span><span class="cx">     const FontPlatformData&amp; platformData = originalFontData-&gt;platformData();
</span><span class="cx">     NSFont *nsFont = platformData.nsFont();
</span><span class="cx">     RetainPtr&lt;CTFontRef&gt; result = lookupCTFont(platformData.font(), platformData.size(), characters, length);
</span><del>-    if (result &amp;&amp; description.featureSettings() &amp;&amp; description.featureSettings()-&gt;size())
-        result = applyFontFeatureSettings(result.get(), *description.featureSettings());
</del><ins>+    result = applyFontFeatureSettings(result.get(), description.featureSettings());
</ins><span class="cx">     if (!result)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (193539 => 193540)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2015-12-06 01:54:22 UTC (rev 193539)
+++ branches/safari-601.1.46-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2015-12-06 01:54:25 UTC (rev 193540)
</span><span class="lines">@@ -37,8 +37,7 @@
</span><span class="cx"> {
</span><span class="cx"> #if CORETEXT_WEB_FONTS
</span><span class="cx">     RetainPtr&lt;CTFontRef&gt; font = adoptCF(CTFontCreateWithFontDescriptor(m_fontDescriptor.get(), size, nullptr));
</span><del>-    if (font &amp;&amp; fontDescription.featureSettings() &amp;&amp; fontDescription.featureSettings()-&gt;size())
-        font = applyFontFeatureSettings(font.get(), *fontDescription.featureSettings());
</del><ins>+    font = applyFontFeatureSettings(font.get(), fontDescription.featureSettings());
</ins><span class="cx">     return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant);
</span><span class="cx"> #else
</span><span class="cx">     return FontPlatformData(m_cgFont.get(), size, bold, italic, orientation, widthVariant);
</span></span></pre></div>
<a id="branchessafari601146branchSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601.1.46-branch/Source/WebCore/rendering/RenderThemeIOS.mm (193539 => 193540)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601.1.46-branch/Source/WebCore/rendering/RenderThemeIOS.mm        2015-12-06 01:54:22 UTC (rev 193539)
+++ branches/safari-601.1.46-branch/Source/WebCore/rendering/RenderThemeIOS.mm        2015-12-06 01:54:25 UTC (rev 193540)
</span><span class="lines">@@ -1271,8 +1271,7 @@
</span><span class="cx"> 
</span><span class="cx">     ASSERT(fontDescriptor);
</span><span class="cx">     RetainPtr&lt;CTFontRef&gt; font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 0, nullptr));
</span><del>-    if (font &amp;&amp; fontDescription.featureSettings() &amp;&amp; fontDescription.featureSettings()-&gt;size())
-        font = applyFontFeatureSettings(font.get(), *fontDescription.featureSettings());
</del><ins>+    font = applyFontFeatureSettings(font.get(), fontDescription.featureSettings());
</ins><span class="cx">     fontDescription.setIsAbsoluteSize(true);
</span><span class="cx">     fontDescription.setOneFamily(textStyle);
</span><span class="cx">     fontDescription.setSpecifiedSize(CTFontGetSize(font.get()));
</span></span></pre>
</div>
</div>

</body>
</html>