<!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>[191968] 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/191968">191968</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2015-11-03 12:31:33 -0800 (Tue, 03 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>font-variant-* properties in @font-face declarations should be honored
https://bugs.webkit.org/show_bug.cgi?id=149771
Reviewed by Simon Fraser.
Source/WebCore:
According to the CSS Fonts Level 3 spec, web authors are allowed to put
font-feature-settings / font-variant-* inside @font-face blocks. These
properties are supposed to be applied at a specific time during the
font selection algorithm.
This patch gives a FontFeatureSettings object and a FontVariantSettings
object to CSSFontFace, and moves common parsing logic from
StyleBuilderCustom to a shared location. Then, once the two properties
are parsed from the @font-face block, the relevant data structures are
passed down into the font selection algorithm. This algorithm then
consults with these values at the correct time (inside
preparePlatformFont()).
Tests: css3/font-feature-settings-font-face-rendering.html
css3/font-variant-font-face-all.html
css3/font-variant-font-face-override.html
* WebCore.xcodeproj/project.pbxproj: Add a header for the common
location of parsing font-variant-ligatures, font-variant-numeric,
and font-variant-east-asian.
* css/CSSFontFace.cpp:
(WebCore::CSSFontFace::font): Pass the relevant data structures
into the font selection algorithm.
* css/CSSFontFace.h: Add FontFeatureSettings and FontVariantSettings
member variables.
(WebCore::CSSFontFace::insertFeature):
(WebCore::CSSFontFace::setVariantCommonLigatures):
(WebCore::CSSFontFace::setVariantDiscretionaryLigatures):
(WebCore::CSSFontFace::setVariantHistoricalLigatures):
(WebCore::CSSFontFace::setVariantContextualAlternates):
(WebCore::CSSFontFace::setVariantPosition):
(WebCore::CSSFontFace::setVariantCaps):
(WebCore::CSSFontFace::setVariantNumericFigure):
(WebCore::CSSFontFace::setVariantNumericSpacing):
(WebCore::CSSFontFace::setVariantNumericFraction):
(WebCore::CSSFontFace::setVariantNumericOrdinal):
(WebCore::CSSFontFace::setVariantNumericSlashedZero):
(WebCore::CSSFontFace::setVariantAlternates):
(WebCore::CSSFontFace::setVariantEastAsianVariant):
(WebCore::CSSFontFace::setVariantEastAsianWidth):
(WebCore::CSSFontFace::setVariantEastAsianRuby):
* css/CSSFontFaceSource.cpp:
(WebCore::CSSFontFaceSource::font): Pass the relevant data
structures into the font selection algorithm.
* css/CSSFontFaceSource.h: Ditto.
* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule): Call the shared
parsing logic to populate the FontFeatureSettings and
FontVariantSettings members.
* css/FontVariantBuilder.h: Added. Destination for shared parsing
logic.
(WebCore::applyValueFontVariantLigatures):
(WebCore::applyValueFontVariantNumeric):
(WebCore::applyValueFontVariantEastAsian):
* css/StyleBuilderCustom.h: Source for shared parsing logic.
(WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
(WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
(WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
* loader/cache/CachedFont.cpp: Pass the relevant data structures
into the font selection algorithm.
(WebCore::CachedFont::createFont):
(WebCore::CachedFont::platformDataFromCustomData):
* loader/cache/CachedFont.h: Ditto.
* loader/cache/CachedSVGFont.cpp: Ditto.
(WebCore::CachedSVGFont::createFont):
(WebCore::CachedSVGFont::platformDataFromCustomData):
* loader/cache/CachedSVGFont.h: Ditto.
* platform/graphics/FontCache.h: Ditto.
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::codePath): Adjust comment.
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::preparePlatformFont): Consult with the newly parsed values.
(WebCore::fontWithFamily): Pass the relevant data structures into the
font selection algorithm.
(WebCore::FontCache::systemFallbackForCharacters): Ditto.
* platform/graphics/mac/FontCustomPlatformData.cpp:
(WebCore::FontCustomPlatformData::fontPlatformData): Ditto.
* platform/graphics/mac/FontCustomPlatformData.h: Ditto.
LayoutTests:
* css3/font-variant-font-face-override-expected.html: Added
* css3/font-variant-font-face-override.html: Added
* css3/font-feature-settings-font-face-rendering-expected.html: Added.
* css3/font-feature-settings-font-face-rendering.html: Added.
* css3/font-variant-font-face-all-expected.html: Added.
* css3/font-variant-font-face-all.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFacecpp">trunk/Source/WebCore/css/CSSFontFace.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceh">trunk/Source/WebCore/css/CSSFontFace.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSourcecpp">trunk/Source/WebCore/css/CSSFontFaceSource.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFaceSourceh">trunk/Source/WebCore/css/CSSFontFaceSource.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontSelectorcpp">trunk/Source/WebCore/css/CSSFontSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedFontcpp">trunk/Source/WebCore/loader/cache/CachedFont.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedFonth">trunk/Source/WebCore/loader/cache/CachedFont.h</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedSVGFontcpp">trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp</a></li>
<li><a href="#trunkSourceWebCoreloadercacheCachedSVGFonth">trunk/Source/WebCore/loader/cache/CachedSVGFont.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadecpp">trunk/Source/WebCore/platform/graphics/FontCascade.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp">trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp">trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontCustomPlatformDatah">trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextFlagsh">trunk/Source/WebCore/platform/text/TextFlags.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderThemeIOSmm">trunk/Source/WebCore/rendering/RenderThemeIOS.mm</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestscss3fontfeaturesettingsfontfacerenderingexpectedhtml">trunk/LayoutTests/css3/font-feature-settings-font-face-rendering-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3fontfeaturesettingsfontfacerenderinghtml">trunk/LayoutTests/css3/font-feature-settings-font-face-rendering.html</a></li>
<li><a href="#trunkLayoutTestscss3fontvariantfontfaceallexpectedhtml">trunk/LayoutTests/css3/font-variant-font-face-all-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3fontvariantfontfaceallhtml">trunk/LayoutTests/css3/font-variant-font-face-all.html</a></li>
<li><a href="#trunkLayoutTestscss3fontvariantfontfaceoverrideexpectedhtml">trunk/LayoutTests/css3/font-variant-font-face-override-expected.html</a></li>
<li><a href="#trunkLayoutTestscss3fontvariantfontfaceoverridehtml">trunk/LayoutTests/css3/font-variant-font-face-override.html</a></li>
<li><a href="#trunkSourceWebCorecssFontVariantBuilderh">trunk/Source/WebCore/css/FontVariantBuilder.h</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/LayoutTests/ChangeLog        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -1,3 +1,17 @@
</span><ins>+2015-11-03 Myles C. Maxfield <mmaxfield@apple.com>
+
+ font-variant-* properties in @font-face declarations should be honored
+ https://bugs.webkit.org/show_bug.cgi?id=149771
+
+ Reviewed by Simon Fraser.
+
+ * css3/font-variant-font-face-override-expected.html: Added
+ * css3/font-variant-font-face-override.html: Added
+ * css3/font-feature-settings-font-face-rendering-expected.html: Added.
+ * css3/font-feature-settings-font-face-rendering.html: Added.
+ * css3/font-variant-font-face-all-expected.html: Added.
+ * css3/font-variant-font-face-all.html: Added.
+
</ins><span class="cx"> 2015-11-03 Keith Rollin <krollin@apple.com>
</span><span class="cx">
</span><span class="cx"> HTMLOptionElement.text should never return the value of label
</span></span></pre></div>
<a id="trunkLayoutTestscss3fontfeaturesettingsfontfacerenderingexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-feature-settings-font-face-rendering-expected.html (0 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-feature-settings-font-face-rendering-expected.html         (rev 0)
+++ trunk/LayoutTests/css3/font-feature-settings-font-face-rendering-expected.html        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -0,0 +1,85 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "FontFeaturesTestOTF";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+@font-face {
+ font-family: "FontFeaturesTestTTF";
+ src: url("resources/FontWithFeatures.ttf") format("truetype");
+}
+</style>
+</head>
+<body>
+This tests that font features are able to be turned on and off as desired. It uses a special font
+designed specifically for this purpose. The test passes if you see a sequence of alternating check
+marks and X below.
+<div><span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestOTF;">BBAA</span>
+</div>
+<div><span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+<span style="font-family: FontFeaturesTestTTF;">BBAA</span>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscss3fontfeaturesettingsfontfacerenderinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-feature-settings-font-face-rendering.html (0 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-feature-settings-font-face-rendering.html         (rev 0)
+++ trunk/LayoutTests/css3/font-feature-settings-font-face-rendering.html        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -0,0 +1,106 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "FontFeaturesTestOTF";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+@font-face {
+ font-family: "FontFeaturesTestTTF";
+ src: url("resources/FontWithFeatures.ttf") format("truetype");
+}
+</style>
+</head>
+<body>
+This tests that font features are able to be turned on and off as desired. It uses a special font
+designed specifically for this purpose. The test passes if you see a sequence of alternating check
+marks and X below.
+<div id="insertionPoint"></div>
+<div id="insertionPoint2"></div>
+<script>
+var insertionPoint = document.getElementById("insertionPoint");
+var insertionPoint2 = document.getElementById("insertionPoint2");
+
+var styleNode = document.createElement("style");
+document.head.appendChild(styleNode);
+
+function addElement(placeToInsert, familyName, extension, format, feature, c) {
+ ["0", "1"].map(function(state) {
+ styleNode.sheet.insertRule("@font-face { font-family: " + familyName + "_" + feature + "_" + state + "; src: url('resources/FontWithFeatures." + extension + "') format('" + format + "'); font-feature-settings: '" + feature + "'" + state + "; }", 0);
+ var element = document.createElement("span");
+ element.textContent = c + c;
+ element.style.fontFamily = familyName + "_" + feature + "_" + state;
+ placeToInsert.appendChild(element);
+ });
+ placeToInsert.appendChild(document.createTextNode(" "));
+}
+
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "liga", "C");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "clig", "D");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "dlig", "E");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "hlig", "F");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "calt", "G");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "subs", "H");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "sups", "I");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "smcp", "J");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "c2sc", "K");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "pcap", "L");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "c2pc", "M");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "unic", "N");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "titl", "O");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "lnum", "P");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "onum", "Q");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "pnum", "R");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "tnum", "S");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "frac", "T");
+//addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "afrc", "U");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "ordn", "V");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "zero", "W");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "hist", "X");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "jp78", "Y");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "jp83", "Z");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "jp90", "a");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "jp04", "b");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "smpl", "c");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "trad", "d");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "fwid", "e");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "pwid", "f");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "ruby", "g");
+
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "liga", "C");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "liga", "D");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "clig", "C");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "clig", "D");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "dlig", "G");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "hlig", "I");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "calt", "L");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "subs", "O");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "sups", "P");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "smcp", "S");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "c2sc", "V");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "pcap", "T");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "c2pc", "W");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "unic", "Y");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "titl", "a");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "lnum", "c");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "onum", "d");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "pnum", "f");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "tnum", "g");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "frac", "i");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "afrc", "j");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "ordn", "Q");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "zero", "k");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "hist", "K");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "jp78", "m");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "jp83", "n");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "jp90", "o");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "jp04", "p");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "smpl", "q");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "trad", "r");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "fwid", "t");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "pwid", "u");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "ruby", "v");
+</script>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscss3fontvariantfontfaceallexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-variant-font-face-all-expected.html (0 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-variant-font-face-all-expected.html         (rev 0)
+++ trunk/LayoutTests/css3/font-variant-font-face-all-expected.html        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -0,0 +1,99 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "FontFeaturesTestOTF";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+@font-face {
+ font-family: "FontFeaturesTestTTF";
+ src: url("resources/FontWithFeatures.ttf") format("truetype");
+}
+.fontWithFeaturesTTF {
+ font-family: "FontWithFeaturesTTF";
+}
+</style>
+</head>
+<body>
+<p>This test is a dump-render-tree test which makes sure that the following properties are appropriately applied:</p>
+<ul>
+<li>-webkit-font-variant-ligatures</li>
+<li>-webkit-font-variant-position</li>
+<li>-webkit-font-variant-caps</li>
+<li>-webkit-font-variant-numeric</li>
+<li>-webkit-font-variant-alternates</li>
+<li>-webkit-font-variant-east-asian</li>
+</ul>
+The test passes if there is a particular sequence of checks and x characters below. Note that some x characters are expected.
+<div id="insertionpoint"><span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+</div>
+<div id="insertionPoint2"><span style="font-family: FontFeaturesTestTTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">BB</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+<span style="font-family: FontFeaturesTestOTF;">AA</span>
+</div>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscss3fontvariantfontfaceallhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-variant-font-face-all.html (0 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-variant-font-face-all.html         (rev 0)
+++ trunk/LayoutTests/css3/font-variant-font-face-all.html        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -0,0 +1,105 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+</head>
+<body>
+<p>This test is a dump-render-tree test which makes sure that the following properties are appropriately applied:</p>
+<ul>
+<li>-webkit-font-variant-ligatures</li>
+<li>-webkit-font-variant-position</li>
+<li>-webkit-font-variant-caps</li>
+<li>-webkit-font-variant-numeric</li>
+<li>-webkit-font-variant-alternates</li>
+<li>-webkit-font-variant-east-asian</li>
+</ul>
+The test passes if there is a particular sequence of checks and x characters below. Note that some x characters are expected.
+<div id="insertionPoint"></div>
+<div id="insertionPoint2"></div>
+<script>
+var insertionPoint = document.getElementById("insertionPoint");
+var insertionPoint2 = document.getElementById("insertionPoint2");
+
+var styleNode = document.createElement("style");
+document.head.appendChild(styleNode);
+
+function addElement(pointToInsert, fontFamily, extension, format, property, value, text) {
+ styleNode.sheet.insertRule("@font-face { font-family: " + fontFamily + "_" + property + "_" + value + "; src: url('resources/FontWithFeatures." + extension + "') format('" + format + "'); " + property + ": " + value + "; }", 0);
+ var element = document.createElement("span");
+ element.textContent = text + text;
+ element.style.fontFamily = fontFamily + "_" + property + "_" + value;
+ pointToInsert.appendChild(element);
+ pointToInsert.appendChild(document.createTextNode(" "));
+}
+
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "common-ligatures", "C");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-common-ligatures", "C");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "discretionary-ligatures", "E");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-discretionary-ligatures", "E");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "historical-ligatures", "F");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-historical-ligatures", "F");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "contextual", "G");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-ligatures", "no-contextual", "G");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-position", "sub", "H");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-position", "super", "I");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "small-caps", "J");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "all-small-caps", "J");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "petite-caps", "L");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "all-petite-caps", "L");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "unicase", "N");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-caps", "titling-caps", "O");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "lining-nums", "P");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "oldstyle-nums", "Q");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "proportional-nums", "R");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "tabular-nums", "S");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "diagonal-fractions", "T");
+//addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "stacked-fractions", "U");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "ordinal", "V");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-numeric", "slashed-zero", "W");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-alternates", "historical-forms", "X");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis78", "Y");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis83", "Z");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis90", "a");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "jis04", "b");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "simplified", "c");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "traditional", "d");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "full-width", "e");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "proportional-width", "f");
+addElement(insertionPoint, "FontFeaturesTestOTF", "otf", "opentype", "font-variant-east-asian", "ruby", "g");
+
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "common-ligatures", "C");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-common-ligatures", "C");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "discretionary-ligatures", "G");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-discretionary-ligatures", "G");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "historical-ligatures", "I");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-historical-ligatures", "I");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "contextual", "L");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-ligatures", "no-contextual", "L");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-position", "sub", "O");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-position", "super", "P");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "small-caps", "S");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "all-small-caps", "S");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "petite-caps", "T");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "all-petite-caps", "T");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "unicase", "Y");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-caps", "titling-caps", "a");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "lining-nums", "c");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "oldstyle-nums", "d");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "proportional-nums", "f");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "tabular-nums", "g");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "diagonal-fractions", "i");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "stacked-fractions", "j");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "ordinal", "Q");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-numeric", "slashed-zero", "k");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-alternates", "historical-forms", "K");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis78", "m");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis83", "n");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis90", "o");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "jis04", "p");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "simplified", "q");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "traditional", "r");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "full-width", "t");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "proportional-width", "u");
+addElement(insertionPoint2, "FontFeaturesTestTTF", "ttf", "truetype", "font-variant-east-asian", "ruby", "v");
+</script>
+</body>
+</html>
</ins></span></pre></div>
<a id="trunkLayoutTestscss3fontvariantfontfaceoverrideexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-variant-font-face-override-expected.html (0 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-variant-font-face-override-expected.html         (rev 0)
+++ trunk/LayoutTests/css3/font-variant-font-face-override-expected.html        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -0,0 +1,26 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "FontFeaturesTestOTF";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+}
+@font-face {
+ font-family: "FontFeaturesTestTTF";
+ src: url("resources/FontWithFeatures.ttf") format("truetype");
+}
+</style>
+</head>
+<body>
+This test makes sure that local font feature styles can override the font feature styles declared in @font-face blocks.
+<div style="font: 40px FontFeaturesTestOTF;">AA</div>
+<div style="font: 40px FontFeaturesTestOTF;">BB</div>
+<div style="font: 40px FontFeaturesTestOTF;">AA</div>
+<div style="font: 40px FontFeaturesTestOTF;">BB</div>
+<div style="font: 40px FontFeaturesTestTTF;">AA</div>
+<div style="font: 40px FontFeaturesTestTTF;">BB</div>
+<div style="font: 40px FontFeaturesTestTTF;">AA</div>
+<div style="font: 40px FontFeaturesTestTTF;">BB</div>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestscss3fontvariantfontfaceoverridehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/css3/font-variant-font-face-override.html (0 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/css3/font-variant-font-face-override.html         (rev 0)
+++ trunk/LayoutTests/css3/font-variant-font-face-override.html        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -0,0 +1,38 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "FontFeaturesTestOTF";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+ font-feature-settings: "titl" 1;
+}
+@font-face {
+ font-family: "FontFeaturesTestOTF2";
+ src: url("resources/FontWithFeatures.otf") format("opentype");
+ font-variant-caps: titling-caps;
+}
+@font-face {
+ font-family: "FontFeaturesTestTTF";
+ src: url("resources/FontWithFeatures.ttf") format("truetype");
+ font-feature-settings: "titl" 1;
+}
+@font-face {
+ font-family: "FontFeaturesTestTTF2";
+ src: url("resources/FontWithFeatures.ttf") format("truetype");
+ font-variant-caps: titling-caps;
+}
+</style>
+</head>
+<body>
+This test makes sure that local font feature styles can override the font feature styles declared in @font-face blocks.
+<div style="font: 40px FontFeaturesTestOTF;">OO</div>
+<div style="font: 40px FontFeaturesTestOTF; font-feature-settings: 'titl' 0;">OO</div>
+<div style="font: 40px FontFeaturesTestOTF2;">OO</div>
+<div style="font: 40px FontFeaturesTestOTF2; font-feature-settings: 'titl' 0;">OO</div>
+<div style="font: 40px FontFeaturesTestTTF;">aa</div>
+<div style="font: 40px FontFeaturesTestTTF; font-feature-settings: 'titl' 0;">aa</div>
+<div style="font: 40px FontFeaturesTestTTF2;">aa</div>
+<div style="font: 40px FontFeaturesTestTTF2; font-feature-settings: 'titl' 0;">aa</div>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -261,6 +261,9 @@
</span><span class="cx"> # Font features are not implemented on Mavericks.
</span><span class="cx"> webkit.org/b/149246 [ Mavericks ] css3/font-feature-settings-rendering.html [ ImageOnlyFailure ]
</span><span class="cx"> webkit.org/b/149246 [ Mavericks ] css3/font-variant-all.html [ ImageOnlyFailure ]
</span><ins>+webkit.org/b/149246 [ Mavericks ] css3/font-feature-settings-font-face-rendering.html [ ImageOnlyFailure ]
+webkit.org/b/149246 [ Mavericks ] css3/font-variant-font-face-all.html [ ImageOnlyFailure ]
+webkit.org/b/149246 [ Mavericks ] css3/font-variant-font-face-override.html [ ImageOnlyFailure ]
</ins><span class="cx">
</span><span class="cx"> # This feature is disabled on Mavericks.
</span><span class="cx"> [ Mavericks ] http/tests/navigation/page-cache-pending-image-load.html [ Skip ]
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/ChangeLog        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -1,3 +1,89 @@
</span><ins>+2015-11-03 Myles C. Maxfield <mmaxfield@apple.com>
+
+ font-variant-* properties in @font-face declarations should be honored
+ https://bugs.webkit.org/show_bug.cgi?id=149771
+
+ Reviewed by Simon Fraser.
+
+ According to the CSS Fonts Level 3 spec, web authors are allowed to put
+ font-feature-settings / font-variant-* inside @font-face blocks. These
+ properties are supposed to be applied at a specific time during the
+ font selection algorithm.
+
+ This patch gives a FontFeatureSettings object and a FontVariantSettings
+ object to CSSFontFace, and moves common parsing logic from
+ StyleBuilderCustom to a shared location. Then, once the two properties
+ are parsed from the @font-face block, the relevant data structures are
+ passed down into the font selection algorithm. This algorithm then
+ consults with these values at the correct time (inside
+ preparePlatformFont()).
+
+ Tests: css3/font-feature-settings-font-face-rendering.html
+ css3/font-variant-font-face-all.html
+ css3/font-variant-font-face-override.html
+
+ * WebCore.xcodeproj/project.pbxproj: Add a header for the common
+ location of parsing font-variant-ligatures, font-variant-numeric,
+ and font-variant-east-asian.
+ * css/CSSFontFace.cpp:
+ (WebCore::CSSFontFace::font): Pass the relevant data structures
+ into the font selection algorithm.
+ * css/CSSFontFace.h: Add FontFeatureSettings and FontVariantSettings
+ member variables.
+ (WebCore::CSSFontFace::insertFeature):
+ (WebCore::CSSFontFace::setVariantCommonLigatures):
+ (WebCore::CSSFontFace::setVariantDiscretionaryLigatures):
+ (WebCore::CSSFontFace::setVariantHistoricalLigatures):
+ (WebCore::CSSFontFace::setVariantContextualAlternates):
+ (WebCore::CSSFontFace::setVariantPosition):
+ (WebCore::CSSFontFace::setVariantCaps):
+ (WebCore::CSSFontFace::setVariantNumericFigure):
+ (WebCore::CSSFontFace::setVariantNumericSpacing):
+ (WebCore::CSSFontFace::setVariantNumericFraction):
+ (WebCore::CSSFontFace::setVariantNumericOrdinal):
+ (WebCore::CSSFontFace::setVariantNumericSlashedZero):
+ (WebCore::CSSFontFace::setVariantAlternates):
+ (WebCore::CSSFontFace::setVariantEastAsianVariant):
+ (WebCore::CSSFontFace::setVariantEastAsianWidth):
+ (WebCore::CSSFontFace::setVariantEastAsianRuby):
+ * css/CSSFontFaceSource.cpp:
+ (WebCore::CSSFontFaceSource::font): Pass the relevant data
+ structures into the font selection algorithm.
+ * css/CSSFontFaceSource.h: Ditto.
+ * css/CSSFontSelector.cpp:
+ (WebCore::CSSFontSelector::addFontFaceRule): Call the shared
+ parsing logic to populate the FontFeatureSettings and
+ FontVariantSettings members.
+ * css/FontVariantBuilder.h: Added. Destination for shared parsing
+ logic.
+ (WebCore::applyValueFontVariantLigatures):
+ (WebCore::applyValueFontVariantNumeric):
+ (WebCore::applyValueFontVariantEastAsian):
+ * css/StyleBuilderCustom.h: Source for shared parsing logic.
+ (WebCore::StyleBuilderCustom::applyValueFontVariantLigatures):
+ (WebCore::StyleBuilderCustom::applyValueFontVariantNumeric):
+ (WebCore::StyleBuilderCustom::applyValueFontVariantEastAsian):
+ * loader/cache/CachedFont.cpp: Pass the relevant data structures
+ into the font selection algorithm.
+ (WebCore::CachedFont::createFont):
+ (WebCore::CachedFont::platformDataFromCustomData):
+ * loader/cache/CachedFont.h: Ditto.
+ * loader/cache/CachedSVGFont.cpp: Ditto.
+ (WebCore::CachedSVGFont::createFont):
+ (WebCore::CachedSVGFont::platformDataFromCustomData):
+ * loader/cache/CachedSVGFont.h: Ditto.
+ * platform/graphics/FontCache.h: Ditto.
+ * platform/graphics/FontCascade.cpp:
+ (WebCore::FontCascade::codePath): Adjust comment.
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::preparePlatformFont): Consult with the newly parsed values.
+ (WebCore::fontWithFamily): Pass the relevant data structures into the
+ font selection algorithm.
+ (WebCore::FontCache::systemFallbackForCharacters): Ditto.
+ * platform/graphics/mac/FontCustomPlatformData.cpp:
+ (WebCore::FontCustomPlatformData::fontPlatformData): Ditto.
+ * platform/graphics/mac/FontCustomPlatformData.h: Ditto.
+
</ins><span class="cx"> 2015-11-03 Joseph Pecoraro <pecoraro@apple.com>
</span><span class="cx">
</span><span class="cx"> Web Inspector: Handle or Remove ParseHTML Timeline Event Records
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -5792,6 +5792,7 @@
</span><span class="cx">                 C0F2A44113869AAB0066C534 /* preprocessor.pm in Headers */ = {isa = PBXBuildFile; fileRef = C0F2A43F13869A280066C534 /* preprocessor.pm */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C105DA620F3AA68F001DD44F /* TextEncodingDetectorICU.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */; };
</span><span class="cx">                 C105DA640F3AA6B8001DD44F /* TextEncodingDetector.h in Headers */ = {isa = PBXBuildFile; fileRef = C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */; };
</span><ins>+                C2015C0A1BE6FEB200822389 /* FontVariantBuilder.h in Headers */ = {isa = PBXBuildFile; fileRef = C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */; };
</ins><span class="cx">                 C330A22313EC196B0000B45B /* ColorChooser.h in Headers */ = {isa = PBXBuildFile; fileRef = C330A22113EC196B0000B45B /* ColorChooser.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C33EE5C414FB49610002095A /* BaseClickableWithKeyInputType.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C33EE5C214FB49610002095A /* BaseClickableWithKeyInputType.cpp */; };
</span><span class="cx">                 C33EE5C514FB49610002095A /* BaseClickableWithKeyInputType.h in Headers */ = {isa = PBXBuildFile; fileRef = C33EE5C314FB49610002095A /* BaseClickableWithKeyInputType.h */; };
</span><span class="lines">@@ -13558,6 +13559,7 @@
</span><span class="cx">                 C0F2A43F13869A280066C534 /* preprocessor.pm */ = {isa = PBXFileReference; lastKnownFileType = text.script.perl; name = preprocessor.pm; path = scripts/preprocessor.pm; sourceTree = "<group>"; };
</span><span class="cx">                 C105DA610F3AA68F001DD44F /* TextEncodingDetectorICU.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = TextEncodingDetectorICU.cpp; sourceTree = "<group>"; };
</span><span class="cx">                 C105DA630F3AA6B8001DD44F /* TextEncodingDetector.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextEncodingDetector.h; sourceTree = "<group>"; };
</span><ins>+                C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */ = {isa = PBXFileReference; lastKnownFileType = sourcecode.c.h; path = FontVariantBuilder.h; sourceTree = "<group>"; };
</ins><span class="cx">                 C24685131A148E1800811792 /* CoreGraphicsSPI.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CoreGraphicsSPI.h; sourceTree = "<group>"; };
</span><span class="cx">                 C2C4CB1D161A131200D214DA /* WebSafeIncrementalSweeperIOS.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = WebSafeIncrementalSweeperIOS.h; sourceTree = "<group>"; };
</span><span class="cx">                 C330A22113EC196B0000B45B /* ColorChooser.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ColorChooser.h; sourceTree = "<group>"; };
</span><span class="lines">@@ -23303,6 +23305,7 @@
</span><span class="cx">                                 3FFFF9A6159D9A550020BBD5 /* WebKitCSSViewportRule.cpp */,
</span><span class="cx">                                 3FFFF9A7159D9A550020BBD5 /* WebKitCSSViewportRule.h */,
</span><span class="cx">                                 3F2B33E3165ABD3500E3987C /* WebKitCSSViewportRule.idl */,
</span><ins>+                                C2015C091BE6FE2C00822389 /* FontVariantBuilder.h */,
</ins><span class="cx">                         );
</span><span class="cx">                         path = css;
</span><span class="cx">                         sourceTree = "<group>";
</span><span class="lines">@@ -25283,6 +25286,7 @@
</span><span class="cx">                                 8AD0A59814C88358000D83C5 /* DOMWebKitCSSRegionRuleInternal.h in Headers */,
</span><span class="cx">                                 31611E610E1C4E1400F6A579 /* DOMWebKitCSSTransformValue.h in Headers */,
</span><span class="cx">                                 31611E630E1C4E1400F6A579 /* DOMWebKitCSSTransformValueInternal.h in Headers */,
</span><ins>+                                C2015C0A1BE6FEB200822389 /* FontVariantBuilder.h in Headers */,
</ins><span class="cx">                                 3F2B33EB165AF15600E3987C /* DOMWebKitCSSViewportRule.h in Headers */,
</span><span class="cx">                                 3F2B33ED165AF15600E3987C /* DOMWebKitCSSViewportRuleInternal.h in Headers */,
</span><span class="cx">                                 8A195932147EA16E00D1EA61 /* DOMWebKitNamedFlow.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFace.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFace.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/css/CSSFontFace.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -123,7 +123,7 @@
</span><span class="cx">
</span><span class="cx"> size_t size = m_sources.size();
</span><span class="cx"> for (size_t i = 0; i < size; ++i) {
</span><del>- if (RefPtr<Font> result = m_sources[i]->font(fontDescription, syntheticBold, syntheticItalic, fontSelector)) {
</del><ins>+ if (RefPtr<Font> result = m_sources[i]->font(fontDescription, syntheticBold, syntheticItalic, fontSelector, m_featureSettings, m_variantSettings)) {
</ins><span class="cx"> m_activeSource = m_sources[i].get();
</span><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span><span class="cx"> if (RuntimeEnabledFeatures::sharedFeatures().fontLoadEventsEnabled() && m_loadState == Loading && m_sources[i]->isLoaded()) {
</span><span class="lines">@@ -141,7 +141,7 @@
</span><span class="cx"> notifyLoadingDone();
</span><span class="cx"> }
</span><span class="cx"> #endif
</span><del>- return 0;
</del><ins>+ return nullptr;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if ENABLE(FONT_LOAD_EVENTS)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFace.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFace.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/css/CSSFontFace.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -28,6 +28,7 @@
</span><span class="cx">
</span><span class="cx"> #include "CSSFontFaceRule.h"
</span><span class="cx"> #include "CSSFontFaceSource.h"
</span><ins>+#include "FontFeatureSettings.h"
</ins><span class="cx"> #include "TextFlags.h"
</span><span class="cx"> #include <memory>
</span><span class="cx"> #include <wtf/Forward.h>
</span><span class="lines">@@ -53,6 +54,24 @@
</span><span class="cx"> void addRange(UChar32 from, UChar32 to) { m_ranges.append(UnicodeRange(from, to)); }
</span><span class="cx"> const Vector<UnicodeRange>& ranges() const { return m_ranges; }
</span><span class="cx">
</span><ins>+ void insertFeature(FontFeature&& feature) { m_featureSettings.insert(WTF::move(feature)); }
+
+ void setVariantCommonLigatures(FontVariantLigatures ligatures) { m_variantSettings.commonLigatures = ligatures; }
+ void setVariantDiscretionaryLigatures(FontVariantLigatures ligatures) { m_variantSettings.discretionaryLigatures = ligatures; }
+ void setVariantHistoricalLigatures(FontVariantLigatures ligatures) { m_variantSettings.historicalLigatures = ligatures; }
+ void setVariantContextualAlternates(FontVariantLigatures ligatures) { m_variantSettings.contextualAlternates = ligatures; }
+ void setVariantPosition(FontVariantPosition position) { m_variantSettings.position = position; }
+ void setVariantCaps(FontVariantCaps caps) { m_variantSettings.caps = caps; }
+ void setVariantNumericFigure(FontVariantNumericFigure figure) { m_variantSettings.numericFigure = figure; }
+ void setVariantNumericSpacing(FontVariantNumericSpacing spacing) { m_variantSettings.numericSpacing = spacing; }
+ void setVariantNumericFraction(FontVariantNumericFraction fraction) { m_variantSettings.numericFraction = fraction; }
+ void setVariantNumericOrdinal(FontVariantNumericOrdinal ordinal) { m_variantSettings.numericOrdinal = ordinal; }
+ void setVariantNumericSlashedZero(FontVariantNumericSlashedZero slashedZero) { m_variantSettings.numericSlashedZero = slashedZero; }
+ void setVariantAlternates(FontVariantAlternates alternates) { m_variantSettings.alternates = alternates; }
+ void setVariantEastAsianVariant(FontVariantEastAsianVariant variant) { m_variantSettings.eastAsianVariant = variant; }
+ void setVariantEastAsianWidth(FontVariantEastAsianWidth width) { m_variantSettings.eastAsianWidth = width; }
+ void setVariantEastAsianRuby(FontVariantEastAsianRuby ruby) { m_variantSettings.eastAsianRuby = ruby; }
+
</ins><span class="cx"> void addedToSegmentedFontFace(CSSSegmentedFontFace*);
</span><span class="cx"> void removedFromSegmentedFontFace(CSSSegmentedFontFace*);
</span><span class="cx">
</span><span class="lines">@@ -107,6 +126,8 @@
</span><span class="cx"> FontTraitsMask m_traitsMask;
</span><span class="cx"> Vector<UnicodeRange> m_ranges;
</span><span class="cx"> HashSet<CSSSegmentedFontFace*> m_segmentedFontFaces;
</span><ins>+ FontFeatureSettings m_featureSettings;
+ FontVariantSettings m_variantSettings;
</ins><span class="cx"> Vector<std::unique_ptr<CSSFontFaceSource>> m_sources;
</span><span class="cx"> CSSFontFaceSource* m_activeSource;
</span><span class="cx"> bool m_isLocalFallback;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSourcecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSource.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -101,7 +101,7 @@
</span><span class="cx"> m_face->fontLoaded(this);
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, CSSFontSelector* fontSelector)
</del><ins>+RefPtr<Font> CSSFontFaceSource::font(const FontDescription& fontDescription, bool syntheticBold, bool syntheticItalic, CSSFontSelector* fontSelector, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
</ins><span class="cx"> {
</span><span class="cx"> // If the font hasn't loaded or an error occurred, then we've got nothing.
</span><span class="cx"> if (!isValid())
</span><span class="lines">@@ -124,10 +124,8 @@
</span><span class="cx"> if (font)
</span><span class="cx"> return font.release();
</span><span class="cx">
</span><del>- // If we are still loading, then we let the system pick a font.
</del><span class="cx"> if (isLoaded()) {
</span><span class="cx"> if (m_font) {
</span><del>- // Create new FontPlatformData from our CGFontRef, point size and ATSFontRef.
</del><span class="cx"> bool hasExternalSVGFont = false;
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> hasExternalSVGFont = m_hasExternalSVGFont;
</span><span class="lines">@@ -135,7 +133,7 @@
</span><span class="cx"> if (!m_font->ensureCustomFontData(hasExternalSVGFont, m_string))
</span><span class="cx"> return nullptr;
</span><span class="cx">
</span><del>- font = m_font->createFont(fontDescription, m_string, syntheticBold, syntheticItalic, hasExternalSVGFont);
</del><ins>+ font = m_font->createFont(fontDescription, m_string, syntheticBold, syntheticItalic, hasExternalSVGFont, fontFaceFeatures, fontFaceVariantSettings);
</ins><span class="cx"> } else {
</span><span class="cx"> #if ENABLE(SVG_FONTS)
</span><span class="cx"> // In-Document SVG Fonts
</span><span class="lines">@@ -153,7 +151,7 @@
</span><span class="cx"> auto customPlatformData = createFontCustomPlatformData(*m_generatedOTFBuffer);
</span><span class="cx"> if (!customPlatformData)
</span><span class="cx"> return nullptr;
</span><del>- font = Font::create(customPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic), true, false);
</del><ins>+ font = Font::create(customPlatformData->fontPlatformData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings), true, false);
</ins><span class="cx"> #else
</span><span class="cx"> font = Font::create(std::make_unique<SVGFontData>(m_svgFontFaceElement.get()), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
</span><span class="cx"> #endif
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFaceSourceh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontFaceSource.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFaceSource.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/css/CSSFontFaceSource.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -44,6 +44,7 @@
</span><span class="cx"> class CSSFontSelector;
</span><span class="cx"> class Font;
</span><span class="cx"> class FontDescription;
</span><ins>+class FontFeatureSettings;
</ins><span class="cx">
</span><span class="cx"> class CSSFontFaceSource final : public CachedFontClient {
</span><span class="cx"> WTF_MAKE_FAST_ALLOCATED;
</span><span class="lines">@@ -60,7 +61,7 @@
</span><span class="cx">
</span><span class="cx"> virtual void fontLoaded(CachedFont*) override;
</span><span class="cx">
</span><del>- RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic, CSSFontSelector*);
</del><ins>+ RefPtr<Font> font(const FontDescription&, bool syntheticBold, bool syntheticItalic, CSSFontSelector*, const FontFeatureSettings&, const FontVariantSettings&);
</ins><span class="cx">
</span><span class="cx"> void pruneTable();
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -33,7 +33,9 @@
</span><span class="cx"> #include "CSSFontFaceSource.h"
</span><span class="cx"> #include "CSSFontFaceSrcValue.h"
</span><span class="cx"> #include "CSSFontFamily.h"
</span><ins>+#include "CSSFontFeatureValue.h"
</ins><span class="cx"> #include "CSSPrimitiveValue.h"
</span><ins>+#include "CSSPrimitiveValueMappings.h"
</ins><span class="cx"> #include "CSSPropertyNames.h"
</span><span class="cx"> #include "CSSSegmentedFontFace.h"
</span><span class="cx"> #include "CSSUnicodeRangeValue.h"
</span><span class="lines">@@ -43,6 +45,7 @@
</span><span class="cx"> #include "Document.h"
</span><span class="cx"> #include "Font.h"
</span><span class="cx"> #include "FontCache.h"
</span><ins>+#include "FontVariantBuilder.h"
</ins><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "FrameLoader.h"
</span><span class="cx"> #include "SVGFontFaceElement.h"
</span><span class="lines">@@ -283,6 +286,13 @@
</span><span class="cx"> RefPtr<CSSValue> fontFamily = style.getPropertyCSSValue(CSSPropertyFontFamily);
</span><span class="cx"> RefPtr<CSSValue> src = style.getPropertyCSSValue(CSSPropertySrc);
</span><span class="cx"> RefPtr<CSSValue> unicodeRange = style.getPropertyCSSValue(CSSPropertyUnicodeRange);
</span><ins>+ RefPtr<CSSValue> featureSettings = style.getPropertyCSSValue(CSSPropertyFontFeatureSettings);
+ RefPtr<CSSValue> variantLigatures = style.getPropertyCSSValue(CSSPropertyFontVariantLigatures);
+ RefPtr<CSSValue> variantPosition = style.getPropertyCSSValue(CSSPropertyFontVariantPosition);
+ RefPtr<CSSValue> variantCaps = style.getPropertyCSSValue(CSSPropertyFontVariantCaps);
+ RefPtr<CSSValue> variantNumeric = style.getPropertyCSSValue(CSSPropertyFontVariantNumeric);
+ RefPtr<CSSValue> variantAlternates = style.getPropertyCSSValue(CSSPropertyFontVariantAlternates);
+ RefPtr<CSSValue> variantEastAsian = style.getPropertyCSSValue(CSSPropertyFontVariantEastAsian);
</ins><span class="cx"> if (!is<CSSValueList>(fontFamily.get()) || !is<CSSValueList>(src.get()) || (unicodeRange && !is<CSSValueList>(*unicodeRange)))
</span><span class="cx"> return;
</span><span class="cx">
</span><span class="lines">@@ -313,6 +323,31 @@
</span><span class="cx"> }
</span><span class="cx"> }
</span><span class="cx">
</span><ins>+ if (featureSettings) {
+ for (auto& item : downcast<CSSValueList>(*featureSettings)) {
+ auto& feature = downcast<CSSFontFeatureValue>(item.get());
+ fontFace->insertFeature(FontFeature(feature.tag(), feature.value()));
+ }
+ }
+
+ if (variantLigatures)
+ applyValueFontVariantLigatures(fontFace.get(), *variantLigatures);
+
+ if (variantPosition)
+ fontFace->setVariantPosition(downcast<CSSPrimitiveValue>(*variantPosition));
+
+ if (variantCaps)
+ fontFace->setVariantCaps(downcast<CSSPrimitiveValue>(*variantCaps));
+
+ if (variantNumeric)
+ applyValueFontVariantNumeric(fontFace.get(), *variantNumeric);
+
+ if (variantAlternates)
+ fontFace->setVariantAlternates(downcast<CSSPrimitiveValue>(*variantAlternates));
+
+ if (variantEastAsian)
+ applyValueFontVariantEastAsian(fontFace.get(), *variantEastAsian);
+
</ins><span class="cx"> for (auto& item : familyList) {
</span><span class="cx"> String familyName = familyNameFromPrimitive(downcast<CSSPrimitiveValue>(item.get()));
</span><span class="cx"> if (familyName.isEmpty())
</span></span></pre></div>
<a id="trunkSourceWebCorecssFontVariantBuilderh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/FontVariantBuilder.h (0 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/FontVariantBuilder.h         (rev 0)
+++ trunk/Source/WebCore/css/FontVariantBuilder.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -0,0 +1,196 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple Inc. All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS''
+ * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO,
+ * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS
+ * BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR
+ * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF
+ * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS
+ * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN
+ * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE)
+ * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF
+ * THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef FontVariantBuilder_h
+#define FontVariantBuilder_h
+
+namespace WebCore {
+
+template <typename T>
+inline void applyValueFontVariantLigatures(T& receiver, CSSValue& value)
+{
+ FontVariantLigatures common = FontVariantLigatures::Normal;
+ FontVariantLigatures discretionary = FontVariantLigatures::Normal;
+ FontVariantLigatures historical = FontVariantLigatures::Normal;
+ FontVariantLigatures contextualAlternates = FontVariantLigatures::Normal;
+
+ if (is<CSSValueList>(value)) {
+ for (auto& item : downcast<CSSValueList>(value)) {
+ switch (downcast<CSSPrimitiveValue>(item.get()).getValueID()) {
+ case CSSValueNoCommonLigatures:
+ common = FontVariantLigatures::No;
+ break;
+ case CSSValueCommonLigatures:
+ common = FontVariantLigatures::Yes;
+ break;
+ case CSSValueNoDiscretionaryLigatures:
+ discretionary = FontVariantLigatures::No;
+ break;
+ case CSSValueDiscretionaryLigatures:
+ discretionary = FontVariantLigatures::Yes;
+ break;
+ case CSSValueNoHistoricalLigatures:
+ historical = FontVariantLigatures::No;
+ break;
+ case CSSValueHistoricalLigatures:
+ historical = FontVariantLigatures::Yes;
+ break;
+ case CSSValueContextual:
+ contextualAlternates = FontVariantLigatures::Yes;
+ break;
+ case CSSValueNoContextual:
+ contextualAlternates = FontVariantLigatures::No;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+ } else {
+ switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
+ case CSSValueNormal:
+ break;
+ case CSSValueNone:
+ common = FontVariantLigatures::No;
+ discretionary = FontVariantLigatures::No;
+ historical = FontVariantLigatures::No;
+ contextualAlternates = FontVariantLigatures::No;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+
+ receiver.setVariantCommonLigatures(common);
+ receiver.setVariantDiscretionaryLigatures(discretionary);
+ receiver.setVariantHistoricalLigatures(historical);
+ receiver.setVariantContextualAlternates(contextualAlternates);
+}
+
+template <typename T>
+inline void applyValueFontVariantNumeric(T& receiver, CSSValue& value)
+{
+ FontVariantNumericFigure figure = FontVariantNumericFigure::Normal;
+ FontVariantNumericSpacing spacing = FontVariantNumericSpacing::Normal;
+ FontVariantNumericFraction fraction = FontVariantNumericFraction::Normal;
+ FontVariantNumericOrdinal ordinal = FontVariantNumericOrdinal::Normal;
+ FontVariantNumericSlashedZero slashedZero = FontVariantNumericSlashedZero::Normal;
+
+ if (is<CSSValueList>(value)) {
+ for (auto& item : downcast<CSSValueList>(value)) {
+ switch (downcast<CSSPrimitiveValue>(item.get()).getValueID()) {
+ case CSSValueLiningNums:
+ figure = FontVariantNumericFigure::LiningNumbers;
+ break;
+ case CSSValueOldstyleNums:
+ figure = FontVariantNumericFigure::OldStyleNumbers;
+ break;
+ case CSSValueProportionalNums:
+ spacing = FontVariantNumericSpacing::ProportionalNumbers;
+ break;
+ case CSSValueTabularNums:
+ spacing = FontVariantNumericSpacing::TabularNumbers;
+ break;
+ case CSSValueDiagonalFractions:
+ fraction = FontVariantNumericFraction::DiagonalFractions;
+ break;
+ case CSSValueStackedFractions:
+ fraction = FontVariantNumericFraction::StackedFractions;
+ break;
+ case CSSValueOrdinal:
+ ordinal = FontVariantNumericOrdinal::Yes;
+ break;
+ case CSSValueSlashedZero:
+ slashedZero = FontVariantNumericSlashedZero::Yes;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+ } else
+ ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal);
+
+ receiver.setVariantNumericFigure(figure);
+ receiver.setVariantNumericSpacing(spacing);
+ receiver.setVariantNumericFraction(fraction);
+ receiver.setVariantNumericOrdinal(ordinal);
+ receiver.setVariantNumericSlashedZero(slashedZero);
+}
+
+template <typename T>
+inline void applyValueFontVariantEastAsian(T& receiver, CSSValue& value)
+{
+ FontVariantEastAsianVariant variant = FontVariantEastAsianVariant::Normal;
+ FontVariantEastAsianWidth width = FontVariantEastAsianWidth::Normal;
+ FontVariantEastAsianRuby ruby = FontVariantEastAsianRuby::Normal;
+
+ if (is<CSSValueList>(value)) {
+ for (auto& item : downcast<CSSValueList>(value)) {
+ switch (downcast<CSSPrimitiveValue>(item.get()).getValueID()) {
+ case CSSValueJis78:
+ variant = FontVariantEastAsianVariant::Jis78;
+ break;
+ case CSSValueJis83:
+ variant = FontVariantEastAsianVariant::Jis83;
+ break;
+ case CSSValueJis90:
+ variant = FontVariantEastAsianVariant::Jis90;
+ break;
+ case CSSValueJis04:
+ variant = FontVariantEastAsianVariant::Jis04;
+ break;
+ case CSSValueSimplified:
+ variant = FontVariantEastAsianVariant::Simplified;
+ break;
+ case CSSValueTraditional:
+ variant = FontVariantEastAsianVariant::Traditional;
+ break;
+ case CSSValueFullWidth:
+ width = FontVariantEastAsianWidth::FullWidth;
+ break;
+ case CSSValueProportionalWidth:
+ width = FontVariantEastAsianWidth::ProportionalWidth;
+ break;
+ case CSSValueRuby:
+ ruby = FontVariantEastAsianRuby::Yes;
+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ break;
+ }
+ }
+ } else
+ ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal);
+
+ receiver.setVariantEastAsianVariant(variant);
+ receiver.setVariantEastAsianWidth(width);
+ receiver.setVariantEastAsianRuby(ruby);
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -38,6 +38,7 @@
</span><span class="cx"> #include "CursorList.h"
</span><span class="cx"> #include "DashboardRegion.h"
</span><span class="cx"> #include "ElementAncestorIterator.h"
</span><ins>+#include "FontVariantBuilder.h"
</ins><span class="cx"> #include "Frame.h"
</span><span class="cx"> #include "HTMLElement.h"
</span><span class="cx"> #include "LocaleToScriptMapping.h"
</span><span class="lines">@@ -1414,64 +1415,8 @@
</span><span class="cx">
</span><span class="cx"> inline void StyleBuilderCustom::applyValueFontVariantLigatures(StyleResolver& styleResolver, CSSValue& value)
</span><span class="cx"> {
</span><del>- FontVariantLigatures common = FontVariantLigatures::Normal;
- FontVariantLigatures discretionary = FontVariantLigatures::Normal;
- FontVariantLigatures historical = FontVariantLigatures::Normal;
- FontVariantLigatures contextualAlternates = FontVariantLigatures::Normal;
-
- if (is<CSSValueList>(value)) {
- for (auto& item : downcast<CSSValueList>(value)) {
- switch (downcast<CSSPrimitiveValue>(item.get()).getValueID()) {
- case CSSValueNoCommonLigatures:
- common = FontVariantLigatures::No;
- break;
- case CSSValueCommonLigatures:
- common = FontVariantLigatures::Yes;
- break;
- case CSSValueNoDiscretionaryLigatures:
- discretionary = FontVariantLigatures::No;
- break;
- case CSSValueDiscretionaryLigatures:
- discretionary = FontVariantLigatures::Yes;
- break;
- case CSSValueNoHistoricalLigatures:
- historical = FontVariantLigatures::No;
- break;
- case CSSValueHistoricalLigatures:
- historical = FontVariantLigatures::Yes;
- break;
- case CSSValueContextual:
- contextualAlternates = FontVariantLigatures::Yes;
- break;
- case CSSValueNoContextual:
- contextualAlternates = FontVariantLigatures::No;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
- }
- } else {
- switch (downcast<CSSPrimitiveValue>(value).getValueID()) {
- case CSSValueNormal:
- break;
- case CSSValueNone:
- common = FontVariantLigatures::No;
- discretionary = FontVariantLigatures::No;
- historical = FontVariantLigatures::No;
- contextualAlternates = FontVariantLigatures::No;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
- }
-
</del><span class="cx"> auto fontDescription = styleResolver.fontDescription();
</span><del>- fontDescription.setVariantCommonLigatures(common);
- fontDescription.setVariantDiscretionaryLigatures(discretionary);
- fontDescription.setVariantHistoricalLigatures(historical);
- fontDescription.setVariantContextualAlternates(contextualAlternates);
</del><ins>+ WebCore::applyValueFontVariantLigatures(fontDescription, value);
</ins><span class="cx"> styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1499,53 +1444,8 @@
</span><span class="cx">
</span><span class="cx"> inline void StyleBuilderCustom::applyValueFontVariantNumeric(StyleResolver& styleResolver, CSSValue& value)
</span><span class="cx"> {
</span><del>- FontVariantNumericFigure figure = FontVariantNumericFigure::Normal;
- FontVariantNumericSpacing spacing = FontVariantNumericSpacing::Normal;
- FontVariantNumericFraction fraction = FontVariantNumericFraction::Normal;
- FontVariantNumericOrdinal ordinal = FontVariantNumericOrdinal::Normal;
- FontVariantNumericSlashedZero slashedZero = FontVariantNumericSlashedZero::Normal;
-
- if (is<CSSValueList>(value)) {
- for (auto& item : downcast<CSSValueList>(value)) {
- switch (downcast<CSSPrimitiveValue>(item.get()).getValueID()) {
- case CSSValueLiningNums:
- figure = FontVariantNumericFigure::LiningNumbers;
- break;
- case CSSValueOldstyleNums:
- figure = FontVariantNumericFigure::OldStyleNumbers;
- break;
- case CSSValueProportionalNums:
- spacing = FontVariantNumericSpacing::ProportionalNumbers;
- break;
- case CSSValueTabularNums:
- spacing = FontVariantNumericSpacing::TabularNumbers;
- break;
- case CSSValueDiagonalFractions:
- fraction = FontVariantNumericFraction::DiagonalFractions;
- break;
- case CSSValueStackedFractions:
- fraction = FontVariantNumericFraction::StackedFractions;
- break;
- case CSSValueOrdinal:
- ordinal = FontVariantNumericOrdinal::Yes;
- break;
- case CSSValueSlashedZero:
- slashedZero = FontVariantNumericSlashedZero::Yes;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
- }
- } else
- ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal);
-
</del><span class="cx"> auto fontDescription = styleResolver.fontDescription();
</span><del>- fontDescription.setVariantNumericFigure(figure);
- fontDescription.setVariantNumericSpacing(spacing);
- fontDescription.setVariantNumericFraction(fraction);
- fontDescription.setVariantNumericOrdinal(ordinal);
- fontDescription.setVariantNumericSlashedZero(slashedZero);
</del><ins>+ WebCore::applyValueFontVariantNumeric(fontDescription, value);
</ins><span class="cx"> styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -1569,52 +1469,8 @@
</span><span class="cx">
</span><span class="cx"> inline void StyleBuilderCustom::applyValueFontVariantEastAsian(StyleResolver& styleResolver, CSSValue& value)
</span><span class="cx"> {
</span><del>- FontVariantEastAsianVariant variant = FontVariantEastAsianVariant::Normal;
- FontVariantEastAsianWidth width = FontVariantEastAsianWidth::Normal;
- FontVariantEastAsianRuby ruby = FontVariantEastAsianRuby::Normal;
-
- if (is<CSSValueList>(value)) {
- for (auto& item : downcast<CSSValueList>(value)) {
- switch (downcast<CSSPrimitiveValue>(item.get()).getValueID()) {
- case CSSValueJis78:
- variant = FontVariantEastAsianVariant::Jis78;
- break;
- case CSSValueJis83:
- variant = FontVariantEastAsianVariant::Jis83;
- break;
- case CSSValueJis90:
- variant = FontVariantEastAsianVariant::Jis90;
- break;
- case CSSValueJis04:
- variant = FontVariantEastAsianVariant::Jis04;
- break;
- case CSSValueSimplified:
- variant = FontVariantEastAsianVariant::Simplified;
- break;
- case CSSValueTraditional:
- variant = FontVariantEastAsianVariant::Traditional;
- break;
- case CSSValueFullWidth:
- width = FontVariantEastAsianWidth::FullWidth;
- break;
- case CSSValueProportionalWidth:
- width = FontVariantEastAsianWidth::ProportionalWidth;
- break;
- case CSSValueRuby:
- ruby = FontVariantEastAsianRuby::Yes;
- break;
- default:
- ASSERT_NOT_REACHED();
- break;
- }
- }
- } else
- ASSERT(downcast<CSSPrimitiveValue>(value).getValueID() == CSSValueNormal);
-
</del><span class="cx"> auto fontDescription = styleResolver.fontDescription();
</span><del>- fontDescription.setVariantEastAsianVariant(variant);
- fontDescription.setVariantEastAsianWidth(width);
- fontDescription.setVariantEastAsianRuby(ruby);
</del><ins>+ WebCore::applyValueFontVariantEastAsian(fontDescription, value);
</ins><span class="cx"> styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedFontcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedFont.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/loader/cache/CachedFont.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -121,15 +121,21 @@
</span><span class="cx"> return m_fontCustomPlatformData.get();
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<Font> CachedFont::createFont(const FontDescription& fontDescription, const AtomicString&, bool syntheticBold, bool syntheticItalic, bool)
</del><ins>+RefPtr<Font> CachedFont::createFont(const FontDescription& fontDescription, const AtomicString&, bool syntheticBold, bool syntheticItalic, bool, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
</ins><span class="cx"> {
</span><del>- return Font::create(platformDataFromCustomData(fontDescription, syntheticBold, syntheticItalic), true, false);
</del><ins>+ return Font::create(platformDataFromCustomData(fontDescription, syntheticBold, syntheticItalic, fontFaceFeatures, fontFaceVariantSettings), true, false);
</ins><span class="cx"> }
</span><span class="cx">
</span><del>-FontPlatformData CachedFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic)
</del><ins>+FontPlatformData CachedFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(m_fontCustomPlatformData);
</span><ins>+#if PLATFORM(COCOA)
+ return m_fontCustomPlatformData->fontPlatformData(fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings);
+#else
+ UNUSED_PARAM(fontFaceFeatures);
+ UNUSED_PARAM(fontFaceVariantSettings);
</ins><span class="cx"> return m_fontCustomPlatformData->fontPlatformData(fontDescription, bold, italic);
</span><ins>+#endif
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> void CachedFont::allClientsRemoved()
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedFont.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedFont.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/loader/cache/CachedFont.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -35,6 +35,7 @@
</span><span class="cx">
</span><span class="cx"> class CachedResourceLoader;
</span><span class="cx"> class FontDescription;
</span><ins>+class FontFeatureSettings;
</ins><span class="cx"> class FontPlatformData;
</span><span class="cx"> class SVGDocument;
</span><span class="cx"> class SVGFontElement;
</span><span class="lines">@@ -50,10 +51,10 @@
</span><span class="cx">
</span><span class="cx"> virtual bool ensureCustomFontData(bool externalSVG, const AtomicString& remoteURI);
</span><span class="cx">
</span><del>- virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG);
</del><ins>+ virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG, const FontFeatureSettings&, const FontVariantSettings&);
</ins><span class="cx">
</span><span class="cx"> protected:
</span><del>- FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic);
</del><ins>+ FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&);
</ins><span class="cx">
</span><span class="cx"> bool ensureCustomFontData(SharedBuffer* data);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGFontcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -51,14 +51,14 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RefPtr<Font> CachedSVGFont::createFont(const FontDescription& fontDescription, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG)
</del><ins>+RefPtr<Font> CachedSVGFont::createFont(const FontDescription& fontDescription, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
</ins><span class="cx"> {
</span><span class="cx"> #if ENABLE(SVG_OTF_CONVERTER)
</span><span class="cx"> if (!externalSVG || firstFontFace(remoteURI))
</span><del>- return CachedFont::createFont(fontDescription, remoteURI, syntheticBold, syntheticItalic, externalSVG);
</del><ins>+ return CachedFont::createFont(fontDescription, remoteURI, syntheticBold, syntheticItalic, externalSVG, fontFaceFeatures, fontFaceVariantSettings);
</ins><span class="cx"> #else
</span><span class="cx"> if (!externalSVG)
</span><del>- return CachedFont::createFont(fontDescription, remoteURI, syntheticBold, syntheticItalic, externalSVG);
</del><ins>+ return CachedFont::createFont(fontDescription, remoteURI, syntheticBold, syntheticItalic, externalSVG, fontFaceFeatures, fontFaceVariantSettings);
</ins><span class="cx">
</span><span class="cx"> if (SVGFontFaceElement* firstFontFace = this->firstFontFace(remoteURI))
</span><span class="cx"> return Font::create(std::make_unique<SVGFontData>(firstFontFace), fontDescription.computedPixelSize(), syntheticBold, syntheticItalic);
</span><span class="lines">@@ -66,11 +66,11 @@
</span><span class="cx"> return nullptr;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FontPlatformData CachedSVGFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic)
</del><ins>+FontPlatformData CachedSVGFont::platformDataFromCustomData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
</ins><span class="cx"> {
</span><span class="cx"> if (m_externalSVGDocument)
</span><span class="cx"> return FontPlatformData(fontDescription.computedPixelSize(), bold, italic);
</span><del>- return CachedFont::platformDataFromCustomData(fontDescription, bold, italic);
</del><ins>+ return CachedFont::platformDataFromCustomData(fontDescription, bold, italic, fontFaceFeatures, fontFaceVariantSettings);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool CachedSVGFont::ensureCustomFontData(bool externalSVG, const AtomicString& remoteURI)
</span></span></pre></div>
<a id="trunkSourceWebCoreloadercacheCachedSVGFonth"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/loader/cache/CachedSVGFont.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/loader/cache/CachedSVGFont.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/loader/cache/CachedSVGFont.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -40,10 +40,10 @@
</span><span class="cx">
</span><span class="cx"> virtual bool ensureCustomFontData(bool externalSVG, const AtomicString& remoteURI) override;
</span><span class="cx">
</span><del>- virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG) override;
</del><ins>+ virtual RefPtr<Font> createFont(const FontDescription&, const AtomicString& remoteURI, bool syntheticBold, bool syntheticItalic, bool externalSVG, const FontFeatureSettings&, const FontVariantSettings&) override;
</ins><span class="cx">
</span><span class="cx"> private:
</span><del>- FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic);
</del><ins>+ FontPlatformData platformDataFromCustomData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings&, const FontVariantSettings&);
</ins><span class="cx">
</span><span class="cx"> SVGFontElement* getSVGFontById(const String&) const;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -254,7 +254,7 @@
</span><span class="cx"> bool needsSyntheticOblique;
</span><span class="cx"> };
</span><span class="cx">
</span><del>-RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, TextRenderingMode, const FontFeatureSettings&, const FontVariantSettings&);
</del><ins>+RetainPtr<CTFontRef> preparePlatformFont(CTFontRef, TextRenderingMode, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings, const FontFeatureSettings& features, const FontVariantSettings&);
</ins><span class="cx"> FontWeight fontWeightFromCoreText(CGFloat weight);
</span><span class="cx"> uint16_t toCoreTextFontWeight(FontWeight);
</span><span class="cx"> bool isFontWeightBold(FontWeight);
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -594,7 +594,8 @@
</span><span class="cx"> return Simple;
</span><span class="cx"> #endif
</span><span class="cx">
</span><del>- // Because Font::applyTransforms() doesn't know which features to enable/disable it the simple code path can’t properly handle feature or variant settings.
</del><ins>+ // Because Font::applyTransforms() doesn't know which features to enable/disable in the simple code path, it can't properly handle feature or variant settings.
+ // FIXME: https://bugs.webkit.org/show_bug.cgi?id=150791: @font-face features should also cause this to be complex.
</ins><span class="cx"> if (m_fontDescription.featureSettings().size() > 0 || !m_fontDescription.variantSettings().isAllNormal())
</span><span class="cx"> return Complex;
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -154,6 +154,8 @@
</span><span class="cx"> FeaturesMap result;
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.commonLigatures) {
</span><ins>+ case FontVariantLigatures::Normal:
+ break;
</ins><span class="cx"> case FontVariantLigatures::Yes:
</span><span class="cx"> result.add(fontFeatureTag("liga"), 1);
</span><span class="cx"> result.add(fontFeatureTag("clig"), 1);
</span><span class="lines">@@ -163,10 +165,12 @@
</span><span class="cx"> result.add(fontFeatureTag("clig"), 0);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.discretionaryLigatures) {
</span><ins>+ case FontVariantLigatures::Normal:
+ break;
</ins><span class="cx"> case FontVariantLigatures::Yes:
</span><span class="cx"> result.add(fontFeatureTag("dlig"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -174,10 +178,12 @@
</span><span class="cx"> result.add(fontFeatureTag("dlig"), 0);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.historicalLigatures) {
</span><ins>+ case FontVariantLigatures::Normal:
+ break;
</ins><span class="cx"> case FontVariantLigatures::Yes:
</span><span class="cx"> result.add(fontFeatureTag("hlig"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -185,10 +191,12 @@
</span><span class="cx"> result.add(fontFeatureTag("hlig"), 0);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.contextualAlternates) {
</span><ins>+ case FontVariantLigatures::Normal:
+ break;
</ins><span class="cx"> case FontVariantLigatures::Yes:
</span><span class="cx"> result.add(fontFeatureTag("calt"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -196,10 +204,12 @@
</span><span class="cx"> result.add(fontFeatureTag("calt"), 0);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.position) {
</span><ins>+ case FontVariantPosition::Normal:
+ break;
</ins><span class="cx"> case FontVariantPosition::Subscript:
</span><span class="cx"> result.add(fontFeatureTag("subs"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -207,10 +217,12 @@
</span><span class="cx"> result.add(fontFeatureTag("sups"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.caps) {
</span><ins>+ case FontVariantCaps::Normal:
+ break;
</ins><span class="cx"> case FontVariantCaps::AllSmall:
</span><span class="cx"> result.add(fontFeatureTag("c2sc"), 1);
</span><span class="cx"> FALLTHROUGH;
</span><span class="lines">@@ -230,10 +242,12 @@
</span><span class="cx"> result.add(fontFeatureTag("titl"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.numericFigure) {
</span><ins>+ case FontVariantNumericFigure::Normal:
+ break;
</ins><span class="cx"> case FontVariantNumericFigure::LiningNumbers:
</span><span class="cx"> result.add(fontFeatureTag("lnum"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -241,10 +255,12 @@
</span><span class="cx"> result.add(fontFeatureTag("onum"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.numericSpacing) {
</span><ins>+ case FontVariantNumericSpacing::Normal:
+ break;
</ins><span class="cx"> case FontVariantNumericSpacing::ProportionalNumbers:
</span><span class="cx"> result.add(fontFeatureTag("pnum"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -252,10 +268,12 @@
</span><span class="cx"> result.add(fontFeatureTag("tnum"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.numericFraction) {
</span><ins>+ case FontVariantNumericFraction::Normal:
+ break;
</ins><span class="cx"> case FontVariantNumericFraction::DiagonalFractions:
</span><span class="cx"> result.add(fontFeatureTag("frac"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -263,23 +281,42 @@
</span><span class="cx"> result.add(fontFeatureTag("afrc"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><ins>+ ASSERT_NOT_REACHED();
+ }
+
+ switch (variantSettings.numericOrdinal) {
+ case FontVariantNumericOrdinal::Normal:
</ins><span class="cx"> break;
</span><ins>+ case FontVariantNumericOrdinal::Yes:
+ result.add(fontFeatureTag("ordn"), 1);
+ break;
+ default:
+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (variantSettings.numericOrdinal == FontVariantNumericOrdinal::Yes)
- result.add(fontFeatureTag("ordn"), 1);
- if (variantSettings.numericSlashedZero == FontVariantNumericSlashedZero::Yes)
</del><ins>+ switch (variantSettings.numericSlashedZero) {
+ case FontVariantNumericSlashedZero::Normal:
+ break;
+ case FontVariantNumericSlashedZero::Yes:
</ins><span class="cx"> result.add(fontFeatureTag("zero"), 1);
</span><ins>+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
</ins><span class="cx">
</span><span class="cx"> switch (variantSettings.alternates) {
</span><ins>+ case FontVariantAlternates::Normal:
+ break;
</ins><span class="cx"> case FontVariantAlternates::HistoricalForms:
</span><span class="cx"> result.add(fontFeatureTag("hist"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.eastAsianVariant) {
</span><ins>+ case FontVariantEastAsianVariant::Normal:
+ break;
</ins><span class="cx"> case FontVariantEastAsianVariant::Jis78:
</span><span class="cx"> result.add(fontFeatureTag("jp78"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -299,10 +336,12 @@
</span><span class="cx"> result.add(fontFeatureTag("trad"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> switch (variantSettings.eastAsianWidth) {
</span><ins>+ case FontVariantEastAsianWidth::Normal:
+ break;
</ins><span class="cx"> case FontVariantEastAsianWidth::FullWidth:
</span><span class="cx"> result.add(fontFeatureTag("fwid"), 1);
</span><span class="cx"> break;
</span><span class="lines">@@ -310,47 +349,64 @@
</span><span class="cx"> result.add(fontFeatureTag("pwid"), 1);
</span><span class="cx"> break;
</span><span class="cx"> default:
</span><del>- break;
</del><ins>+ ASSERT_NOT_REACHED();
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- if (variantSettings.eastAsianRuby == FontVariantEastAsianRuby::Yes)
</del><ins>+ switch (variantSettings.eastAsianRuby) {
+ case FontVariantEastAsianRuby::Normal:
+ break;
+ case FontVariantEastAsianRuby::Yes:
</ins><span class="cx"> result.add(fontFeatureTag("ruby"), 1);
</span><ins>+ break;
+ default:
+ ASSERT_NOT_REACHED();
+ }
</ins><span class="cx">
</span><span class="cx"> return result;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-RetainPtr<CTFontRef> preparePlatformFont(CTFontRef originalFont, TextRenderingMode textRenderingMode, const FontFeatureSettings& features, const FontVariantSettings& variantSettings)
</del><ins>+RetainPtr<CTFontRef> preparePlatformFont(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() && (textRenderingMode == AutoTextRendering) && variantSettings.isAllNormal()))
</del><ins>+ if (!originalFont || (!features.size() && (textRenderingMode == AutoTextRendering) && variantSettings.isAllNormal()
+ && (!fontFaceFeatures || !fontFaceFeatures->size()) && (!fontFaceVariantSettings || fontFaceVariantSettings->isAllNormal())))
</ins><span class="cx"> return originalFont;
</span><span class="cx">
</span><span class="cx"> // This algorithm is described at http://www.w3.org/TR/css3-fonts/#feature-precedence
</span><ins>+ FeaturesMap featuresToBeApplied;
</ins><span class="cx">
</span><span class="cx"> // Step 1: CoreText handles default features (such as required ligatures).
</span><span class="cx">
</span><del>- // Steps 2-3: Consult with @font-face
- // FIXME: This is not yet implemented.
</del><ins>+ // Step 2: Consult with font-variant-* inside @font-face
+ if (fontFaceVariantSettings)
+ featuresToBeApplied = computeFeatureSettingsFromVariants(*fontFaceVariantSettings);
</ins><span class="cx">
</span><ins>+ // Step 3: Consult with font-feature-settings inside @font-face
+ if (fontFaceFeatures) {
+ for (auto& fontFaceFeature : *fontFaceFeatures)
+ featuresToBeApplied.set(fontFaceFeature.tag(), fontFaceFeature.value());
+ }
+
</ins><span class="cx"> // Step 4: Font-variant
</span><del>- auto fontFeatureSettingsFromVariants = computeFeatureSettingsFromVariants(variantSettings);
</del><ins>+ for (auto& newFeature : computeFeatureSettingsFromVariants(variantSettings))
+ featuresToBeApplied.set(newFeature.key, newFeature.value);
</ins><span class="cx">
</span><span class="cx"> // Step 5: Other properties (text-rendering)
</span><span class="cx"> if (textRenderingMode == OptimizeSpeed) {
</span><del>- fontFeatureSettingsFromVariants.set(fontFeatureTag("liga"), 0);
- fontFeatureSettingsFromVariants.set(fontFeatureTag("clig"), 0);
- fontFeatureSettingsFromVariants.set(fontFeatureTag("dlig"), 0);
- fontFeatureSettingsFromVariants.set(fontFeatureTag("hlig"), 0);
- fontFeatureSettingsFromVariants.set(fontFeatureTag("calt"), 0);
</del><ins>+ 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">
</span><span class="cx"> // Step 6: Font-feature-settings
</span><span class="cx"> for (auto& newFeature : features)
</span><del>- fontFeatureSettingsFromVariants.set(newFeature.tag(), newFeature.value());
</del><ins>+ featuresToBeApplied.set(newFeature.tag(), newFeature.value());
</ins><span class="cx">
</span><span class="cx"> RetainPtr<CFMutableDictionaryRef> attributes = adoptCF(CFDictionaryCreateMutable(kCFAllocatorDefault, 2, &kCFTypeDictionaryKeyCallBacks, &kCFTypeDictionaryValueCallBacks));
</span><del>- if (fontFeatureSettingsFromVariants.size()) {
</del><ins>+ if (featuresToBeApplied.size()) {
</ins><span class="cx"> RetainPtr<CFMutableArrayRef> featureArray = adoptCF(CFArrayCreateMutable(kCFAllocatorDefault, features.size(), &kCFTypeArrayCallBacks));
</span><del>- for (auto& p : fontFeatureSettingsFromVariants) {
</del><ins>+ for (auto& p : featuresToBeApplied) {
</ins><span class="cx"> auto feature = FontFeature(p.key, p.value);
</span><span class="cx"> appendTrueTypeFeature(featureArray.get(), feature);
</span><span class="cx"> appendOpenTypeFeature(featureArray.get(), feature);
</span><span class="lines">@@ -363,7 +419,8 @@
</span><span class="cx"> CFDictionaryAddValue(attributes.get(), kCTFontOpticalSizeAttribute, sizeNumber.get());
</span><span class="cx"> }
</span><span class="cx"> RetainPtr<CTFontDescriptorRef> descriptor = adoptCF(CTFontDescriptorCreateWithAttributes(attributes.get()));
</span><del>- return adoptCF(CTFontCreateCopyWithAttributes(originalFont, CTFontGetSize(originalFont), nullptr, descriptor.get()));
</del><ins>+ auto result = adoptCF(CTFontCreateCopyWithAttributes(originalFont, CTFontGetSize(originalFont), nullptr, descriptor.get()));
+ return result;
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> FontWeight fontWeightFromCoreText(CGFloat weight)
</span><span class="lines">@@ -634,7 +691,7 @@
</span><span class="cx"> UNUSED_PARAM(variantSettings);
</span><span class="cx"> RetainPtr<CTFontRef> foundFont = platformFontWithFamily(family, desiredTraits, weight, textRenderingMode, size);
</span><span class="cx"> #endif
</span><del>- return preparePlatformFont(foundFont.get(), textRenderingMode, featureSettings, variantSettings);
</del><ins>+ return preparePlatformFont(foundFont.get(), textRenderingMode, nullptr, nullptr, featureSettings, variantSettings);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> #if PLATFORM(MAC)
</span><span class="lines">@@ -730,7 +787,7 @@
</span><span class="cx"> const FontPlatformData& platformData = originalFontData->platformData();
</span><span class="cx"> // FIXME: Should pass in the locale instead of nullAtom.
</span><span class="cx"> RetainPtr<CTFontRef> result = platformLookupFallbackFont(platformData.font(), description.weight(), nullAtom, characters, length);
</span><del>- result = preparePlatformFont(result.get(), description.textRenderingMode(), description.featureSettings(), description.variantSettings());
</del><ins>+ result = preparePlatformFont(result.get(), description.textRenderingMode(), nullptr, nullptr, description.featureSettings(), description.variantSettings());
</ins><span class="cx"> if (!result)
</span><span class="cx"> return lastResortFallbackFont(description);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontCustomPlatformDatacpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.cpp        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -34,16 +34,18 @@
</span><span class="cx"> {
</span><span class="cx"> }
</span><span class="cx">
</span><del>-FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic)
</del><ins>+FontPlatformData FontCustomPlatformData::fontPlatformData(const FontDescription& fontDescription, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings)
</ins><span class="cx"> {
</span><span class="cx"> int size = fontDescription.computedPixelSize();
</span><span class="cx"> FontOrientation orientation = fontDescription.orientation();
</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 = preparePlatformFont(font.get(), fontDescription.textRenderingMode(), fontDescription.featureSettings(), fontDescription.variantSettings());
</del><ins>+ font = preparePlatformFont(font.get(), fontDescription.textRenderingMode(), &fontFaceFeatures, &fontFaceVariantSettings, fontDescription.featureSettings(), fontDescription.variantSettings());
</ins><span class="cx"> return FontPlatformData(font.get(), size, bold, italic, orientation, widthVariant, fontDescription.textRenderingMode());
</span><span class="cx"> #else
</span><ins>+ UNUSED_PARAM(fontFaceFeatures);
+ UNUSED_PARAM(fontFaceVariantSettings);
</ins><span class="cx"> return FontPlatformData(m_cgFont.get(), size, bold, italic, orientation, widthVariant, fontDescription.textRenderingMode());
</span><span class="cx"> #endif
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontCustomPlatformDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCustomPlatformData.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -33,6 +33,7 @@
</span><span class="cx"> namespace WebCore {
</span><span class="cx">
</span><span class="cx"> class FontDescription;
</span><ins>+class FontFeatureSettings;
</ins><span class="cx"> class FontPlatformData;
</span><span class="cx"> class SharedBuffer;
</span><span class="cx">
</span><span class="lines">@@ -51,7 +52,7 @@
</span><span class="cx">
</span><span class="cx"> ~FontCustomPlatformData();
</span><span class="cx">
</span><del>- FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic);
</del><ins>+ FontPlatformData fontPlatformData(const FontDescription&, bool bold, bool italic, const FontFeatureSettings& fontFaceFeatures, const FontVariantSettings& fontFaceVariantSettings);
</ins><span class="cx">
</span><span class="cx"> static bool supportsFormat(const String&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextFlagsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextFlags.h (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextFlags.h        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/platform/text/TextFlags.h        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -149,6 +149,59 @@
</span><span class="cx"> };
</span><span class="cx">
</span><span class="cx"> struct FontVariantSettings {
</span><ins>+ FontVariantSettings()
+ : commonLigatures(FontVariantLigatures::Normal)
+ , discretionaryLigatures(FontVariantLigatures::Normal)
+ , historicalLigatures(FontVariantLigatures::Normal)
+ , contextualAlternates(FontVariantLigatures::Normal)
+ , position(FontVariantPosition::Normal)
+ , caps(FontVariantCaps::Normal)
+ , numericFigure(FontVariantNumericFigure::Normal)
+ , numericSpacing(FontVariantNumericSpacing::Normal)
+ , numericFraction(FontVariantNumericFraction::Normal)
+ , numericOrdinal(FontVariantNumericOrdinal::Normal)
+ , numericSlashedZero(FontVariantNumericSlashedZero::Normal)
+ , alternates(FontVariantAlternates::Normal)
+ , eastAsianVariant(FontVariantEastAsianVariant::Normal)
+ , eastAsianWidth(FontVariantEastAsianWidth::Normal)
+ , eastAsianRuby(FontVariantEastAsianRuby::Normal)
+ {
+ }
+
+ FontVariantSettings(
+ FontVariantLigatures commonLigatures,
+ FontVariantLigatures discretionaryLigatures,
+ FontVariantLigatures historicalLigatures,
+ FontVariantLigatures contextualAlternates,
+ FontVariantPosition position,
+ FontVariantCaps caps,
+ FontVariantNumericFigure numericFigure,
+ FontVariantNumericSpacing numericSpacing,
+ FontVariantNumericFraction numericFraction,
+ FontVariantNumericOrdinal numericOrdinal,
+ FontVariantNumericSlashedZero numericSlashedZero,
+ FontVariantAlternates alternates,
+ FontVariantEastAsianVariant eastAsianVariant,
+ FontVariantEastAsianWidth eastAsianWidth,
+ FontVariantEastAsianRuby eastAsianRuby)
+ : commonLigatures(commonLigatures)
+ , discretionaryLigatures(discretionaryLigatures)
+ , historicalLigatures(historicalLigatures)
+ , contextualAlternates(contextualAlternates)
+ , position(position)
+ , caps(caps)
+ , numericFigure(numericFigure)
+ , numericSpacing(numericSpacing)
+ , numericFraction(numericFraction)
+ , numericOrdinal(numericOrdinal)
+ , numericSlashedZero(numericSlashedZero)
+ , alternates(alternates)
+ , eastAsianVariant(eastAsianVariant)
+ , eastAsianWidth(eastAsianWidth)
+ , eastAsianRuby(eastAsianRuby)
+ {
+ }
+
</ins><span class="cx"> bool isAllNormal() const
</span><span class="cx"> {
</span><span class="cx"> return commonLigatures == FontVariantLigatures::Normal
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderThemeIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderThemeIOS.mm (191967 => 191968)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-11-03 20:27:35 UTC (rev 191967)
+++ trunk/Source/WebCore/rendering/RenderThemeIOS.mm        2015-11-03 20:31:33 UTC (rev 191968)
</span><span class="lines">@@ -1224,7 +1224,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 = preparePlatformFont(font.get(), fontDescription.textRenderingMode(), fontDescription.featureSettings(), fontDescription.variantSettings());
</del><ins>+ font = preparePlatformFont(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>