<!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>[179100] 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/179100">179100</a></dd>
<dt>Author</dt> <dd>cdumez@apple.com</dd>
<dt>Date</dt> <dd>2015-01-25 18:11:14 -0800 (Sun, 25 Jan 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Remove 'font' shorthand property special casing
https://bugs.webkit.org/show_bug.cgi?id=140577

Reviewed by Darin Adler.

Source/WebCore:

Expand system font values during 'font' property parsing. The 'font'
CSS property was the only shorthand that wasn't always expanded in
the CSS parser, so it needed a lot of special handling that we can
now get rid of.

This patch is inspired from the following Blink revision:
https://src.chromium.org/viewvc/blink?view=rev&amp;revision=184449

Tests:
- fast/css/css2-system-fonts.html (existing)
- fast/css/CSSPrimitiveValue-font-family-primitiveType.html (new)
- fast/css/font-systemFontID-parsing.html (new)
- fast/css/font-shorthand-line-height.html (rebased)

* WebCore.xcodeproj/project.pbxproj:
* css/CSSCalculationValue.cpp:
(WebCore::hasDoubleValue):
Handle CSS_FONT_FAMILY similarly to CSS_STRING in the switch.

* css/CSSFontFamily.h: Added.
Introduce new CSSFontFamily class to store font families inside
CSSPrimitive, instead of using a simple String as previously. We need
an additional 'fromSystemFontID' flag in addition to the font family
name now that system font ID are expanded during parsing. This
information is needed later on by the StyleBuilder (see comment below).

* css/CSSFontSelector.cpp:
(WebCore::CSSFontSelector::addFontFaceRule):
Update code dealing with font family CSSPrimitiveValues now that they
hold a CSSFontFamily internally instead of a String.

* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseSystemFont):
Expand system font values for the 'font' property by asking the
RenderTheme for the system font and using it to set the 'font'
longhand properties.

* css/CSSParserValues.cpp:
(WebCore::CSSParserValue::createCSSValue):
Handle CSS_FONT_FAMILY value in the switch.

* css/CSSPrimitiveValue.cpp:
(WebCore::CSSPrimitiveValue::primitiveType):
Make sure we still expose font family CSSPrimitiveValues to the Web as
CSS_STRING, even though we are using a slightly different representation
internally. This is so that we don't change web-exposed behavior and I
added a new layout test to cover this.

(WebCore::isValidCSSUnitTypeForDoubleConversion):
(WebCore::CSSPrimitiveValue::cleanup):
(WebCore::CSSPrimitiveValue::getStringValue):
(WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
(WebCore::CSSPrimitiveValue::cloneForCSSOM):
(WebCore::CSSPrimitiveValue::equals):
Handle CSS_FONT_FAMILY type in switches.

* css/CSSPrimitiveValue.h:
(WebCore::CSSPrimitiveValue::isFontFamily):
Add method to test if a CSSPrimitiveValue holds a CSSFontFamily
internally.

(WebCore::CSSPrimitiveValue::fontFamily):
Add a getter to retrieve the internal CSSFontFamily object if the
primitive type is CSS_FONT_FAMILY.

* css/CSSPropertyNames.in:
Treat 'font' as a regular shorthand property. Specify its longhand
properties so that makeprop.pl can generate the shorthand code for
us. Also demote 'font' to being a low-priority property as it is
now always expanded during parsing.

* css/CSSValuePool.cpp:
(WebCore::CSSValuePool::createFontFamilyValue):
* css/CSSValuePool.h:
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontFamily):
- Update the 'font-family' value setter in the StyleBuilder to reflect
the changes in the CSS parser. The CSSPrimitiveValues in the list now
have CSS_FONT_FAMILY type instead of CSS_STRING.
- We also set the 'isGenericFamily' flag if the font-family was expanded
  from a system font ID (e.g. caption). The 'isGenericFamily' flag is
  used later on to property set the 'isSpecifiedFont' flag on the
  FontDescription object. If we don't do this, system font values will
  be treated as specified fonts, which means that we will no longer use
  the 'use backslash as Yen sign' hack for those. This is covered by the
  following layout tests:
  - fast/text/backslash-to-yen-sign-euc.html
  - editing/selection/find-yensign-and-backslash.html

(WebCore::StyleBuilderCustom::applyInitialFont): Deleted.
(WebCore::StyleBuilderCustom::applyInheritFont): Deleted.
(WebCore::StyleBuilderCustom::applyValueFont): Deleted.
Remove StyleBuilder code dealing with the 'font' property. Now that
the 'font' property is always expanded during parsing, this code can
never be reached.

* css/StylePropertyShorthand.cpp:
(WebCore::isExpandedShorthand):
Stop returning false for 'font' as it is now expanded during parsing
as well. We should probably consider renaming this method to something
else now that all shorthands are expanded, maybe isCSSShorthand() or
isShorthandProperty().

(WebCore::fontShorthand): Deleted.
* css/StylePropertyShorthand.h:
(WebCore::matchingCustomShorthandsForLonghand): Deleted.
Remove custom shorthand code for the 'font' property as it is now
generated by makeprop.pl, like other shorthands.

* css/StyleResolver.cpp:
(WebCore::StyleResolver::applyFont): Deleted.
This is unused now that the StyleBuilder code for 'font' has been
removed.

* css/makeprop.pl:
Remove custom shorthand code for 'font' as it no longer requires any
special handling.

LayoutTests:

* fast/css/CSSPrimitiveValue-font-family-primitiveType-expected.txt: Added.
* fast/css/CSSPrimitiveValue-font-family-primitiveType.html: Added.
Add layout test to make sure that the font-family is still exposed to the
Web as a CSSValueList of CSSPrimitiveValues whose primitiveType is
CSS_STRING. This is useful because we now use a slightly different
representation internally.

* fast/css/font-shorthand-line-height-expected.txt:
* fast/css/font-shorthand-line-height.html:
Rebaseline the test. This is a progression. Setting the 'font' property
to a system font ID is supposed to reset the line-height property to
'normal'. It previously did not because system font IDs were not
expanded at parsing time. The new behavior is consistent with Chrome and
Firefox as well.

