<!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>[196637] branches/safari-601-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/196637">196637</a></dd>
<dt>Author</dt> <dd>matthew_hanson@apple.com</dd>
<dt>Date</dt> <dd>2016-02-16 09:59:54 -0800 (Tue, 16 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Fix for rdar://problem/24494562</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicsFontCacheh">branches/safari-601-branch/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp">branches/safari-601-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicsiosFontCacheIOSmm">branches/safari-601-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicsmacFontCacheMacmm">branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm</a></li>
<li><a href="#branchessafari601branchSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp">branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp</a></li>
<li><a href="#branchessafari601branchSourceWebCorerenderingRenderThemeIOSmm">branches/safari-601-branch/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="branchessafari601branchSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/FontCache.h (196636 => 196637)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/FontCache.h        2016-02-16 17:24:01 UTC (rev 196636)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/FontCache.h        2016-02-16 17:59:54 UTC (rev 196637)
</span><span class="lines">@@ -113,7 +113,8 @@
</span><span class="cx"> static std::array<unsigned, 2> makeFlagsKey(const FontDescription& description)
</span><span class="cx"> {
</span><span class="cx"> static_assert(USCRIPT_CODE_LIMIT < 0x1000, "Script code must fit in an unsigned along with the other flags");
</span><del>- unsigned first = static_cast<unsigned>(description.script()) << 8
</del><ins>+ unsigned first = static_cast<unsigned>(description.script()) << 10
+ | static_cast<unsigned>(description.textRenderingMode()) << 8
</ins><span class="cx"> | static_cast<unsigned>(description.fontSynthesis()) << 6
</span><span class="cx"> | static_cast<unsigned>(description.widthVariant()) << 4
</span><span class="cx"> | static_cast<unsigned>(description.nonCJKGlyphOrientation()) << 3
</span><span class="lines">@@ -243,7 +244,7 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(COCOA)
</span><del>-RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings&);
</del><ins>+RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef, TextRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings&);
</ins><span class="cx"> #endif
</span><span class="cx">
</span><span class="cx"> #if !PLATFORM(MAC)
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (196636 => 196637)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2016-02-16 17:24:01 UTC (rev 196636)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2016-02-16 17:59:54 UTC (rev 196637)
</span><span class="lines">@@ -361,9 +361,9 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef originalFont, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings& variantSettings)
</del><ins>+RetainPtr<CTFontRef> applyFontFeatureSettings(CTFontRef originalFont, TextRenderingMode textRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings& variantSettings)
</ins><span class="cx"> {
</span><del>- if (!originalFont || (!features.size() && variantSettings.isAllNormal()
</del><ins>+ if (!originalFont || (!features.size() && variantSettings.isAllNormal() && textRenderingMode == AutoTextRendering
</ins><span class="cx"> && (!fontFaceFeatures || !fontFaceFeatures->size()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal())))
</span><span class="cx"> return originalFont;
</span><span class="cx">
</span><span class="lines">@@ -386,7 +386,14 @@
</span><span class="cx"> for (auto& newFeature : computeFeatureSettingsFromVariants(variantSettings))
</span><span class="cx"> featuresToBeApplied.set(newFeature.key, newFeature.value);
</span><span class="cx">
</span><del>- // Step 5: Other properties
</del><ins>+ // Step 5: Other properties (text-rendering)
+ if (textRenderingMode == OptimizeSpeed) {
+ featuresToBeApplied.set(fontFeatureTag("liga"), 0);
+ featuresToBeApplied.set(fontFeatureTag("clig"), 0);
+ featuresToBeApplied.set(fontFeatureTag("dlig"), 0);
+ featuresToBeApplied.set(fontFeatureTag("hlig"), 0);
+ featuresToBeApplied.set(fontFeatureTag("calt"), 0);
+ }
</ins><span class="cx">
</span><span class="cx"> // Step 6: Font-feature-settings
</span><span class="cx"> for (auto& newFeature : features)
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicsiosFontCacheIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (196636 => 196637)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2016-02-16 17:24:01 UTC (rev 196636)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2016-02-16 17:59:54 UTC (rev 196637)
</span><span class="lines">@@ -85,7 +85,7 @@
</span><span class="cx"> if (!substituteFont)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- substituteFont = applyFontFeatureSettings(substituteFont.get(), nullptr, nullptr, description.featureSettings(), description.variantSettings());
</del><ins>+ substituteFont = applyFontFeatureSettings(substituteFont.get(), description.textRenderingMode(), nullptr, nullptr, description.featureSettings(), description.variantSettings());
</ins><span class="cx">
</span><span class="cx"> CTFontSymbolicTraits originalTraits = CTFontGetSymbolicTraits(ctFont);
</span><span class="cx"> CTFontSymbolicTraits actualTraits = 0;
</span><span class="lines">@@ -700,7 +700,7 @@
</span><span class="cx"> if (!ctFont)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- ctFont = applyFontFeatureSettings(ctFont.get(), nullptr, nullptr, fontDescription.featureSettings(), fontDescription.variantSettings());
</del><ins>+ ctFont = applyFontFeatureSettings(ctFont.get(), fontDescription.textRenderingMode(), nullptr, nullptr, fontDescription.featureSettings(), fontDescription.variantSettings());
</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="branchessafari601branchSourceWebCoreplatformgraphicsmacFontCacheMacmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (196636 => 196637)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2016-02-16 17:24:01 UTC (rev 196636)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2016-02-16 17:59:54 UTC (rev 196637)
</span><span class="lines">@@ -263,10 +263,10 @@
</span><span class="cx"> // Family name is somewhat of a misnomer here. We first attempt to find an exact match
</span><span class="cx"> // comparing the desiredFamily to the PostScript name of the installed fonts. If that fails
</span><span class="cx"> // we then do a search based on the family names of the installed fonts.
</span><del>-static NSFont *fontWithFamily(const AtomicString& family, NSFontTraitMask desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, float size)
</del><ins>+static NSFont *fontWithFamily(const AtomicString& family, NSFontTraitMask desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, TextRenderingMode textRenderingMode, float size)
</ins><span class="cx"> {
</span><span class="cx"> if (const auto& specialCase = fontWithFamilySpecialCase(family, weight, desiredTraits, size))
</span><del>- return (NSFont*)(applyFontFeatureSettings((CTFontRef)specialCase.value(), nullptr, nullptr, featureSettings, variantSettings).autorelease());
</del><ins>+ return (NSFont*)(applyFontFeatureSettings((CTFontRef)specialCase.value(), textRenderingMode, nullptr, nullptr, featureSettings, variantSettings).autorelease());
</ins><span class="cx">
</span><span class="cx"> NSFontManager *fontManager = [NSFontManager sharedFontManager];
</span><span class="cx"> NSString *availableFamily;
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx">
</span><span class="cx"> NSString *desiredFamily = family;
</span><span class="cx"> RetainPtr<CTFontRef> foundFont = adoptCF(CTFontCreateForCSS((CFStringRef)desiredFamily, toCoreTextFontWeight(weight), requestedTraits, size));
</span><del>- foundFont = applyFontFeatureSettings(foundFont.get(), nullptr, nullptr, featureSettings, variantSettings);
</del><ins>+ foundFont = applyFontFeatureSettings(foundFont.get(), textRenderingMode, nullptr, nullptr, featureSettings, variantSettings);
</ins><span class="cx"> if (!foundFont)
</span><span class="cx"> return nil;
</span><span class="cx"> font = CFBridgingRelease(CFRetain(foundFont.get()));
</span><span class="lines">@@ -379,7 +379,7 @@
</span><span class="cx"> return nil;
</span><span class="cx">
</span><span class="cx"> font = [NSFont fontWithName:chosenFullName size:size];
</span><del>- auto foundFont = applyFontFeatureSettings((CTFontRef)font, nullptr, nullptr, featureSettings, variantSettings);
</del><ins>+ auto foundFont = applyFontFeatureSettings((CTFontRef)font, textRenderingMode, nullptr, nullptr, featureSettings, variantSettings);
</ins><span class="cx"> font = CFBridgingRelease(CFRetain(foundFont.get()));
</span><span class="cx">
</span><span class="cx"> #endif
</span><span class="lines">@@ -514,7 +514,7 @@
</span><span class="cx"> const FontPlatformData& platformData = originalFontData->platformData();
</span><span class="cx"> NSFont *nsFont = platformData.nsFont();
</span><span class="cx"> RetainPtr<CTFontRef> result = lookupCTFont(platformData.font(), platformData.size(), characters, length);
</span><del>- result = applyFontFeatureSettings(result.get(), nullptr, nullptr, description.featureSettings(), description.variantSettings());
</del><ins>+ result = applyFontFeatureSettings(result.get(), description.textRenderingMode(), nullptr, nullptr, description.featureSettings(), description.variantSettings());
</ins><span class="cx"> if (!result)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><span class="lines">@@ -649,7 +649,7 @@
</span><span class="cx"> NSFontTraitMask traits = fontDescription.italic() ? NSFontItalicTrait : 0;
</span><span class="cx"> float size = fontDescription.computedPixelSize();
</span><span class="cx">
</span><del>- NSFont *nsFont = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), size);
</del><ins>+ NSFont *nsFont = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.textRenderingMode(), size);
</ins><span class="cx"> if (!nsFont) {
</span><span class="cx"> if (!shouldAutoActivateFontIfNeeded(family))
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -658,7 +658,7 @@
</span><span class="cx"> // Ignore the result because we want to use our own algorithm to actually find the font.
</span><span class="cx"> [NSFont fontWithName:family size:size];
</span><span class="cx">
</span><del>- nsFont = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), size);
</del><ins>+ nsFont = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.textRenderingMode(), size);
</ins><span class="cx"> if (!nsFont)
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (196636 => 196637)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2016-02-16 17:24:01 UTC (rev 196636)
+++ branches/safari-601-branch/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2016-02-16 17:59:54 UTC (rev 196637)
</span><span class="lines">@@ -41,7 +41,7 @@
</span><span class="cx"> FontWidthVariant widthVariant = fontDescription.widthVariant();
</span><span class="cx"> #if CORETEXT_WEB_FONTS
</span><span class="cx"> RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(m_fontDescriptor.get(), size, nullptr));
</span><del>- font = applyFontFeatureSettings(font.get(), &fontFaceFeatures, &fontFaceVariantSettings, fontDescription.featureSettings(), fontDescription.variantSettings());
</del><ins>+ font = applyFontFeatureSettings(font.get(), fontDescription.textRenderingMode(), &fontFaceFeatures, &fontFaceVariantSettings, fontDescription.featureSettings(), fontDescription.variantSettings());
</ins><span class="cx"> return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant);
</span><span class="cx"> #else
</span><span class="cx"> UNUSED_PARAM(fontFaceFeatures);
</span></span></pre></div>
<a id="branchessafari601branchSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: branches/safari-601-branch/Source/WebCore/rendering/RenderThemeIOS.mm (196636 => 196637)</h4>
<pre class="diff"><span>
<span class="info">--- branches/safari-601-branch/Source/WebCore/rendering/RenderThemeIOS.mm        2016-02-16 17:24:01 UTC (rev 196636)
+++ branches/safari-601-branch/Source/WebCore/rendering/RenderThemeIOS.mm        2016-02-16 17:59:54 UTC (rev 196637)
</span><span class="lines">@@ -1271,7 +1271,7 @@
</span><span class="cx">
</span><span class="cx"> ASSERT(fontDescriptor);
</span><span class="cx"> RetainPtr<CTFontRef> font = adoptCF(CTFontCreateWithFontDescriptor(fontDescriptor.get(), 0, nullptr));
</span><del>- font = applyFontFeatureSettings(font.get(), nullptr, nullptr, fontDescription.featureSettings(), fontDescription.variantSettings());
</del><ins>+ font = applyFontFeatureSettings(font.get(), fontDescription.textRenderingMode(), nullptr, nullptr, fontDescription.featureSettings(), fontDescription.variantSettings());
</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>