<!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>[192732] 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/192732">192732</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2015-11-22 09:06:35 -0800 (Sun, 22 Nov 2015)</dd>
</dl>
<h3>Log Message</h3>
<pre>Font selection should not consult font-variant property
https://bugs.webkit.org/show_bug.cgi?id=151537
Reviewed by Simon Fraser.
Source/WebCore:
In section 4.7 of the CSS Fonts Level 3 spec, it says "[The font-variant and
font-feature-settings] do not affect font selection."
All the other browsers (Chrome, Firefox, and Edge) all obey the spec here. We
are the only one who misbehaves. This patch aligns our behavior with the other
browsers.
Test: fast/text/font-selection-font-variant.html
* css/CSSFontSelector.cpp:
(WebCore::computeTraitsMask): Deleted.
(WebCore::compareFontFaces): Deleted.
(WebCore::CSSFontSelector::getFontFace): Deleted.
* css/CSSParser.cpp:
(WebCore::isValidKeywordPropertyAndValue):
(WebCore::isKeywordPropertyID):
(WebCore::CSSParser::createFontFaceRule):
(WebCore::CSSParser::CSSParser): Deleted.
(WebCore::CSSParser::parseValue): Deleted.
(WebCore::CSSParser::parseDeclaration): Deleted.
(WebCore::CSSParser::clearProperties): Deleted.
(WebCore::CSSParser::parseFontVariant): Deleted.
(WebCore::CSSParser::createStyleRule): Deleted.
(WebCore::CSSParser::deleteFontFaceOnlyValues): Deleted.
* css/CSSParser.h:
* platform/graphics/FontDescription.cpp:
(WebCore::FontDescription::traitsMask): Deleted.
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::traitsInFamilyEnumProc):
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::toTraitsMask):
* platform/text/TextFlags.h:
LayoutTests:
* fast/text/font-selection-font-variant-expected.html: Added.
* fast/text/font-selection-font-variant.html: Added.</pre>
<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontSelectorcpp">trunk/Source/WebCore/css/CSSFontSelector.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDescriptioncpp">trunk/Source/WebCore/platform/graphics/FontDescription.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp">trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinFontCacheWincpp">trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextFlagsh">trunk/Source/WebCore/platform/text/TextFlags.h</a></li>
</ul>
<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextfontselectionfontvariantexpectedhtml">trunk/LayoutTests/fast/text/font-selection-font-variant-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextfontselectionfontvarianthtml">trunk/LayoutTests/fast/text/font-selection-font-variant.html</a></li>
</ul>
</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/LayoutTests/ChangeLog        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -1 +1,11 @@
</span><ins>+2015-11-22 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Font selection should not consult font-variant property
+ https://bugs.webkit.org/show_bug.cgi?id=151537
+
+ Reviewed by Simon Fraser.
+
+ * fast/text/font-selection-font-variant-expected.html: Added.
+ * fast/text/font-selection-font-variant.html: Added.
+
</ins><span class="cx"> == Rolled over to ChangeLog-2015-11-21 ==
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextfontselectionfontvariantexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/font-selection-font-variant-expected.html (0 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/font-selection-font-variant-expected.html         (rev 0)
+++ trunk/LayoutTests/fast/text/font-selection-font-variant-expected.html        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -0,0 +1,36 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "Test1";
+ src: url("../writing-mode/resources/MakibaFont13.ttf") format("truetype");
+}
+@font-face {
+ font-family: "Test2";
+ src: url("../../resources/Ahem.ttf") format("truetype");
+}
+.test {
+ display: inline-block;
+ font-size: 40px;
+}
+</style>
+</head>
+<body>
+<p>This test makes sure that font-variant is not consulted when performing font selection.</p>
+<div class="test" style="font-family: Test2;">Hello</div>
+<div class="test" style="font-family: Test2;">Hello</div>
+<div class="test" style="font-family: Test2; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test2; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test2;">Hello</div>
+<div class="test" style="font-family: Test2;">Hello</div>
+<div class="test" style="font-family: Test2; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test2; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test1;">Hello</div>
+<div class="test" style="font-family: Test1;">Hello</div>
+<div class="test" style="font-family: Test1; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test1; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Times;">Hello</div>
+<div class="test" style="font-family: Times; font-variant: small-caps;">Hello</div>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextfontselectionfontvarianthtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/font-selection-font-variant.html (0 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/font-selection-font-variant.html         (rev 0)
+++ trunk/LayoutTests/fast/text/font-selection-font-variant.html        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -0,0 +1,55 @@
</span><ins>+<!DOCTYPE html>
+<html>
+<head>
+<style>
+@font-face {
+ font-family: "Test1";
+ src: url("../writing-mode/resources/MakibaFont13.ttf") format("truetype");
+}
+@font-face {
+ font-family: "Test1";
+ src: url("../../resources/Ahem.ttf") format("truetype");
+ font-variant: small-caps;
+}
+@font-face {
+ font-family: "Test2";
+ src: url("../writing-mode/resources/MakibaFont13.ttf") format("truetype");
+ font-variant: small-caps;
+}
+@font-face {
+ font-family: "Test2";
+ src: url("../../resources/Ahem.ttf") format("truetype");
+}
+@font-face {
+ font-family: "Test3";
+ src: url("../writing-mode/resources/MakibaFont13.ttf") format("truetype");
+}
+@font-face {
+ font-family: "Test3SmallCaps";
+ src: url("../writing-mode/resources/MakibaFont13.ttf") format("truetype");
+ font-variant: small-caps;
+}
+.test {
+ display: inline-block;
+ font-size: 40px;
+}
+</style>
+</head>
+<body>
+<p>This test makes sure that font-variant is not consulted when performing font selection.</p>
+<div class="test" style="font-family: Test1;">Hello</div>
+<div class="test" style="font-family: Test1;">Hello</div>
+<div class="test" style="font-family: Test1; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test1; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test2;">Hello</div>
+<div class="test" style="font-family: Test2;">Hello</div>
+<div class="test" style="font-family: Test2; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test2; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test3;">Hello</div>
+<div class="test" style="font-family: Test3SmallCaps;">Hello</div>
+<div class="test" style="font-family: Test3; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Test3SmallCaps; font-variant: small-caps;">Hello</div>
+<div class="test" style="font-family: Times;">Hello</div>
+<div class="test" style="font-family: Times; font-variant: small-caps;">Hello</div>
+</body>
+</html>
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/ChangeLog        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -1,3 +1,43 @@
</span><ins>+2015-11-22 Myles C. Maxfield <mmaxfield@apple.com>
+
+ Font selection should not consult font-variant property
+ https://bugs.webkit.org/show_bug.cgi?id=151537
+
+ Reviewed by Simon Fraser.
+
+ In section 4.7 of the CSS Fonts Level 3 spec, it says "[The font-variant and
+ font-feature-settings] do not affect font selection."
+
+ All the other browsers (Chrome, Firefox, and Edge) all obey the spec here. We
+ are the only one who misbehaves. This patch aligns our behavior with the other
+ browsers.
+
+ Test: fast/text/font-selection-font-variant.html
+
+ * css/CSSFontSelector.cpp:
+ (WebCore::computeTraitsMask): Deleted.
+ (WebCore::compareFontFaces): Deleted.
+ (WebCore::CSSFontSelector::getFontFace): Deleted.
+ * css/CSSParser.cpp:
+ (WebCore::isValidKeywordPropertyAndValue):
+ (WebCore::isKeywordPropertyID):
+ (WebCore::CSSParser::createFontFaceRule):
+ (WebCore::CSSParser::CSSParser): Deleted.
+ (WebCore::CSSParser::parseValue): Deleted.
+ (WebCore::CSSParser::parseDeclaration): Deleted.
+ (WebCore::CSSParser::clearProperties): Deleted.
+ (WebCore::CSSParser::parseFontVariant): Deleted.
+ (WebCore::CSSParser::createStyleRule): Deleted.
+ (WebCore::CSSParser::deleteFontFaceOnlyValues): Deleted.
+ * css/CSSParser.h:
+ * platform/graphics/FontDescription.cpp:
+ (WebCore::FontDescription::traitsMask): Deleted.
+ * platform/graphics/win/FontCacheWin.cpp:
+ (WebCore::traitsInFamilyEnumProc):
+ * platform/graphics/cocoa/FontCacheCoreText.cpp:
+ (WebCore::toTraitsMask):
+ * platform/text/TextFlags.h:
+
</ins><span class="cx"> 2015-11-22 Carlos Garcia Campos <cgarcia@igalia.com>
</span><span class="cx">
</span><span class="cx"> Unreviewed, rolling out r192727.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -149,35 +149,6 @@
</span><span class="cx"> } else
</span><span class="cx"> traitsMask |= FontWeight400Mask;
</span><span class="cx">
</span><del>- if (RefPtr<CSSValue> fontVariant = style.getPropertyCSSValue(CSSPropertyFontVariant)) {
- // font-variant descriptor can be a value list.
- if (fontVariant->isPrimitiveValue()) {
- RefPtr<CSSValueList> list = CSSValueList::createCommaSeparated();
- list->append(fontVariant.releaseNonNull());
- fontVariant = list.releaseNonNull();
- } else if (!is<CSSValueList>(*fontVariant))
- return Nullopt;
-
- CSSValueList& variantList = downcast<CSSValueList>(*fontVariant);
- unsigned numVariants = variantList.length();
- if (!numVariants)
- return Nullopt;
-
- for (unsigned i = 0; i < numVariants; ++i) {
- switch (downcast<CSSPrimitiveValue>(variantList.itemWithoutBoundsCheck(i))->getValueID()) {
- case CSSValueNormal:
- traitsMask |= FontVariantNormalMask;
- break;
- case CSSValueSmallCaps:
- traitsMask |= FontVariantSmallCapsMask;
- break;
- default:
- break;
- }
- }
- } else
- traitsMask |= FontVariantMask;
-
</del><span class="cx"> return static_cast<FontTraitsMask>(traitsMask);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -427,22 +398,6 @@
</span><span class="cx"> FontTraitsMask firstTraitsMask = first.traitsMask();
</span><span class="cx"> FontTraitsMask secondTraitsMask = second.traitsMask();
</span><span class="cx">
</span><del>- bool firstHasDesiredVariant = firstTraitsMask & desiredTraitsMaskForComparison & FontVariantMask;
- bool secondHasDesiredVariant = secondTraitsMask & desiredTraitsMaskForComparison & FontVariantMask;
-
- if (firstHasDesiredVariant != secondHasDesiredVariant)
- return firstHasDesiredVariant;
-
- // We need to check font-variant css property for CSS2.1 compatibility.
- if ((desiredTraitsMaskForComparison & FontVariantSmallCapsMask) && !first.isLocalFallback() && !second.isLocalFallback()) {
- // Prefer a font that has indicated that it can only support small-caps to a font that claims to support
- // all variants. The specialized font is more likely to be true small-caps and not require synthesis.
- bool firstRequiresSmallCaps = (firstTraitsMask & FontVariantSmallCapsMask) && !(firstTraitsMask & FontVariantNormalMask);
- bool secondRequiresSmallCaps = (secondTraitsMask & FontVariantSmallCapsMask) && !(secondTraitsMask & FontVariantNormalMask);
- if (firstRequiresSmallCaps != secondRequiresSmallCaps)
- return firstRequiresSmallCaps;
- }
-
</del><span class="cx"> bool firstHasDesiredStyle = firstTraitsMask & desiredTraitsMaskForComparison & FontStyleMask;
</span><span class="cx"> bool secondHasDesiredStyle = secondTraitsMask & desiredTraitsMaskForComparison & FontStyleMask;
</span><span class="cx">
</span><span class="lines">@@ -539,14 +494,6 @@
</span><span class="cx"> unsigned candidateTraitsMask = candidate.traitsMask();
</span><span class="cx"> if ((traitsMask & FontStyleNormalMask) && !(candidateTraitsMask & FontStyleNormalMask))
</span><span class="cx"> continue;
</span><del>- if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask))
- continue;
-#if ENABLE(SVG_FONTS)
- // For SVG Fonts that specify that they only support the "normal" variant, we will assume they are incapable
- // of small-caps synthesis and just ignore the font face as a candidate.
- if (candidate.hasSVGFontFaceSource() && (traitsMask & FontVariantSmallCapsMask) && !(candidateTraitsMask & FontVariantSmallCapsMask))
- continue;
-#endif
</del><span class="cx"> candidateFontFaces.append(candidate);
</span><span class="cx"> }
</span><span class="cx">
</span><span class="lines">@@ -556,8 +503,6 @@
</span><span class="cx"> unsigned candidateTraitsMask = candidate->traitsMask();
</span><span class="cx"> if ((traitsMask & FontStyleNormalMask) && !(candidateTraitsMask & FontStyleNormalMask))
</span><span class="cx"> continue;
</span><del>- if ((traitsMask & FontVariantNormalMask) && !(candidateTraitsMask & FontVariantNormalMask))
- continue;
</del><span class="cx"> candidateFontFaces.append(candidate);
</span><span class="cx"> }
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -323,7 +323,6 @@
</span><span class="cx"> , m_inParseShorthand(0)
</span><span class="cx"> , m_currentShorthand(CSSPropertyInvalid)
</span><span class="cx"> , m_implicitShorthand(false)
</span><del>- , m_hasFontFaceOnlyValues(false)
</del><span class="cx"> , m_hadSyntacticallyValidCSSRule(false)
</span><span class="cx"> , m_logErrors(false)
</span><span class="cx"> , m_ignoreErrorsInDeclaration(false)
</span><span class="lines">@@ -1064,6 +1063,10 @@
</span><span class="cx"> if (valueID == CSSValueNormal || valueID == CSSValueHistoricalForms)
</span><span class="cx"> return true;
</span><span class="cx"> break;
</span><ins>+ case CSSPropertyFontVariant: // normal | small-caps
+ if (valueID == CSSValueNormal || valueID == CSSValueSmallCaps)
+ return true;
+ break;
</ins><span class="cx"> default:
</span><span class="cx"> ASSERT_NOT_REACHED();
</span><span class="cx"> return false;
</span><span class="lines">@@ -1196,6 +1199,7 @@
</span><span class="cx"> case CSSPropertyFontVariantPosition:
</span><span class="cx"> case CSSPropertyFontVariantCaps:
</span><span class="cx"> case CSSPropertyFontVariantAlternates:
</span><ins>+ case CSSPropertyFontVariant:
</ins><span class="cx"> return true;
</span><span class="cx"> default:
</span><span class="cx"> return false;
</span><span class="lines">@@ -1400,8 +1404,6 @@
</span><span class="cx"> m_rule = nullptr;
</span><span class="cx">
</span><span class="cx"> ParseResult result = ParseResult::Error;
</span><del>- if (m_hasFontFaceOnlyValues)
- deleteFontFaceOnlyValues();
</del><span class="cx">
</span><span class="cx"> if (!m_parsedProperties.isEmpty()) {
</span><span class="cx"> result = declaration->addParsedProperties(m_parsedProperties) ? ParseResult::Changed : ParseResult::Unchanged;
</span><span class="lines">@@ -1494,9 +1496,6 @@
</span><span class="cx"> cssyyparse(this);
</span><span class="cx"> m_rule = nullptr;
</span><span class="cx">
</span><del>- if (m_hasFontFaceOnlyValues)
- deleteFontFaceOnlyValues();
-
</del><span class="cx"> Ref<ImmutableStyleProperties> style = createStyleProperties();
</span><span class="cx"> clearProperties();
</span><span class="cx"> return style;
</span><span class="lines">@@ -1521,8 +1520,6 @@
</span><span class="cx"> m_rule = nullptr;
</span><span class="cx">
</span><span class="cx"> bool ok = false;
</span><del>- if (m_hasFontFaceOnlyValues)
- deleteFontFaceOnlyValues();
</del><span class="cx"> if (!m_parsedProperties.isEmpty()) {
</span><span class="cx"> ok = true;
</span><span class="cx"> declaration->addParsedProperties(m_parsedProperties);
</span><span class="lines">@@ -1699,7 +1696,6 @@
</span><span class="cx"> {
</span><span class="cx"> m_parsedProperties.clear();
</span><span class="cx"> m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;
</span><del>- m_hasFontFaceOnlyValues = false;
</del><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> URL CSSParser::completeURL(const CSSParserContext& context, const String& url)
</span><span class="lines">@@ -2371,9 +2367,6 @@
</span><span class="cx"> case CSSPropertyFontSize:
</span><span class="cx"> return parseFontSize(important);
</span><span class="cx">
</span><del>- case CSSPropertyFontVariant: // normal | small-caps | inherit
- return parseFontVariant(important);
-
</del><span class="cx"> case CSSPropertyVerticalAlign:
</span><span class="cx"> // baseline | sub | super | top | text-top | middle | bottom | text-bottom |
</span><span class="cx"> // <percentage> | <length> | inherit
</span><span class="lines">@@ -7034,53 +7027,6 @@
</span><span class="cx"> return validPrimitive;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-bool CSSParser::parseFontVariant(bool important)
-{
- RefPtr<CSSValueList> values;
- if (m_valueList->size() > 1)
- values = CSSValueList::createCommaSeparated();
- CSSParserValue* val;
- bool expectComma = false;
- while ((val = m_valueList->current())) {
- RefPtr<CSSPrimitiveValue> parsedValue;
- if (!expectComma) {
- expectComma = true;
- if (val->id == CSSValueNormal || val->id == CSSValueSmallCaps)
- parsedValue = CSSValuePool::singleton().createIdentifierValue(val->id);
- else if (val->id == CSSValueAll && !values) {
- // 'all' is only allowed in @font-face and with no other values. Make a value list to
- // indicate that we are in the @font-face case.
- values = CSSValueList::createCommaSeparated();
- parsedValue = CSSValuePool::singleton().createIdentifierValue(val->id);
- }
- } else if (val->unit == CSSParserValue::Operator && val->iValue == ',') {
- expectComma = false;
- m_valueList->next();
- continue;
- }
-
- if (!parsedValue)
- return false;
-
- m_valueList->next();
-
- if (values)
- values->append(parsedValue.releaseNonNull());
- else {
- addProperty(CSSPropertyFontVariant, parsedValue.release(), important);
- return true;
- }
- }
-
- if (values && values->length()) {
- m_hasFontFaceOnlyValues = true;
- addProperty(CSSPropertyFontVariant, values.release(), important);
- return true;
- }
-
- return false;
-}
-
</del><span class="cx"> static CSSValueID createFontWeightValueKeyword(int weight)
</span><span class="cx"> {
</span><span class="cx"> ASSERT(!(weight % 100) && weight >= 100 && weight <= 900);
</span><span class="lines">@@ -12642,8 +12588,6 @@
</span><span class="cx"> if (selectors) {
</span><span class="cx"> m_allowImportRules = false;
</span><span class="cx"> m_allowNamespaceDeclarations = false;
</span><del>- if (m_hasFontFaceOnlyValues)
- deleteFontFaceOnlyValues();
</del><span class="cx"> rule = StyleRule::create(m_lastSelectorLineNumber, createStyleProperties());
</span><span class="cx"> rule->parserAdoptSelectorVector(*selectors);
</span><span class="cx"> processAndAddNewRuleToSourceTreeIfNeeded();
</span><span class="lines">@@ -12658,9 +12602,7 @@
</span><span class="cx"> m_allowImportRules = m_allowNamespaceDeclarations = false;
</span><span class="cx"> for (unsigned i = 0; i < m_parsedProperties.size(); ++i) {
</span><span class="cx"> CSSProperty& property = m_parsedProperties[i];
</span><del>- if (property.id() == CSSPropertyFontVariant && property.value()->isPrimitiveValue())
- property.wrapValueInCommaSeparatedList();
- else if (property.id() == CSSPropertyFontFamily && (!is<CSSValueList>(*property.value()) || downcast<CSSValueList>(*property.value()).length() != 1)) {
</del><ins>+ if (property.id() == CSSPropertyFontFamily && (!is<CSSValueList>(*property.value()) || downcast<CSSValueList>(*property.value()).length() != 1)) {
</ins><span class="cx"> // Unlike font-family property, font-family descriptor in @font-face rule
</span><span class="cx"> // has to be a value list with exactly one family name. It cannot have a
</span><span class="cx"> // have 'initial' value and cannot 'inherit' from parent.
</span><span class="lines">@@ -12818,14 +12760,6 @@
</span><span class="cx"> m_numParsedPropertiesBeforeMarginBox = INVALID_NUM_PARSED_PROPERTIES;
</span><span class="cx"> }
</span><span class="cx">
</span><del>-void CSSParser::deleteFontFaceOnlyValues()
-{
- ASSERT(m_hasFontFaceOnlyValues);
- m_parsedProperties.removeAllMatching([] (const CSSProperty& property) {
- return property.id() == CSSPropertyFontVariant && property.value()->isValueList();
- });
-}
-
</del><span class="cx"> RefPtr<StyleKeyframe> CSSParser::createKeyframe(CSSParserValueList& keys)
</span><span class="cx"> {
</span><span class="cx"> // Create a key string from the passed keys
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/css/CSSParser.h        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -265,7 +265,6 @@
</span><span class="cx">
</span><span class="cx"> bool parseLineHeight(bool important);
</span><span class="cx"> bool parseFontSize(bool important);
</span><del>- bool parseFontVariant(bool important);
</del><span class="cx"> bool parseFontWeight(bool important);
</span><span class="cx"> bool parseFontSynthesis(bool important);
</span><span class="cx"> bool parseFontFaceSrc();
</span><span class="lines">@@ -417,7 +416,6 @@
</span><span class="cx"> CSSPropertyID m_currentShorthand;
</span><span class="cx"> bool m_implicitShorthand;
</span><span class="cx">
</span><del>- bool m_hasFontFaceOnlyValues;
</del><span class="cx"> bool m_hadSyntacticallyValidCSSRule;
</span><span class="cx"> bool m_logErrors;
</span><span class="cx"> bool m_ignoreErrorsInDeclaration;
</span><span class="lines">@@ -565,8 +563,6 @@
</span><span class="cx">
</span><span class="cx"> bool isValidSize(ValueWithCalculation&);
</span><span class="cx">
</span><del>- void deleteFontFaceOnlyValues();
-
</del><span class="cx"> bool isGeneratedImageValue(CSSParserValue&) const;
</span><span class="cx"> bool parseGeneratedImage(CSSParserValueList&, RefPtr<CSSValue>&);
</span><span class="cx">
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDescriptioncpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontDescription.cpp (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontDescription.cpp        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.cpp        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -79,7 +79,6 @@
</span><span class="cx"> FontTraitsMask FontDescription::traitsMask() const
</span><span class="cx"> {
</span><span class="cx"> return static_cast<FontTraitsMask>((m_italic ? FontStyleItalicMask : FontStyleNormalMask)
</span><del>- | (m_smallCaps ? FontVariantSmallCapsMask : FontVariantNormalMask)
</del><span class="cx"> | (FontWeight100Mask << (m_weight - FontWeight100)));
</span><span class="cx">
</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 (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -476,8 +476,7 @@
</span><span class="cx"> weightMask = FontWeight900Mask;
</span><span class="cx"> break;
</span><span class="cx"> }
</span><del>- return static_cast<FontTraitsMask>(((ctFontTraits & kCTFontTraitItalic) ? FontStyleItalicMask : FontStyleNormalMask)
- | FontVariantNormalMask | weightMask);
</del><ins>+ return static_cast<FontTraitsMask>(((ctFontTraits & kCTFontTraitItalic) ? FontStyleItalicMask : FontStyleNormalMask) | weightMask);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> bool isFontWeightBold(FontWeight fontWeight)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinFontCacheWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -528,7 +528,6 @@
</span><span class="cx">
</span><span class="cx"> unsigned traitsMask = 0;
</span><span class="cx"> traitsMask |= logFont->lfItalic ? FontStyleItalicMask : FontStyleNormalMask;
</span><del>- traitsMask |= FontVariantNormalMask;
</del><span class="cx"> LONG weight = adjustedGDIFontWeight(logFont->lfWeight, procData->m_familyName);
</span><span class="cx"> traitsMask |= weight == FW_THIN ? FontWeight100Mask :
</span><span class="cx"> weight == FW_EXTRALIGHT ? FontWeight200Mask :
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextFlagsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextFlags.h (192731 => 192732)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextFlags.h        2015-11-22 10:48:48 UTC (rev 192731)
+++ trunk/Source/WebCore/platform/text/TextFlags.h        2015-11-22 17:06:35 UTC (rev 192732)
</span><span class="lines">@@ -277,8 +277,6 @@
</span><span class="cx"> enum {
</span><span class="cx"> FontStyleNormalBit = 0,
</span><span class="cx"> FontStyleItalicBit,
</span><del>- FontVariantNormalBit,
- FontVariantSmallCapsBit,
</del><span class="cx"> FontWeight100Bit,
</span><span class="cx"> FontWeight200Bit,
</span><span class="cx"> FontWeight300Bit,
</span><span class="lines">@@ -296,10 +294,6 @@
</span><span class="cx"> FontStyleItalicMask = 1 << FontStyleItalicBit,
</span><span class="cx"> FontStyleMask = FontStyleNormalMask | FontStyleItalicMask,
</span><span class="cx">
</span><del>- FontVariantNormalMask = 1 << FontVariantNormalBit,
- FontVariantSmallCapsMask = 1 << FontVariantSmallCapsBit,
- FontVariantMask = FontVariantNormalMask | FontVariantSmallCapsMask,
-
</del><span class="cx"> FontWeight100Mask = 1 << FontWeight100Bit,
</span><span class="cx"> FontWeight200Mask = 1 << FontWeight200Bit,
</span><span class="cx"> FontWeight300Mask = 1 << FontWeight300Bit,
</span></span></pre>
</div>
</div>
</body>
</html>