* fast/css/font-systemFontID-parsing-expected.txt: Added.
* fast/css/font-systemFontID-parsing.html: Added.
Add a layout test to make sure that the CSS parser is rejecting a 'font'
property with more than one system font id.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssfontshorthandlineheightexpectedtxt">trunk/LayoutTests/fast/css/font-shorthand-line-height-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssfontshorthandlineheighthtml">trunk/LayoutTests/fast/css/font-shorthand-line-height.html</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="#trunkSourceWebCorecssCSSCalculationValuecpp">trunk/Source/WebCore/css/CSSCalculationValue.cpp</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="#trunkSourceWebCorecssCSSParserValuescpp">trunk/Source/WebCore/css/CSSParserValues.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValuecpp">trunk/Source/WebCore/css/CSSPrimitiveValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueh">trunk/Source/WebCore/css/CSSPrimitiveValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPrimitiveValueMappingsh">trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuePoolcpp">trunk/Source/WebCore/css/CSSValuePool.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuePoolh">trunk/Source/WebCore/css/CSSValuePool.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertyShorthandcpp">trunk/Source/WebCore/css/StylePropertyShorthand.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertyShorthandh">trunk/Source/WebCore/css/StylePropertyShorthand.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolverh">trunk/Source/WebCore/css/StyleResolver.h</a></li>
<li><a href="#trunkSourceWebCorecssmakeproppl">trunk/Source/WebCore/css/makeprop.pl</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssCSSPrimitiveValuefontfamilyprimitiveTypeexpectedtxt">trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssCSSPrimitiveValuefontfamilyprimitiveTypehtml">trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType.html</a></li>
<li><a href="#trunkLayoutTestsfastcssfontsystemFontIDparsingexpectedtxt">trunk/LayoutTests/fast/css/font-systemFontID-parsing-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssfontsystemFontIDparsinghtml">trunk/LayoutTests/fast/css/font-systemFontID-parsing.html</a></li>
<li><a href="#trunkSourceWebCorecssCSSFontFamilyh">trunk/Source/WebCore/css/CSSFontFamily.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/LayoutTests/ChangeLog        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2015-01-25  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Remove 'font' shorthand property special casing
+        https://bugs.webkit.org/show_bug.cgi?id=140577
+
+        Reviewed by Darin Adler.
+
+        * fast/css/CSSPrimitiveValue-font-family-primitiveType-expected.txt: Added.
+        * fast/css/CSSPrimitiveValue-font-family-primitiveType.html: Added.
+        Add layout test to make sure that the font-family is still exposed to the
+        Web as a CSSValueList of CSSPrimitiveValues whose primitiveType is
+        CSS_STRING. This is useful because we now use a slightly different
+        representation internally.
+
+        * fast/css/font-shorthand-line-height-expected.txt:
+        * fast/css/font-shorthand-line-height.html:
+        Rebaseline the test. This is a progression. Setting the 'font' property
+        to a system font ID is supposed to reset the line-height property to
+        'normal'. It previously did not because system font IDs were not
+        expanded at parsing time. The new behavior is consistent with Chrome and
+        Firefox as well.
+
+        * fast/css/font-systemFontID-parsing-expected.txt: Added.
+        * fast/css/font-systemFontID-parsing.html: Added.
+        Add a layout test to make sure that the CSS parser is rejecting a 'font'
+        property with more than one system font id.
+
</ins><span class="cx"> 2015-01-25  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Unreviewed gardening.
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssCSSPrimitiveValuefontfamilyprimitiveTypeexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType-expected.txt (0 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType-expected.txt        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -0,0 +1,20 @@
</span><ins>+Test that the font-family CSSValue is a CSSValueList of CSSPrimitiveValues that are of primitive type CSS_STRING.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS fontFamilyCSSValue.__proto__ is CSSValueList.prototype
+PASS fontFamilyCSSValue.length is 3
+PASS fontFamilyCSSValue[0].__proto__ is CSSPrimitiveValue.prototype
+PASS fontFamilyCSSValue[0].primitiveType is CSSPrimitiveValue.CSS_STRING
+PASS fontFamilyCSSValue[0].getStringValue() is &quot;times&quot;
+PASS fontFamilyCSSValue[1].__proto__ is CSSPrimitiveValue.prototype
+PASS fontFamilyCSSValue[1].primitiveType is CSSPrimitiveValue.CSS_STRING
+PASS fontFamilyCSSValue[1].getStringValue() is &quot;courier&quot;
+PASS fontFamilyCSSValue[2].__proto__ is CSSPrimitiveValue.prototype
+PASS fontFamilyCSSValue[2].primitiveType is CSSPrimitiveValue.CSS_STRING
+PASS fontFamilyCSSValue[2].getStringValue() is &quot;arial&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssCSSPrimitiveValuefontfamilyprimitiveTypehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType.html (0 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/CSSPrimitiveValue-font-family-primitiveType.html        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -0,0 +1,30 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;div id=&quot;testDiv&quot; style=&quot;font-family: times, courier, arial&quot;&gt;
+&lt;script&gt;
+description(&quot;Test that the font-family CSSValue is a CSSValueList of CSSPrimitiveValues that are of primitive type CSS_STRING.&quot;);
+
+var testDiv = document.getElementById(&quot;testDiv&quot;);
+var fontFamilyCSSValue = testDiv.style.getPropertyCSSValue('font-family');
+
+shouldBe(&quot;fontFamilyCSSValue.__proto__&quot;, &quot;CSSValueList.prototype&quot;);
+shouldBe(&quot;fontFamilyCSSValue.length&quot;, &quot;3&quot;);
+
+shouldBe(&quot;fontFamilyCSSValue[0].__proto__&quot;, &quot;CSSPrimitiveValue.prototype&quot;);
+shouldBe(&quot;fontFamilyCSSValue[0].primitiveType&quot;, &quot;CSSPrimitiveValue.CSS_STRING&quot;);
+shouldBeEqualToString(&quot;fontFamilyCSSValue[0].getStringValue()&quot;, &quot;times&quot;);
+
+shouldBe(&quot;fontFamilyCSSValue[1].__proto__&quot;, &quot;CSSPrimitiveValue.prototype&quot;);
+shouldBe(&quot;fontFamilyCSSValue[1].primitiveType&quot;, &quot;CSSPrimitiveValue.CSS_STRING&quot;);
+shouldBeEqualToString(&quot;fontFamilyCSSValue[1].getStringValue()&quot;, &quot;courier&quot;);
+
+shouldBe(&quot;fontFamilyCSSValue[2].__proto__&quot;, &quot;CSSPrimitiveValue.prototype&quot;);
+shouldBe(&quot;fontFamilyCSSValue[2].primitiveType&quot;, &quot;CSSPrimitiveValue.CSS_STRING&quot;);
+shouldBeEqualToString(&quot;fontFamilyCSSValue[2].getStringValue()&quot;, &quot;arial&quot;);
+
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssfontshorthandlineheightexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/font-shorthand-line-height-expected.txt (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/font-shorthand-line-height-expected.txt        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/LayoutTests/fast/css/font-shorthand-line-height-expected.txt        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -4,7 +4,7 @@
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="cx"> PASS lineHeight(system_font_1) is '100px'
</span><del>-PASS lineHeight(system_font_2) is '100px'
</del><ins>+PASS lineHeight(system_font_2) is 'normal'
</ins><span class="cx"> PASS lineHeight(shorthand_normal_1) is '100px'
</span><span class="cx"> PASS lineHeight(shorthand_normal_2) is 'normal'
</span><span class="cx"> PASS lineHeight(shorthand_line_height_1) is '100px'
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssfontshorthandlineheighthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css/font-shorthand-line-height.html (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/font-shorthand-line-height.html        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/LayoutTests/fast/css/font-shorthand-line-height.html        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -24,7 +24,7 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     shouldBe(&quot;lineHeight(system_font_1)&quot;, &quot;'100px'&quot;);
</span><del>-    shouldBe(&quot;lineHeight(system_font_2)&quot;, &quot;'100px'&quot;);
</del><ins>+    shouldBe(&quot;lineHeight(system_font_2)&quot;, &quot;'normal'&quot;);
</ins><span class="cx">     shouldBe(&quot;lineHeight(shorthand_normal_1)&quot;, &quot;'100px'&quot;);
</span><span class="cx">     shouldBe(&quot;lineHeight(shorthand_normal_2)&quot;, &quot;'normal'&quot;);
</span><span class="cx">     shouldBe(&quot;lineHeight(shorthand_line_height_1)&quot;, &quot;'100px'&quot;);
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssfontsystemFontIDparsingexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/font-systemFontID-parsing-expected.txt (0 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/font-systemFontID-parsing-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css/font-systemFontID-parsing-expected.txt        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -0,0 +1,11 @@
</span><ins>+Tests 'font' CSS property parsing with system font values.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+PASS testDivInvalid.style.getPropertyCSSValue('font-family') is null
+PASS testDivValid.style.getPropertyCSSValue('font-family') is not null
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssfontsystemFontIDparsinghtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css/font-systemFontID-parsing.html (0 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css/font-systemFontID-parsing.html                                (rev 0)
+++ trunk/LayoutTests/fast/css/font-systemFontID-parsing.html        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -0,0 +1,15 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;body&gt;
+&lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
+&lt;div id=&quot;testDivInvalid&quot; style=&quot;font: caption icon&quot;&gt;&lt;/div&gt;
+&lt;div id=&quot;testDivValid&quot; style=&quot;font: caption&quot;&gt;&lt;/div&gt;
+&lt;script&gt;
+description(&quot;Tests 'font' CSS property parsing with system font values.&quot;);
+
+shouldBeNull(&quot;testDivInvalid.style.getPropertyCSSValue('font-family')&quot;);
+shouldNotBe(&quot;testDivValid.style.getPropertyCSSValue('font-family')&quot;, &quot;null&quot;);
+&lt;/script&gt;
+&lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/ChangeLog        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -1,3 +1,129 @@
</span><ins>+2015-01-25  Chris Dumez  &lt;cdumez@apple.com&gt;
+
+        Remove 'font' shorthand property special casing
+        https://bugs.webkit.org/show_bug.cgi?id=140577
+
+        Reviewed by Darin Adler.
+
+        Expand system font values during 'font' property parsing. The 'font'
+        CSS property was the only shorthand that wasn't always expanded in
+        the CSS parser, so it needed a lot of special handling that we can
+        now get rid of.
+
+        This patch is inspired from the following Blink revision:
+        https://src.chromium.org/viewvc/blink?view=rev&amp;revision=184449
+
+        Tests:
+        - fast/css/css2-system-fonts.html (existing)
+        - fast/css/CSSPrimitiveValue-font-family-primitiveType.html (new)
+        - fast/css/font-systemFontID-parsing.html (new)
+        - fast/css/font-shorthand-line-height.html (rebased)
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * css/CSSCalculationValue.cpp:
+        (WebCore::hasDoubleValue):
+        Handle CSS_FONT_FAMILY similarly to CSS_STRING in the switch.
+
+        * css/CSSFontFamily.h: Added.
+        Introduce new CSSFontFamily class to store font families inside
+        CSSPrimitive, instead of using a simple String as previously. We need
+        an additional 'fromSystemFontID' flag in addition to the font family
+        name now that system font ID are expanded during parsing. This
+        information is needed later on by the StyleBuilder (see comment below).
+
+        * css/CSSFontSelector.cpp:
+        (WebCore::CSSFontSelector::addFontFaceRule):
+        Update code dealing with font family CSSPrimitiveValues now that they
+        hold a CSSFontFamily internally instead of a String.
+
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseSystemFont):
+        Expand system font values for the 'font' property by asking the
+        RenderTheme for the system font and using it to set the 'font'
+        longhand properties.
+
+        * css/CSSParserValues.cpp:
+        (WebCore::CSSParserValue::createCSSValue):
+        Handle CSS_FONT_FAMILY value in the switch.
+
+        * css/CSSPrimitiveValue.cpp:
+        (WebCore::CSSPrimitiveValue::primitiveType):
+        Make sure we still expose font family CSSPrimitiveValues to the Web as
+        CSS_STRING, even though we are using a slightly different representation
+        internally. This is so that we don't change web-exposed behavior and I
+        added a new layout test to cover this.
+
+        (WebCore::isValidCSSUnitTypeForDoubleConversion):
+        (WebCore::CSSPrimitiveValue::cleanup):
+        (WebCore::CSSPrimitiveValue::getStringValue):
+        (WebCore::CSSPrimitiveValue::formatNumberForCustomCSSText):
+        (WebCore::CSSPrimitiveValue::cloneForCSSOM):
+        (WebCore::CSSPrimitiveValue::equals):
+        Handle CSS_FONT_FAMILY type in switches.
+
+        * css/CSSPrimitiveValue.h:
+        (WebCore::CSSPrimitiveValue::isFontFamily):
+        Add method to test if a CSSPrimitiveValue holds a CSSFontFamily
+        internally.
+
+        (WebCore::CSSPrimitiveValue::fontFamily):
+        Add a getter to retrieve the internal CSSFontFamily object if the
+        primitive type is CSS_FONT_FAMILY.
+
+        * css/CSSPropertyNames.in:
+        Treat 'font' as a regular shorthand property. Specify its longhand
+        properties so that makeprop.pl can generate the shorthand code for
+        us. Also demote 'font' to being a low-priority property as it is
+        now always expanded during parsing.
+
+        * css/CSSValuePool.cpp:
+        (WebCore::CSSValuePool::createFontFamilyValue):
+        * css/CSSValuePool.h:
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueFontFamily):
+        - Update the 'font-family' value setter in the StyleBuilder to reflect
+        the changes in the CSS parser. The CSSPrimitiveValues in the list now
+        have CSS_FONT_FAMILY type instead of CSS_STRING.
+        - We also set the 'isGenericFamily' flag if the font-family was expanded
+          from a system font ID (e.g. caption). The 'isGenericFamily' flag is
+          used later on to property set the 'isSpecifiedFont' flag on the
+          FontDescription object. If we don't do this, system font values will
+          be treated as specified fonts, which means that we will no longer use
+          the 'use backslash as Yen sign' hack for those. This is covered by the
+          following layout tests:
+          - fast/text/backslash-to-yen-sign-euc.html
+          - editing/selection/find-yensign-and-backslash.html
+
+        (WebCore::StyleBuilderCustom::applyInitialFont): Deleted.
+        (WebCore::StyleBuilderCustom::applyInheritFont): Deleted.
+        (WebCore::StyleBuilderCustom::applyValueFont): Deleted.
+        Remove StyleBuilder code dealing with the 'font' property. Now that
+        the 'font' property is always expanded during parsing, this code can
+        never be reached.
+
+        * css/StylePropertyShorthand.cpp:
+        (WebCore::isExpandedShorthand):
+        Stop returning false for 'font' as it is now expanded during parsing
+        as well. We should probably consider renaming this method to something
+        else now that all shorthands are expanded, maybe isCSSShorthand() or
+        isShorthandProperty().
+
+        (WebCore::fontShorthand): Deleted.
+        * css/StylePropertyShorthand.h:
+        (WebCore::matchingCustomShorthandsForLonghand): Deleted.
+        Remove custom shorthand code for the 'font' property as it is now
+        generated by makeprop.pl, like other shorthands.
+
+        * css/StyleResolver.cpp:
+        (WebCore::StyleResolver::applyFont): Deleted.
+        This is unused now that the StyleBuilder code for 'font' has been
+        removed.
+
+        * css/makeprop.pl:
+        Remove custom shorthand code for 'font' as it no longer requires any
+        special handling.
+
</ins><span class="cx"> 2015-01-25  Timothy Horton  &lt;timothy_horton@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Long spins under Frame::rangeForPoint when doing Lookup on feedly.com
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -2562,6 +2562,7 @@
</span><span class="cx">                 82E3D8DF122EA0D1003AE5BC /* CSSPropertySourceData.h in Headers */ = {isa = PBXBuildFile; fileRef = 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 832B843419D8E55100B26055 /* SVGAnimateElementBase.h in Headers */ = {isa = PBXBuildFile; fileRef = 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */; };
</span><span class="cx">                 832B843619D8E57400B26055 /* SVGAnimateElementBase.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */; };
</span><ins>+                83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */ = {isa = PBXBuildFile; fileRef = 83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */; };
</ins><span class="cx">                 835D363719FF6193004C93AB /* StyleBuilderCustom.h in Headers */ = {isa = PBXBuildFile; fileRef = 835D363619FF6193004C93AB /* StyleBuilderCustom.h */; };
</span><span class="cx">                 836FBCEA178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */; };
</span><span class="cx">                 836FBCEC178C117F00B21A15 /* SVGAnimatedProperty.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */; };
</span><span class="lines">@@ -9758,6 +9759,7 @@
</span><span class="cx">                 82E3D8DD122EA0D1003AE5BC /* CSSPropertySourceData.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSPropertySourceData.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 832B843319D8E55100B26055 /* SVGAnimateElementBase.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = SVGAnimateElementBase.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 832B843519D8E57400B26055 /* SVGAnimateElementBase.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimateElementBase.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSFontFamily.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 835D363619FF6193004C93AB /* StyleBuilderCustom.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = StyleBuilderCustom.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 836FBCE9178C113200B21A15 /* SVGAnimatedTypeAnimator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedTypeAnimator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 836FBCEB178C117F00B21A15 /* SVGAnimatedProperty.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = SVGAnimatedProperty.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22055,6 +22057,7 @@
</span><span class="cx">                 F523D18402DE42E8018635CA /* css */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                83520C7D1A71BFCC006BD2AA /* CSSFontFamily.h */,
</ins><span class="cx">                                 FBD6AF8415EF21D4008B7110 /* BasicShapeFunctions.cpp */,
</span><span class="cx">                                 FBD6AF8515EF21D4008B7110 /* BasicShapeFunctions.h */,
</span><span class="cx">                                 A80E6CDA0A1989CA007FB8C5 /* Counter.h */,
</span><span class="lines">@@ -23543,6 +23546,7 @@
</span><span class="cx">                                 F59C96001255B23F000623C0 /* BaseDateAndTimeInputType.h in Headers */,
</span><span class="cx">                                 F55B3DAE1251F12D003EF269 /* BaseTextInputType.h in Headers */,
</span><span class="cx">                                 FBD6AF8A15EF25DF008B7110 /* BasicShapeFunctions.h in Headers */,
</span><ins>+                                83520C7E1A71BFCC006BD2AA /* CSSFontFamily.h in Headers */,
</ins><span class="cx">                                 FBD6AF8C15EF2604008B7110 /* BasicShapes.h in Headers */,
</span><span class="cx">                                 BC9462D8107A7B4C00857193 /* BeforeLoadEvent.h in Headers */,
</span><span class="cx">                                 AB23A32809BBA7D00067CC53 /* BeforeTextInsertedEvent.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSCalculationValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSCalculationValue.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSCalculationValue.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSCalculationValue.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -125,6 +125,7 @@
</span><span class="cx">         return true;
</span><span class="cx">     case CSSPrimitiveValue::CSS_UNKNOWN:
</span><span class="cx">     case CSSPrimitiveValue::CSS_STRING:
</span><ins>+    case CSSPrimitiveValue::CSS_FONT_FAMILY:
</ins><span class="cx">     case CSSPrimitiveValue::CSS_URI:
</span><span class="cx">     case CSSPrimitiveValue::CSS_IDENT:
</span><span class="cx">     case CSSPrimitiveValue::CSS_ATTR:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontFamilyh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSFontFamily.h (0 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontFamily.h                                (rev 0)
+++ trunk/Source/WebCore/css/CSSFontFamily.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -0,0 +1,57 @@
</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 CSSFontFamily_h
+#define CSSFontFamily_h
+
+#include &lt;wtf/text/WTFString.h&gt;
+
+namespace WebCore {
+
+// We use a CSSFontFamily instead of a String to store the font family inside CSSPrimitiveValue.
+// This is because require an extra bit to determine if the font family was resolved by the CSS
+// parser from a system font ID (caption | icon | menu | message-box | small-caption |
+// status-bar).
+//
+// This is needed by the StyleBuilder to correctly set the &quot;isSpecifiedFont&quot; flag on the
+// FontDescription. This flag is used to determine if we should do the &quot;use backslash as Yen
+// sign&quot; hack.
+
+enum FromSystemFontIDOrNot { NotFromSystemFontID, FromSystemFontID };
+
+struct CSSFontFamily {
+    String familyName;
+    FromSystemFontIDOrNot fromSystemFontID;
+};
+
+inline bool operator==(const CSSFontFamily&amp; a, const CSSFontFamily&amp; b)
+{
+    return a.familyName == b.familyName &amp;&amp; a.fromSystemFontID == b.fromSystemFontID;
+}
+
+} // namespace WebCore
+
+#endif // CSSFontFamily_h
+
</ins></span></pre></div>
<a id="trunkSourceWebCorecssCSSFontSelectorcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSFontSelector.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSFontSelector.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -32,6 +32,7 @@
</span><span class="cx"> #include &quot;CSSFontFaceRule.h&quot;
</span><span class="cx"> #include &quot;CSSFontFaceSource.h&quot;
</span><span class="cx"> #include &quot;CSSFontFaceSrcValue.h&quot;
</span><ins>+#include &quot;CSSFontFamily.h&quot;
</ins><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="cx"> #include &quot;CSSSegmentedFontFace.h&quot;
</span><span class="lines">@@ -256,16 +257,15 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     // Hash under every single family name.
</span><del>-    int familyLength = familyList.length();
-    for (int i = 0; i &lt; familyLength; i++) {
-        CSSPrimitiveValue* item = downcast&lt;CSSPrimitiveValue&gt;(familyList.itemWithoutBoundsCheck(i));
</del><ins>+    for (auto&amp; item : familyList) {
+        auto&amp; value = downcast&lt;CSSPrimitiveValue&gt;(item.get());
</ins><span class="cx">         String familyName;
</span><del>-        if (item-&gt;isString()) {
-            familyName = item-&gt;getStringValue();
-        } else if (item-&gt;isValueID()) {
</del><ins>+        if (value.isFontFamily()) {
+            familyName = value.fontFamily().familyName;
+        } else if (value.isValueID()) {
</ins><span class="cx">             // We need to use the raw text for all the generic family types, since @font-face is a way of actually
</span><span class="cx">             // defining what font to use for those types.
</span><del>-            switch (item-&gt;getValueID()) {
</del><ins>+            switch (value.getValueID()) {
</ins><span class="cx">                 case CSSValueSerif:
</span><span class="cx">                     familyName = serifFamily;
</span><span class="cx">                     break;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -1,12 +1,13 @@
</span><span class="cx"> /*
</span><span class="cx">  * Copyright (C) 2003 Lars Knoll (knoll@kde.org)
</span><span class="cx">  * Copyright (C) 2005 Allan Sandfeld Jensen (kde@carewolf.com)
</span><del>- * Copyright (C) 2004-2014 Apple Inc. All rights reserved.
</del><ins>+ * Copyright (C) 2004-2015 Apple Inc. All rights reserved.
</ins><span class="cx">  * Copyright (C) 2007 Nicholas Shanks &lt;webkit@nickshanks.com&gt;
</span><span class="cx">  * Copyright (C) 2008 Eric Seidel &lt;eric@webkit.org&gt;
</span><span class="cx">  * Copyright (C) 2009 Torch Mobile Inc. All rights reserved. (http://www.torchmobile.com/)
</span><span class="cx">  * Copyright (C) 2012, 2013 Adobe Systems Incorporated. All rights reserved.
</span><span class="cx">  * Copyright (C) 2012 Intel Corporation. All rights reserved.
</span><ins>+ * Copyright (C) 2014 Google Inc. All rights reserved.
</ins><span class="cx">  *
</span><span class="cx">  * This library is free software; you can redistribute it and/or
</span><span class="cx">  * modify it under the terms of the GNU Library General Public
</span><span class="lines">@@ -49,6 +50,7 @@
</span><span class="cx"> #include &quot;CSSMediaRule.h&quot;
</span><span class="cx"> #include &quot;CSSPageRule.h&quot;
</span><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><ins>+#include &quot;CSSPrimitiveValueMappings.h&quot;
</ins><span class="cx"> #include &quot;CSSPropertySourceData.h&quot;
</span><span class="cx"> #include &quot;CSSReflectValue.h&quot;
</span><span class="cx"> #include &quot;CSSSelector.h&quot;
</span><span class="lines">@@ -2891,11 +2893,11 @@
</span><span class="cx">     case CSSPropertyFont:
</span><span class="cx">         // [ [ 'font-style' || 'font-variant' || 'font-weight' ]? 'font-size' [ / 'line-height' ]?
</span><span class="cx">         // 'font-family' ] | caption | icon | menu | message-box | small-caption | status-bar | inherit
</span><del>-        if (id &gt;= CSSValueCaption &amp;&amp; id &lt;= CSSValueStatusBar)
-            validPrimitive = true;
-        else
-            return parseFont(important);
-        break;
</del><ins>+        if (num == 1 &amp;&amp; id &gt;= CSSValueCaption &amp;&amp; id &lt;= CSSValueStatusBar) {
+            parseSystemFont(important);
+            return true;
+        }
+        return parseFont(important);
</ins><span class="cx">     case CSSPropertyListStyle:
</span><span class="cx">         return parseShorthand(propId, listStyleShorthand(), important);
</span><span class="cx">     case CSSPropertyColumns:
</span><span class="lines">@@ -6269,6 +6271,29 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+void CSSParser::parseSystemFont(bool important)
+{
+    ASSERT(m_valueList-&gt;size() == 1);
+    CSSValueID systemFontID = m_valueList-&gt;valueAt(0)-&gt;id;
+    ASSERT(systemFontID &gt;= CSSValueCaption &amp;&amp; systemFontID &lt;= CSSValueStatusBar);
+    m_valueList-&gt;next();
+
+    FontDescription fontDescription;
+    RenderTheme::defaultTheme()-&gt;systemFont(systemFontID, fontDescription);
+    if (!fontDescription.isAbsoluteSize())
+        return;
+
+    ShorthandScope scope(this, CSSPropertyFont);
+    addProperty(CSSPropertyFontStyle, cssValuePool().createIdentifierValue(fontDescription.italic() == FontItalicOn ? CSSValueItalic : CSSValueNormal), important);
+    addProperty(CSSPropertyFontWeight, cssValuePool().createValue(fontDescription.weight()), important);
+    addProperty(CSSPropertyFontSize, cssValuePool().createValue(fontDescription.specifiedSize(), CSSPrimitiveValue::CSS_PX), important);
+    Ref&lt;CSSValueList&gt; fontFamilyList = CSSValueList::createCommaSeparated();
+    fontFamilyList-&gt;append(cssValuePool().createFontFamilyValue(fontDescription.familyAt(0), FromSystemFontID));
+    addProperty(CSSPropertyFontFamily, WTF::move(fontFamilyList), important);
+    addProperty(CSSPropertyFontVariant, cssValuePool().createIdentifierValue(CSSValueNormal), important);
+    addProperty(CSSPropertyLineHeight, cssValuePool().createIdentifierValue(CSSValueNormal), important);
+}
+
</ins><span class="cx"> class FontFamilyValueBuilder {
</span><span class="cx"> public:
</span><span class="cx">     FontFamilyValueBuilder(CSSValueList&amp; list)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSParser.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -215,6 +215,7 @@
</span><span class="cx">     PassRefPtr&lt;CSSBasicShape&gt; parseBasicShapeInset(CSSParserValueList&amp;);
</span><span class="cx"> 
</span><span class="cx">     bool parseFont(bool important);
</span><ins>+    void parseSystemFont(bool important);
</ins><span class="cx">     PassRefPtr&lt;CSSValueList&gt; parseFontFamily();
</span><span class="cx"> 
</span><span class="cx">     bool parseCounter(CSSPropertyID, int defaultValue, bool important);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuescpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSParserValues.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -140,6 +140,7 @@
</span><span class="cx">     case CSSPrimitiveValue::CSS_PARSER_IDENTIFIER:
</span><span class="cx">     case CSSPrimitiveValue::CSS_COUNTER_NAME:
</span><span class="cx">     case CSSPrimitiveValue::CSS_SHAPE:
</span><ins>+    case CSSPrimitiveValue::CSS_FONT_FAMILY:
</ins><span class="cx">     case CSSPrimitiveValue::CSS_QUAD:
</span><span class="cx"> #if ENABLE(CSS_SCROLL_SNAP)
</span><span class="cx">     case CSSPrimitiveValue::CSS_LENGTH_REPEAT:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -23,8 +23,10 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSBasicShapes.h&quot;
</span><span class="cx"> #include &quot;CSSCalculationValue.h&quot;
</span><ins>+#include &quot;CSSFontFamily.h&quot;
</ins><span class="cx"> #include &quot;CSSHelper.h&quot;
</span><span class="cx"> #include &quot;CSSParser.h&quot;
</span><ins>+#include &quot;CSSPrimitiveValueMappings.h&quot;
</ins><span class="cx"> #include &quot;CSSPropertyNames.h&quot;
</span><span class="cx"> #include &quot;CSSToLengthConversionData.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="lines">@@ -123,6 +125,7 @@
</span><span class="cx">     case CSSPrimitiveValue::CSS_RGBCOLOR:
</span><span class="cx">     case CSSPrimitiveValue::CSS_SHAPE:
</span><span class="cx">     case CSSPrimitiveValue::CSS_STRING:
</span><ins>+    case CSSPrimitiveValue::CSS_FONT_FAMILY:
</ins><span class="cx">     case CSSPrimitiveValue::CSS_UNICODE_RANGE:
</span><span class="cx">     case CSSPrimitiveValue::CSS_UNKNOWN:
</span><span class="cx">     case CSSPrimitiveValue::CSS_URI:
</span><span class="lines">@@ -183,6 +186,11 @@
</span><span class="cx">     if (m_primitiveUnitType == CSS_PROPERTY_ID || m_primitiveUnitType == CSS_VALUE_ID)
</span><span class="cx">         return CSS_IDENT;
</span><span class="cx"> 
</span><ins>+    // Web-exposed content expects font family values to have CSS_STRING primitive type
+    // so we need to map our internal CSS_FONT_FAMILY type here.
+    if (m_primitiveUnitType == CSS_FONT_FAMILY)
+        return CSS_STRING;
+
</ins><span class="cx">     if (m_primitiveUnitType != CSSPrimitiveValue::CSS_CALC)
</span><span class="cx">         return m_primitiveUnitType;
</span><span class="cx"> 
</span><span class="lines">@@ -485,6 +493,11 @@
</span><span class="cx">     case CSS_SHAPE:
</span><span class="cx">         m_value.shape-&gt;deref();
</span><span class="cx">         break;
</span><ins>+    case CSS_FONT_FAMILY:
+        ASSERT(m_value.fontFamily);
+        delete m_value.fontFamily;
+        m_value.fontFamily = nullptr;
+        break;
</ins><span class="cx">     case CSS_NUMBER:
</span><span class="cx">     case CSS_PARSER_INTEGER:
</span><span class="cx">     case CSS_PERCENTAGE:
</span><span class="lines">@@ -844,6 +857,8 @@
</span><span class="cx">     case CSS_ATTR:
</span><span class="cx">     case CSS_URI:
</span><span class="cx">         return m_value.string;
</span><ins>+    case CSS_FONT_FAMILY:
+        return m_value.fontFamily-&gt;familyName;
</ins><span class="cx">     case CSS_VALUE_ID:
</span><span class="cx">         return valueName(m_value.valueID);
</span><span class="cx">     case CSS_PROPERTY_ID:
</span><span class="lines">@@ -863,6 +878,8 @@
</span><span class="cx">     case CSS_ATTR:
</span><span class="cx">     case CSS_URI:
</span><span class="cx">         return m_value.string;
</span><ins>+    case CSS_FONT_FAMILY:
+        return m_value.fontFamily-&gt;familyName;
</ins><span class="cx">     case CSS_VALUE_ID:
</span><span class="cx">         return valueName(m_value.valueID);
</span><span class="cx">     case CSS_PROPERTY_ID:
</span><span class="lines">@@ -1026,6 +1043,8 @@
</span><span class="cx">         // the actual dimension, just the numeric value as a string.
</span><span class="cx">     case CSS_STRING:
</span><span class="cx">         return quoteCSSStringIfNeeded(m_value.string);
</span><ins>+    case CSS_FONT_FAMILY:
+        return quoteCSSStringIfNeeded(m_value.fontFamily-&gt;familyName);
</ins><span class="cx">     case CSS_URI:
</span><span class="cx">         return &quot;url(&quot; + quoteCSSURLIfNeeded(m_value.string) + ')';
</span><span class="cx">     case CSS_VALUE_ID:
</span><span class="lines">@@ -1203,6 +1222,9 @@
</span><span class="cx">     case CSS_COUNTER_NAME:
</span><span class="cx">         result = CSSPrimitiveValue::create(m_value.string, static_cast&lt;UnitTypes&gt;(m_primitiveUnitType));
</span><span class="cx">         break;
</span><ins>+    case CSS_FONT_FAMILY:
+        result = CSSPrimitiveValue::create(*m_value.fontFamily);
+        break;
</ins><span class="cx">     case CSS_COUNTER:
</span><span class="cx">         result = CSSPrimitiveValue::create(m_value.counter-&gt;cloneForCSSOM());
</span><span class="cx">         break;
</span><span class="lines">@@ -1365,6 +1387,8 @@
</span><span class="cx">         return m_value.calc &amp;&amp; other.m_value.calc &amp;&amp; m_value.calc-&gt;equals(*other.m_value.calc);
</span><span class="cx">     case CSS_SHAPE:
</span><span class="cx">         return m_value.shape &amp;&amp; other.m_value.shape &amp;&amp; m_value.shape-&gt;equals(*other.m_value.shape);
</span><ins>+    case CSS_FONT_FAMILY:
+        return fontFamily() == other.fontFamily();
</ins><span class="cx">     }
</span><span class="cx">     return false;
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValue.h (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValue.h        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSPrimitiveValue.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -48,6 +48,7 @@
</span><span class="cx"> class LengthRepeat;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+struct CSSFontFamily;
</ins><span class="cx"> struct Length;
</span><span class="cx"> struct LengthSize;
</span><span class="cx"> 
</span><span class="lines">@@ -149,6 +150,8 @@
</span><span class="cx">         CSS_CALC_PERCENTAGE_WITH_NUMBER = 114,
</span><span class="cx">         CSS_CALC_PERCENTAGE_WITH_LENGTH = 115,
</span><span class="cx"> 
</span><ins>+        CSS_FONT_FAMILY = 116,
+
</ins><span class="cx">         CSS_PROPERTY_ID = 117,
</span><span class="cx">         CSS_VALUE_ID = 118
</span><span class="cx">     };
</span><span class="lines">@@ -200,6 +203,7 @@
</span><span class="cx">     bool isRGBColor() const { return m_primitiveUnitType == CSS_RGBCOLOR; }
</span><span class="cx">     bool isShape() const { return m_primitiveUnitType == CSS_SHAPE; }
</span><span class="cx">     bool isString() const { return m_primitiveUnitType == CSS_STRING; }
</span><ins>+    bool isFontFamily() const { return m_primitiveUnitType == CSS_FONT_FAMILY; }
</ins><span class="cx">     bool isTime() const { return m_primitiveUnitType == CSS_S || m_primitiveUnitType == CSS_MS; }
</span><span class="cx">     bool isURI() const { return m_primitiveUnitType == CSS_URI; }
</span><span class="cx">     bool isCalculated() const { return m_primitiveUnitType == CSS_CALC; }
</span><span class="lines">@@ -333,16 +337,18 @@
</span><span class="cx">     RGBA32 getRGBA32Value() const { return m_primitiveUnitType != CSS_RGBCOLOR ? 0 : m_value.rgbcolor; }
</span><span class="cx"> 
</span><span class="cx">     Pair* getPairValue(ExceptionCode&amp;) const;
</span><del>-    Pair* getPairValue() const { return m_primitiveUnitType != CSS_PAIR ? 0 : m_value.pair; }
</del><ins>+    Pair* getPairValue() const { return m_primitiveUnitType != CSS_PAIR ? nullptr : m_value.pair; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(DASHBOARD_SUPPORT)
</span><del>-    DashboardRegion* getDashboardRegionValue() const { return m_primitiveUnitType != CSS_DASHBOARD_REGION ? 0 : m_value.region; }
</del><ins>+    DashboardRegion* getDashboardRegionValue() const { return m_primitiveUnitType != CSS_DASHBOARD_REGION ? nullptr : m_value.region; }
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    CSSBasicShape* getShapeValue() const { return m_primitiveUnitType != CSS_SHAPE ? 0 : m_value.shape; }
</del><ins>+    CSSBasicShape* getShapeValue() const { return m_primitiveUnitType != CSS_SHAPE ? nullptr : m_value.shape; }
</ins><span class="cx"> 
</span><del>-    CSSCalcValue* cssCalcValue() const { return m_primitiveUnitType != CSS_CALC ? 0 : m_value.calc; }
</del><ins>+    const CSSFontFamily&amp; fontFamily() const { ASSERT(m_primitiveUnitType == CSS_FONT_FAMILY); return *m_value.fontFamily; }
</ins><span class="cx"> 
</span><ins>+    CSSCalcValue* cssCalcValue() const { return m_primitiveUnitType != CSS_CALC ? nullptr : m_value.calc; }
+
</ins><span class="cx">     CSSPropertyID getPropertyID() const { return m_primitiveUnitType == CSS_PROPERTY_ID ? m_value.propertyID : CSSPropertyInvalid; }
</span><span class="cx">     CSSValueID getValueID() const { return m_primitiveUnitType == CSS_VALUE_ID ? m_value.valueID : CSSValueInvalid; }
</span><span class="cx"> 
</span><span class="lines">@@ -435,6 +441,7 @@
</span><span class="cx">         DashboardRegion* region;
</span><span class="cx">         CSSBasicShape* shape;
</span><span class="cx">         CSSCalcValue* calc;
</span><ins>+        CSSFontFamily* fontFamily;
</ins><span class="cx">     } m_value;
</span><span class="cx"> };
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPrimitiveValueMappingsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSPrimitiveValueMappings.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -31,6 +31,7 @@
</span><span class="cx"> #define CSSPrimitiveValueMappings_h
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSCalculationValue.h&quot;
</span><ins>+#include &quot;CSSFontFamily.h&quot;
</ins><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><span class="cx"> #include &quot;CSSReflectionDirection.h&quot;
</span><span class="cx"> #include &quot;CSSToLengthConversionData.h&quot;
</span><span class="lines">@@ -4918,6 +4919,13 @@
</span><span class="cx">     return WM_LRTB;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;&gt; inline CSSPrimitiveValue::CSSPrimitiveValue(CSSFontFamily fontFamily)
+    : CSSValue(PrimitiveClass)
+{
+    m_primitiveUnitType = CSS_FONT_FAMILY;
+    m_value.fontFamily = new CSSFontFamily(WTF::move(fontFamily));
+}
+
</ins><span class="cx"> template&lt;&gt; inline CSSPrimitiveValue::CSSPrimitiveValue(EVectorEffect e)
</span><span class="cx">     : CSSValue(PrimitiveClass)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -99,7 +99,6 @@
</span><span class="cx"> color [Inherited, VisitedLinkColorSupport, NoDefaultColor]
</span><span class="cx"> direction [Inherited, Custom=Value]
</span><span class="cx"> display [Custom=Inherit|Value]
</span><del>-font [Inherited, Custom=All]
</del><span class="cx"> font-family [Inherited, Custom=All]
</span><span class="cx"> font-size [Inherited, Custom=All]
</span><span class="cx"> font-style [Inherited, FontProperty, NameForMethods=Italic]
</span><span class="lines">@@ -229,6 +228,7 @@
</span><span class="cx"> float [NameForMethods=Floating]
</span><span class="cx"> flood-color [SVG, Converter=SVGColor]
</span><span class="cx"> flood-opacity [SVG, Converter=Opacity]
</span><ins>+font [Inherited, Longhands=font-family|font-size|font-style|font-variant|font-weight|line-height]
</ins><span class="cx"> font-stretch [SkipBuilder]
</span><span class="cx"> glyph-orientation-horizontal [Inherited, SVG, Converter=GlyphOrientation]
</span><span class="cx"> glyph-orientation-vertical [Inherited, SVG, Converter=GlyphOrientationOrAuto]
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuePoolcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValuePool.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValuePool.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSValuePool.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -27,6 +27,7 @@
</span><span class="cx"> #include &quot;CSSValuePool.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSParser.h&quot;
</span><ins>+#include &quot;CSSPrimitiveValueMappings.h&quot;
</ins><span class="cx"> #include &quot;CSSStyleSheet.h&quot;
</span><span class="cx"> #include &quot;CSSValueKeywords.h&quot;
</span><span class="cx"> #include &quot;CSSValueList.h&quot;
</span><span class="lines">@@ -118,11 +119,11 @@
</span><span class="cx">     return *cache[intValue];
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-Ref&lt;CSSPrimitiveValue&gt; CSSValuePool::createFontFamilyValue(const String&amp; familyName)
</del><ins>+Ref&lt;CSSPrimitiveValue&gt; CSSValuePool::createFontFamilyValue(const String&amp; familyName, FromSystemFontIDOrNot fromSystemFontID)
</ins><span class="cx"> {
</span><del>-    RefPtr&lt;CSSPrimitiveValue&gt;&amp; value = m_fontFamilyValueCache.add(familyName, nullptr).iterator-&gt;value;
</del><ins>+    RefPtr&lt;CSSPrimitiveValue&gt;&amp; value = m_fontFamilyValueCache.add({familyName, fromSystemFontID}, nullptr).iterator-&gt;value;
</ins><span class="cx">     if (!value)
</span><del>-        value = CSSPrimitiveValue::create(familyName, CSSPrimitiveValue::CSS_STRING);
</del><ins>+        value = CSSPrimitiveValue::create(CSSFontFamily{familyName, fromSystemFontID});
</ins><span class="cx">     return *value;
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuePoolh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValuePool.h (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValuePool.h        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/CSSValuePool.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #ifndef CSSValuePool_h
</span><span class="cx"> #define CSSValuePool_h
</span><span class="cx"> 
</span><ins>+#include &quot;CSSFontFamily.h&quot;
</ins><span class="cx"> #include &quot;CSSInheritedValue.h&quot;
</span><span class="cx"> #include &quot;CSSInitialValue.h&quot;
</span><span class="cx"> #include &quot;CSSPrimitiveValue.h&quot;
</span><span class="lines">@@ -44,7 +45,7 @@
</span><span class="cx">     WTF_MAKE_FAST_ALLOCATED;
</span><span class="cx"> public:
</span><span class="cx">     PassRefPtr&lt;CSSValueList&gt; createFontFaceValue(const AtomicString&amp;);
</span><del>-    Ref&lt;CSSPrimitiveValue&gt; createFontFamilyValue(const String&amp;);
</del><ins>+    Ref&lt;CSSPrimitiveValue&gt; createFontFamilyValue(const String&amp;, FromSystemFontIDOrNot = NotFromSystemFontID);
</ins><span class="cx">     Ref&lt;CSSInheritedValue&gt; createInheritedValue() { return m_inheritedValue.copyRef(); }
</span><span class="cx">     Ref&lt;CSSInitialValue&gt; createImplicitInitialValue() { return m_implicitInitialValue.copyRef(); }
</span><span class="cx">     Ref&lt;CSSInitialValue&gt; createExplicitInitialValue() { return m_explicitInitialValue.copyRef(); }
</span><span class="lines">@@ -83,7 +84,7 @@
</span><span class="cx">     typedef HashMap&lt;AtomicString, RefPtr&lt;CSSValueList&gt;&gt; FontFaceValueCache;
</span><span class="cx">     FontFaceValueCache m_fontFaceValueCache;
</span><span class="cx"> 
</span><del>-    typedef HashMap&lt;String, RefPtr&lt;CSSPrimitiveValue&gt;&gt; FontFamilyValueCache;
</del><ins>+    typedef HashMap&lt;std::pair&lt;String, bool&gt;, RefPtr&lt;CSSPrimitiveValue&gt;&gt; FontFamilyValueCache;
</ins><span class="cx">     FontFamilyValueCache m_fontFamilyValueCache;
</span><span class="cx"> 
</span><span class="cx">     friend class WTF::NeverDestroyed&lt;CSSValuePool&gt;;
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -29,6 +29,7 @@
</span><span class="cx"> 
</span><span class="cx"> #include &quot;CSSAspectRatioValue.h&quot;
</span><span class="cx"> #include &quot;CSSCursorImageValue.h&quot;
</span><ins>+#include &quot;CSSFontFamily.h&quot;
</ins><span class="cx"> #include &quot;CSSFontValue.h&quot;
</span><span class="cx"> #include &quot;CSSGradientValue.h&quot;
</span><span class="cx"> #include &quot;CSSShadowValue.h&quot;
</span><span class="lines">@@ -72,7 +73,6 @@
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(CounterReset);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(Cursor);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(Fill);
</span><del>-    DECLARE_PROPERTY_CUSTOM_HANDLERS(Font);
</del><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(FontFamily);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(FontSize);
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(FontWeight);
</span><span class="lines">@@ -858,9 +858,12 @@
</span><span class="cx">         auto&amp; contentValue = downcast&lt;CSSPrimitiveValue&gt;(item.get());
</span><span class="cx">         AtomicString family;
</span><span class="cx">         bool isGenericFamily = false;
</span><del>-        if (contentValue.isString())
-            family = contentValue.getStringValue();
-        else {
</del><ins>+        if (contentValue.isFontFamily()) {
+            const CSSFontFamily&amp; fontFamily = contentValue.fontFamily();
+            family = fontFamily.familyName;
+            // If the family name was resolved by the CSS parser from a system font ID, then it is generic.
+            isGenericFamily = fontFamily.fromSystemFontID;
+        } else {
</ins><span class="cx">             switch (contentValue.getValueID()) {
</span><span class="cx">             case CSSValueWebkitBody:
</span><span class="cx">                 if (Settings* settings = styleResolver.document().settings())
</span><span class="lines">@@ -1290,48 +1293,6 @@
</span><span class="cx">         styleResolver.style()-&gt;setColumnGap(StyleBuilderConverter::convertComputedLength&lt;float&gt;(styleResolver, value));
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void StyleBuilderCustom::applyInitialFont(StyleResolver&amp; styleResolver)
-{
-    Settings* settings = styleResolver.documentSettings();
-    ASSERT(settings); // If we're doing style resolution, this document should always be in a frame and thus have settings
-    styleResolver.initializeFontStyle(settings);
-}
-
-inline void StyleBuilderCustom::applyInheritFont(StyleResolver&amp; styleResolver)
-{
-    FontDescription fontDescription = styleResolver.parentStyle()-&gt;fontDescription();
-    styleResolver.style()-&gt;setLineHeight(styleResolver.parentStyle()-&gt;specifiedLineHeight());
-    styleResolver.state().setLineHeightValue(0);
-    styleResolver.setFontDescription(fontDescription);
-}
-
-inline void StyleBuilderCustom::applyValueFont(StyleResolver&amp; styleResolver, CSSValue&amp; value)
-{
-    if (is&lt;CSSPrimitiveValue&gt;(value)) {
-        styleResolver.style()-&gt;setLineHeight(RenderStyle::initialLineHeight());
-        styleResolver.state().setLineHeightValue(0);
-
-        FontDescription fontDescription;
-        RenderTheme::defaultTheme()-&gt;systemFont(downcast&lt;CSSPrimitiveValue&gt;(value).getValueID(), fontDescription);
-
-        // Double-check and see if the theme did anything. If not, don't bother updating the font.
-        if (fontDescription.isAbsoluteSize()) {
-            // Make sure the rendering mode and printer font settings are updated.
-            Settings* settings = styleResolver.documentSettings();
-            ASSERT(settings); // If we're doing style resolution, this document should always be in a frame and thus have settings
-            fontDescription.setRenderingMode(settings-&gt;fontRenderingMode());
-            fontDescription.setUsePrinterFont(styleResolver.document().printing() || !settings-&gt;screenFontSubstitutionEnabled());
-
-            // Handle the zoom factor.
-            fontDescription.setComputedSize(Style::computedFontSizeFromSpecifiedSize(fontDescription.specifiedSize(), fontDescription.isAbsoluteSize(), styleResolver.useSVGZoomRules(), styleResolver.style(), styleResolver.document()));
-            styleResolver.setFontDescription(fontDescription);
-        }
-        return;
-    }
-    if (is&lt;CSSFontValue&gt;(value))
-        styleResolver.applyFont(downcast&lt;CSSFontValue&gt;(value));
-}
-
</del><span class="cx"> inline void StyleBuilderCustom::applyInitialContent(StyleResolver&amp; styleResolver)
</span><span class="cx"> {
</span><span class="cx">     styleResolver.style()-&gt;clearContent();
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertyShorthandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StylePropertyShorthand.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StylePropertyShorthand.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -33,19 +33,6 @@
</span><span class="cx">     return StylePropertyShorthand(CSSPropertyBorder, borderAbridgedProperties, propertiesForInitialization);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-StylePropertyShorthand fontShorthand()
-{
-    static const CSSPropertyID fontProperties[] = {
-        CSSPropertyFontFamily,
-        CSSPropertyFontSize,
-        CSSPropertyFontStyle,
-        CSSPropertyFontVariant,
-        CSSPropertyFontWeight,
-        CSSPropertyLineHeight
-    };
-    return StylePropertyShorthand(CSSPropertyFont, fontProperties);
-}
-
</del><span class="cx"> StylePropertyShorthand animationShorthandForParsing(CSSPropertyID propId)
</span><span class="cx"> {
</span><span class="cx">     // When we parse the animation shorthand we need to look for animation-name
</span><span class="lines">@@ -84,13 +71,6 @@
</span><span class="cx"> 
</span><span class="cx"> bool isExpandedShorthand(CSSPropertyID id)
</span><span class="cx"> {
</span><del>-    // The system fonts bypass the normal style resolution by using RenderTheme,
-    // thus we need to special case it here. FIXME: This is a violation of CSS 3 Fonts
-    // as we should still be able to change the longhands.
-    // DON'T ADD ANY SHORTHAND HERE UNLESS IT ISN'T ALWAYS EXPANDED AT PARSE TIME (which is wrong).
-    if (id == CSSPropertyFont)
-        return false;
-
</del><span class="cx">     return shorthandForProperty(id).length();
</span><span class="cx"> }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertyShorthandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StylePropertyShorthand.h (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StylePropertyShorthand.h        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -62,7 +62,6 @@
</span><span class="cx"> // Custom StylePropertyShorthand functions.
</span><span class="cx"> StylePropertyShorthand animationShorthandForParsing(CSSPropertyID);
</span><span class="cx"> StylePropertyShorthand borderAbridgedShorthand();
</span><del>-StylePropertyShorthand fontShorthand();
</del><span class="cx"> 
</span><span class="cx"> // Returns empty value if the property is not a shorthand.
</span><span class="cx"> // The implementation is generated in StylePropertyShorthandFunctions.cpp.
</span><span class="lines">@@ -76,24 +75,6 @@
</span><span class="cx"> 
</span><span class="cx"> bool isExpandedShorthand(CSSPropertyID);
</span><span class="cx"> 
</span><del>-// FIXME: This should try to get rid of this function and generate the rest of these shorthands.
-inline Vector&lt;StylePropertyShorthand&gt; matchingCustomShorthandsForLonghand(CSSPropertyID propertyID)
-{
-    switch (propertyID) {
-    case CSSPropertyFontFamily:
-    case CSSPropertyFontSize:
-    case CSSPropertyFontStyle:
-    case CSSPropertyFontVariant:
-    case CSSPropertyFontWeight:
-    case CSSPropertyLineHeight:
-        return Vector&lt;StylePropertyShorthand&gt;{fontShorthand()};
-    default:
-        break;
-    }
-
-    return Vector&lt;StylePropertyShorthand&gt;();
-}
-
</del><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // StylePropertyShorthand_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -1837,25 +1837,6 @@
</span><span class="cx">         applyProperty(id, value);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void StyleResolver::applyFont(CSSFontValue&amp; font)
-{
-    if (!font.style || !font.variant || !font.weight || !font.size || !font.lineHeight || !font.family)
-        return;
-    applyProperty(CSSPropertyFontStyle, font.style.get());
-    applyProperty(CSSPropertyFontVariant, font.variant.get());
-    applyProperty(CSSPropertyFontWeight, font.weight.get());
-    // The previous properties can dirty our font but they don't try to read the font's
-    // properties back, which is safe. However if font-size is using the 'ex' unit, it will
-    // need query the dirtied font's x-height to get the computed size. To be safe in this
-    // case, let's just update the font now.
-    updateFont();
-    applyProperty(CSSPropertyFontSize, font.size.get());
-
-    m_state.setLineHeightValue(font.lineHeight.get());
-
-    applyProperty(CSSPropertyFontFamily, font.family.get());
-}
-
</del><span class="cx"> inline bool isValidVisitedLinkProperty(CSSPropertyID id)
</span><span class="cx"> {
</span><span class="cx">     switch (id) {
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.h (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.h        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/StyleResolver.h        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -201,7 +201,6 @@
</span><span class="cx"> 
</span><span class="cx">     void applyPropertyToCurrentStyle(CSSPropertyID, CSSValue*);
</span><span class="cx"> 
</span><del>-    void applyFont(CSSFontValue&amp;);
</del><span class="cx">     void updateFont();
</span><span class="cx">     void initializeFontStyle(Settings*);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssmakeproppl"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/makeprop.pl (179099 => 179100)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/makeprop.pl        2015-01-26 00:14:35 UTC (rev 179099)
+++ trunk/Source/WebCore/css/makeprop.pl        2015-01-26 02:11:14 UTC (rev 179100)
</span><span class="lines">@@ -977,11 +977,7 @@
</span><span class="cx">   print SHORTHANDS_CPP &quot;        return &quot; . lcfirst($nameToId{$name}) . &quot;Shorthand();\n&quot;;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-# FIXME: CSSPropertyFont is currently an exception. It is hard-coded here
-# because it is not marked as a shorthand in CSSPropertyNames.in.
</del><span class="cx"> print SHORTHANDS_CPP &lt;&lt; &quot;EOF&quot;;
</span><del>-    case CSSPropertyFont:
-        return fontShorthand();
</del><span class="cx">     default:
</span><span class="cx">         return emptyShorthand;
</span><span class="cx">     }
</span><span class="lines">@@ -1021,7 +1017,7 @@
</span><span class="cx"> 
</span><span class="cx"> print SHORTHANDS_CPP &lt;&lt; &quot;EOF&quot;;
</span><span class="cx">     default:
</span><del>-        return matchingCustomShorthandsForLonghand(propertyID);
</del><ins>+        return { };
</ins><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> EOF
</span></span></pre>
</div>
</div>

</body>
</html>