<!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>[196969] trunk</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/196969">196969</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2016-02-22 23:17:29 -0800 (Mon, 22 Feb 2016)</dd>
</dl>
<h3>Log Message</h3>
<pre>Font features specified in @font-face blocks don't apply to local() families
https://bugs.webkit.org/show_bug.cgi?id=154554
Reviewed by Dean Jackson.
Source/WebCore:
The correct variables just need to be wired up. In addition, our caches need to be sensitive
to the new data.
Test: css3/font-feature-font-face-local.html
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font):
* platform/graphics/FontCache.cpp:
(WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
(WebCore::FontPlatformDataCacheKey::operator==):
(WebCore::FontPlatformDataCacheKeyHash::hash):
(WebCore::FontCache::getCachedFontPlatformData):
(WebCore::FontCache::fontForFamily):
* platform/graphics/FontCache.h:
* platform/graphics/FontFeatureSettings.h:
(WebCore::FontFeature::operator!=):
(WebCore::FontFeatureSettings::operator!=):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::fontWithFamily):
(WebCore::FontCache::createFontPlatformData):
* platform/graphics/mac/ComplexTextControllerCoreText.mm:
(WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::lastResortFallbackFont):
* platform/text/TextFlags.h:
(WebCore::FontVariantSettings::operator==):
(WebCore::FontVariantSettings::operator!=):
(WebCore::FontVariantSettings::uniqueValue):
LayoutTests:
* css3/font-feature-font-face-local-expected.html: Added.
* css3/font-feature-font-face-local.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSourcecpp">trunk/Source/WebCore/css/CSSFontFaceSource.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCachecpp">trunk/Source/WebCore/platform/graphics/FontCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontFeatureSettingsh">trunk/Source/WebCore/platform/graphics/FontFeatureSettings.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp">trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm">trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm">trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontCacheMacmm">trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinFontCacheWincpp">trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextFlagsh">trunk/Source/WebCore/platform/text/TextFlags.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3fontfeaturefontfacelocalexpectedhtml">trunk/LayoutTests/css3/font-feature-font-face-local-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3fontfeaturefontfacelocalhtml">trunk/LayoutTests/css3/font-feature-font-face-local.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/LayoutTests/ChangeLog        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-02-22 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Font features specified in @font-face blocks don't apply to local() families
+ https://bugs.webkit.org/show_bug.cgi?id=154554
+
+ Reviewed by Dean Jackson.
+
+ * css3/font-feature-font-face-local-expected.html: Added.
+ * css3/font-feature-font-face-local.html: Added.
+
</ins><span class="cx"> 2016-02-22 Chris Dumez <cdumez@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r196563): Images not loading on https://klim.co.nz/blog/paypal-sans-design-information/
</span></span></pre></div>
<a id="trunkLayoutTestscss3fontfeaturefontfacelocalexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-feature-font-face-local-expected.html (0 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-feature-font-face-local-expected.html         (rev 0)
+++ trunk/LayoutTests/css3/font-feature-font-face-local-expected.html        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: HigaginoSans-fixed;
+ src: local("Hiragino Sans");
+ font-feature-settings: 'hwid','zero';
+}
+pre {
+ font-family: 'HigaginoSans-fixed';
+}
+</style>
+</head>
+<body>
+<pre><span style="font-feature-settings: 'hwid','zero';">12345678901234567890123456789012345678901234567890123456789012345678901234567890</span>
+<span style="font-feature-settings: 'zero';">1234567890123456789012345678901234567890</span>
+<span style="font-feature-settings: 'hwid','zero';">iiiiii
+WWWWWW</span>
+あいう</pre>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscss3fontfeaturefontfacelocalhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-feature-font-face-local.html (0 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-feature-font-face-local.html         (rev 0)
+++ trunk/LayoutTests/css3/font-feature-font-face-local.html        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -0,0 +1,22 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: HigaginoSans-fixed;
+ src: local("Hiragino Sans");
+ font-feature-settings: 'hwid','zero';
+}
+pre {
+ font-family: 'HigaginoSans-fixed';
+}
+</style>
+</head>
+<body>
+<pre>12345678901234567890123456789012345678901234567890123456789012345678901234567890
+1234567890123456789012345678901234567890
+iiiiii
+WWWWWW
+あいう</pre>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/ChangeLog        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -1,3 +1,39 @@
</span><ins>+2016-02-22 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Font features specified in @font-face blocks don't apply to local() families
+ https://bugs.webkit.org/show_bug.cgi?id=154554
+
+ Reviewed by Dean Jackson.
+
+ The correct variables just need to be wired up. In addition, our caches need to be sensitive
+ to the new data.
+
+ Test: css3/font-feature-font-face-local.html
+
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::font):
+ * platform/graphics/FontCache.cpp:
+ (WebCore::FontPlatformDataCacheKey::FontPlatformDataCacheKey):
+ (WebCore::FontPlatformDataCacheKey::operator==):
+ (WebCore::FontPlatformDataCacheKeyHash::hash):
+ (WebCore::FontCache::getCachedFontPlatformData):
+ (WebCore::FontCache::fontForFamily):
+ * platform/graphics/FontCache.h:
+ * platform/graphics/FontFeatureSettings.h:
+ (WebCore::FontFeature::operator!=):
+ (WebCore::FontFeatureSettings::operator!=):
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::fontWithFamily):
+ (WebCore::FontCache::createFontPlatformData):
+ * platform/graphics/mac/ComplexTextControllerCoreText.mm:
+ (WebCore::ComplexTextController::collectComplexTextRunsForCharacters):
+ * platform/graphics/mac/FontCacheMac.mm:
+ (WebCore::FontCache::lastResortFallbackFont):
+ * platform/text/TextFlags.h:
+ (WebCore::FontVariantSettings::operator==):
+ (WebCore::FontVariantSettings::operator!=):
+ (WebCore::FontVariantSettings::uniqueValue):
+
</ins><span class="cx"> 2016-02-22 Daniel Bates <dabates@apple.com>
</span><span class="cx">
</span><span class="cx"> REGRESSION (r196892): Crash in DocumentLoader::startLoadingMainResource()
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -137,7 +137,7 @@
</span><span class="cx"> if (!m_font && !fontFaceElement) {
</span><span class="cx"> // We're local. Just return a Font from the normal cache.
</span><span class="cx"> // We don't want to check alternate font family names here, so pass true as the checkingAlternateName parameter.
</span><del>- return FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, true);
</del><ins>+ return FontCache::singleton().fontForFamily(fontDescription, m_familyNameOrURI, &fontFaceFeatures, &fontFaceVariantSettings, true);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> if (m_font) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.cpp        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -100,9 +100,11 @@
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx"> FontPlatformDataCacheKey() { }
</span><del>- FontPlatformDataCacheKey(const AtomicString& family, const FontDescription& description)
</del><ins>+ FontPlatformDataCacheKey(const AtomicString& family, const FontDescription& description, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings)
</ins><span class="cx"> : m_fontDescriptionKey(description)
</span><span class="cx"> , m_family(family)
</span><ins>+ , m_fontFaceFeatures(fontFaceFeatures ? *fontFaceFeatures : FontFeatureSettings())
+ , m_fontFaceVariantSettings(fontFaceVariantSettings ? *fontFaceVariantSettings : FontVariantSettings())
</ins><span class="cx"> { }
</span><span class="cx">
</span><span class="cx"> explicit FontPlatformDataCacheKey(HashTableDeletedValueType t)
</span><span class="lines">@@ -113,7 +115,9 @@
</span><span class="cx">
</span><span class="cx"> bool operator==(const FontPlatformDataCacheKey& other) const
</span><span class="cx"> {
</span><del>- if (m_fontDescriptionKey != other.m_fontDescriptionKey)
</del><ins>+ if (m_fontDescriptionKey != other.m_fontDescriptionKey
+ || m_fontFaceFeatures != other.m_fontFaceFeatures
+ || m_fontFaceVariantSettings != other.m_fontFaceVariantSettings)
</ins><span class="cx"> return false;
</span><span class="cx"> if (m_family.impl() == other.m_family.impl())
</span><span class="cx"> return true;
</span><span class="lines">@@ -124,12 +128,19 @@
</span><span class="cx">
</span><span class="cx"> FontDescriptionKey m_fontDescriptionKey;
</span><span class="cx"> AtomicString m_family;
</span><ins>+ FontFeatureSettings m_fontFaceFeatures;
+ FontVariantSettings m_fontFaceVariantSettings;
</ins><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> struct FontPlatformDataCacheKeyHash {
</span><span class="cx"> static unsigned hash(const FontPlatformDataCacheKey& fontKey)
</span><span class="cx"> {
</span><del>- return pairIntHash(ASCIICaseInsensitiveHash::hash(fontKey.m_family), fontKey.m_fontDescriptionKey.computeHash());
</del><ins>+ IntegerHasher hasher;
+ hasher.add(ASCIICaseInsensitiveHash::hash(fontKey.m_family));
+ hasher.add(fontKey.m_fontDescriptionKey.computeHash());
+ hasher.add(fontKey.m_fontFaceFeatures.hash());
+ hasher.add(fontKey.m_fontFaceVariantSettings.uniqueValue());
+ return hasher.hash();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> static bool equal(const FontPlatformDataCacheKey& a, const FontPlatformDataCacheKey& b)
</span><span class="lines">@@ -207,9 +218,8 @@
</span><span class="cx"> return nullAtom;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription,
- const AtomicString& passedFamilyName,
- bool checkingAlternateName)
</del><ins>+FontPlatformData* FontCache::getCachedFontPlatformData(const FontDescription& fontDescription, const AtomicString& passedFamilyName,
+ const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, bool checkingAlternateName)
</ins><span class="cx"> {
</span><span class="cx"> #if PLATFORM(IOS)
</span><span class="cx"> FontLocker fontLocker;
</span><span class="lines">@@ -231,19 +241,19 @@
</span><span class="cx"> initialized = true;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- FontPlatformDataCacheKey key(familyName, fontDescription);
</del><ins>+ FontPlatformDataCacheKey key(familyName, fontDescription, fontFaceFeatures, fontFaceVariantSettings);
</ins><span class="cx">
</span><span class="cx"> auto addResult = fontPlatformDataCache().add(key, nullptr);
</span><span class="cx"> FontPlatformDataCache::iterator it = addResult.iterator;
</span><span class="cx"> if (addResult.isNewEntry) {
</span><del>- it->value = createFontPlatformData(fontDescription, familyName);
</del><ins>+ it->value = createFontPlatformData(fontDescription, familyName, fontFaceFeatures, fontFaceVariantSettings);
</ins><span class="cx">
</span><span class="cx"> if (!it->value && !checkingAlternateName) {
</span><span class="cx"> // We were unable to find a font. We have a small set of fonts that we alias to other names,
</span><span class="cx"> // e.g., Arial/Helvetica, Courier/Courier New, etc. Try looking up the font under the aliased name.
</span><span class="cx"> const AtomicString alternateName = alternateFamilyName(familyName);
</span><span class="cx"> if (!alternateName.isNull()) {
</span><del>- FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, true);
</del><ins>+ FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, fontFaceFeatures, fontFaceVariantSettings, true);
</ins><span class="cx"> // Lookup the key in the hash table again as the previous iterator may have
</span><span class="cx"> // been invalidated by the recursive call to getCachedFontPlatformData().
</span><span class="cx"> it = fontPlatformDataCache().find(key);
</span><span class="lines">@@ -364,12 +374,12 @@
</span><span class="cx"> const unsigned cMaxUnderMemoryPressureInactiveFontData = 50;
</span><span class="cx"> const unsigned cTargetUnderMemoryPressureInactiveFontData = 30;
</span><span class="cx">
</span><del>-RefPtr<Font> FontCache::fontForFamily(const FontDescription& fontDescription, const AtomicString& family, bool checkingAlternateName)
</del><ins>+RefPtr<Font> FontCache::fontForFamily(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, bool checkingAlternateName)
</ins><span class="cx"> {
</span><span class="cx"> if (!m_purgeTimer.isActive())
</span><span class="cx"> m_purgeTimer.startOneShot(std::chrono::milliseconds::zero());
</span><span class="cx">
</span><del>- FontPlatformData* platformData = getCachedFontPlatformData(fontDescription, family, checkingAlternateName);
</del><ins>+ FontPlatformData* platformData = getCachedFontPlatformData(fontDescription, family, fontFaceFeatures, fontFaceVariantSettings, checkingAlternateName);
</ins><span class="cx"> if (!platformData)
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -188,7 +188,7 @@
</span><span class="cx"> // It comes into play when you create an @font-face which shares a family name as a preinstalled font.
</span><span class="cx"> Vector<FontTraitsMask> getTraitsInFamily(const AtomicString&);
</span><span class="cx">
</span><del>- WEBCORE_EXPORT RefPtr<Font> fontForFamily(const FontDescription&, const AtomicString&, bool checkingAlternateName = false);
</del><ins>+ WEBCORE_EXPORT RefPtr<Font> fontForFamily(const FontDescription&, const AtomicString&, const FontFeatureSettings* fontFaceFeatures = nullptr, const FontVariantSettings* fontFaceVariantSettings = nullptr, bool checkingAlternateName = false);
</ins><span class="cx"> WEBCORE_EXPORT Ref<Font> lastResortFallbackFont(const FontDescription&);
</span><span class="cx"> WEBCORE_EXPORT Ref<Font> fontForPlatformData(const FontPlatformData&);
</span><span class="cx"> RefPtr<Font> similarFont(const FontDescription&, const AtomicString& family);
</span><span class="lines">@@ -220,13 +220,13 @@
</span><span class="cx"> WEBCORE_EXPORT void purgeInactiveFontDataIfNeeded();
</span><span class="cx">
</span><span class="cx"> // FIXME: This method should eventually be removed.
</span><del>- FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomicString& family, bool checkingAlternateName = false);
</del><ins>+ FontPlatformData* getCachedFontPlatformData(const FontDescription&, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures = nullptr, const FontVariantSettings* fontFaceVariantSettings = nullptr, bool checkingAlternateName = false);
</ins><span class="cx">
</span><span class="cx"> // These methods are implemented by each platform.
</span><span class="cx"> #if PLATFORM(COCOA)
</span><span class="cx"> FontPlatformData* getCustomFallbackFont(const UInt32, const FontDescription&);
</span><span class="cx"> #endif
</span><del>- std::unique_ptr<FontPlatformData> createFontPlatformData(const FontDescription&, const AtomicString& family);
</del><ins>+ std::unique_ptr<FontPlatformData> createFontPlatformData(const FontDescription&, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings);
</ins><span class="cx">
</span><span class="cx"> Timer m_purgeTimer;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontFeatureSettingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontFeatureSettings.h (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontFeatureSettings.h        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/FontFeatureSettings.h        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -60,6 +60,7 @@
</span><span class="cx"> FontFeature(FontFeatureTag&&, int value);
</span><span class="cx">
</span><span class="cx"> bool operator==(const FontFeature& other) const;
</span><ins>+ bool operator!=(const FontFeature& other) const { return !(*this == other); }
</ins><span class="cx"> bool operator<(const FontFeature& other) const;
</span><span class="cx">
</span><span class="cx"> const FontFeatureTag& tag() const { return m_tag; }
</span><span class="lines">@@ -75,6 +76,7 @@
</span><span class="cx"> public:
</span><span class="cx"> void insert(FontFeature&&);
</span><span class="cx"> bool operator==(const FontFeatureSettings& other) const { return m_list == other.m_list; }
</span><ins>+ bool operator!=(const FontFeatureSettings& other) const { return !(*this == other); }
</ins><span class="cx">
</span><span class="cx"> size_t size() const { return m_list.size(); }
</span><span class="cx"> const FontFeature& operator[](int index) const { return m_list[index]; }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -671,7 +671,7 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSymbolicTraits desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, const TextRenderingMode& textRenderingMode, float size)
</del><ins>+static RetainPtr<CTFontRef> fontWithFamily(const AtomicString& family, CTFontSymbolicTraits desiredTraits, FontWeight weight, const FontFeatureSettings& featureSettings, const FontVariantSettings& variantSettings, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const TextRenderingMode& textRenderingMode, float size)
</ins><span class="cx"> {
</span><span class="cx"> if (family.isEmpty())
</span><span class="cx"> return nullptr;
</span><span class="lines">@@ -684,7 +684,7 @@
</span><span class="cx"> foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
</span><span class="cx"> #endif
</span><span class="cx"> }
</span><del>- return preparePlatformFont(foundFont.get(), textRenderingMode, nullptr, nullptr, featureSettings, variantSettings);
</del><ins>+ return preparePlatformFont(foundFont.get(), textRenderingMode, fontFaceFeatures, fontFaceVariantSettings, featureSettings, variantSettings);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -719,12 +719,12 @@
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>-std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
</del><ins>+std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings)
</ins><span class="cx"> {
</span><span class="cx"> CTFontSymbolicTraits traits = computeTraits(fontDescription);
</span><span class="cx"> float size = fontDescription.computedPixelSize();
</span><span class="cx">
</span><del>- RetainPtr<CTFontRef> font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.textRenderingMode(), size);
</del><ins>+ RetainPtr<CTFontRef> font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
</ins><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="cx"> if (!font) {
</span><span class="lines">@@ -735,7 +735,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"> autoActivateFont(family.string(), size);
</span><span class="cx">
</span><del>- font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontDescription.textRenderingMode(), size);
</del><ins>+ font = fontWithFamily(family, traits, fontDescription.weight(), fontDescription.featureSettings(), fontDescription.variantSettings(), fontFaceFeatures, fontFaceVariantSettings, fontDescription.textRenderingMode(), size);
</ins><span class="cx"> }
</span><span class="cx"> #endif
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -134,7 +134,7 @@
</span><span class="cx"> // We want to return a fallback font here, otherwise the logic preventing FontConfig
</span><span class="cx"> // matches for non-fallback fonts might return 0. See isFallbackFontAllowed.
</span><span class="cx"> static AtomicString timesStr("serif");
</span><del>- return *fontForFamily(fontDescription, timesStr, false);
</del><ins>+ return *fontForFamily(fontDescription, timesStr);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> Vector<FontTraitsMask> FontCache::getTraitsInFamily(const AtomicString&)
</span><span class="lines">@@ -326,7 +326,7 @@
</span><span class="cx"> || equalLettersIgnoringASCIICase(familyNameString, "cursive");
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
</del><ins>+std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings*, const FontVariantSettings*)
</ins><span class="cx"> {
</span><span class="cx"> // The CSS font matching algorithm (http://www.w3.org/TR/css3-fonts/#font-matching-algorithm)
</span><span class="cx"> // says that we must find an exact match for font family, slant (italic or oblique can be used)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -120,7 +120,7 @@
</span><span class="cx">
</span><span class="cx"> Ref<Font> FontCache::lastResortFallbackFont(const FontDescription& fontDescription)
</span><span class="cx"> {
</span><del>- return *fontForFamily(fontDescription, AtomicString(".PhoneFallback", AtomicString::ConstructFromLiteral), false);
</del><ins>+ return *fontForFamily(fontDescription, AtomicString(".PhoneFallback", AtomicString::ConstructFromLiteral));
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> float FontCache::weightOfCTFont(CTFontRef font)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllerCoreTextmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextControllerCoreText.mm        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -286,7 +286,7 @@
</span><span class="cx"> continue;
</span><span class="cx"> }
</span><span class="cx"> auto& fontCache = FontCache::singleton();
</span><del>- runFont = fontCache.fontForFamily(m_font.fontDescription(), fontName.get(), false).get();
</del><ins>+ runFont = fontCache.fontForFamily(m_font.fontDescription(), fontName.get()).get();
</ins><span class="cx"> // Core Text may have used a font that our font lookup path cannot find. In that case, fall back on
</span><span class="cx"> // using the font as returned.
</span><span class="cx"> if (!runFont) {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontCacheMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -395,14 +395,14 @@
</span><span class="cx"> {
</span><span class="cx"> // FIXME: Would be even better to somehow get the user's default font here. For now we'll pick
</span><span class="cx"> // the default that the user would get without changing any prefs.
</span><del>- if (RefPtr<Font> font = fontForFamily(fontDescription, AtomicString("Times", AtomicString::ConstructFromLiteral), false))
</del><ins>+ if (RefPtr<Font> font = fontForFamily(fontDescription, AtomicString("Times", AtomicString::ConstructFromLiteral)))
</ins><span class="cx"> return *font;
</span><span class="cx">
</span><span class="cx"> // The Times fallback will almost always work, but in the highly unusual case where
</span><span class="cx"> // the user doesn't have it, we fall back on Lucida Grande because that's
</span><span class="cx"> // guaranteed to be there, according to Nathan Taylor. This is good enough
</span><span class="cx"> // to avoid a crash at least.
</span><del>- return *fontForFamily(fontDescription, AtomicString("Lucida Grande", AtomicString::ConstructFromLiteral), false);
</del><ins>+ return *fontForFamily(fontDescription, AtomicString("Lucida Grande", AtomicString::ConstructFromLiteral), nullptr, nullptr, false);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> } // namespace WebCore
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinFontCacheWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -560,7 +560,7 @@
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family)
</del><ins>+std::unique_ptr<FontPlatformData> FontCache::createFontPlatformData(const FontDescription& fontDescription, const AtomicString& family, const FontFeatureSettings*, const FontVariantSettings*)
</ins><span class="cx"> {
</span><span class="cx"> bool isLucidaGrande = equalLettersIgnoringASCIICase(family, "lucida grande");
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextFlagsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextFlags.h (196968 => 196969)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextFlags.h        2016-02-23 02:31:02 UTC (rev 196968)
+++ trunk/Source/WebCore/platform/text/TextFlags.h        2016-02-23 07:17:29 UTC (rev 196969)
</span><span class="lines">@@ -212,7 +212,7 @@
</span><span class="cx"> && eastAsianRuby == FontVariantEastAsianRuby::Normal;
</span><span class="cx"> }
</span><span class="cx">
</span><del>- bool operator==(const FontVariantSettings& other)
</del><ins>+ bool operator==(const FontVariantSettings& other) const
</ins><span class="cx"> {
</span><span class="cx"> return commonLigatures == other.commonLigatures
</span><span class="cx"> && discretionaryLigatures == other.discretionaryLigatures
</span><span class="lines">@@ -231,6 +231,27 @@
</span><span class="cx"> && eastAsianRuby == other.eastAsianRuby;
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ bool operator!=(const FontVariantSettings& other) const { return !(*this == other); }
+
+ unsigned uniqueValue() const
+ {
+ return static_cast<unsigned>(commonLigatures) << 26
+ | static_cast<unsigned>(discretionaryLigatures) << 24
+ | static_cast<unsigned>(historicalLigatures) << 22
+ | static_cast<unsigned>(contextualAlternates) << 20
+ | static_cast<unsigned>(position) << 18
+ | static_cast<unsigned>(caps) << 15
+ | static_cast<unsigned>(numericFigure) << 13
+ | static_cast<unsigned>(numericSpacing) << 11
+ | static_cast<unsigned>(numericFraction) << 9
+ | static_cast<unsigned>(numericOrdinal) << 8
+ | static_cast<unsigned>(numericSlashedZero) << 7
+ | static_cast<unsigned>(alternates) << 6
+ | static_cast<unsigned>(eastAsianVariant) << 3
+ | static_cast<unsigned>(eastAsianWidth) << 1
+ | static_cast<unsigned>(eastAsianRuby) << 0;
+ }
+
</ins><span class="cx"> FontVariantLigatures commonLigatures;
</span><span class="cx"> FontVariantLigatures discretionaryLigatures;
</span><span class="cx"> FontVariantLigatures historicalLigatures;
</span></span></pre>
</div>
</div>
</body>
</html>