<!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>[183494] 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/183494">183494</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2015-04-28 11:36:59 -0700 (Tue, 28 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Source/WebCore:
[Mac] [iOS] Implement font-synthesis CSS property
https://bugs.webkit.org/show_bug.cgi?id=144305

Reviewed by Andreas Kling.

This patch is fairly straightforward, though there are some particular pieces to the patch listed below.

The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
determine if we should synthesize bold and italics, this CSS property simply guards that decision.

Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
regarding font-synthesis into FontDescription (from RenderStyle).

Test: fast/css3-text/font-synthesis.html

* css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
inside FontDescription. This also means that the property must be marked as a &quot;high priority&quot; property, which
is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
FontCacheIOS and FontCacheMac have access to the saved state.
* css/CSSComputedStyleDeclaration.cpp:
(WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
* css/CSSSegmentedFontFace.cpp:
(WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
FontSynthesis state inside FontDescription.
* css/StyleBuilderConverter.h:
(WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
CSSPropertyNames.in
* css/StyleBuilderCustom.h:
(WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
* platform/graphics/FontDescription.h:
(WebCore::FontDescription::FontDescription): Moved from RenderStyle.
(WebCore::FontDescription::fontSynthesis): Ditto.
(WebCore::FontDescription::setFontSynthesis): Ditto.
(WebCore::FontDescription::initialFontSynthesis): Ditto.
(WebCore::FontDescription::operator==): Update to include new state.
* platform/graphics/FontCache.h:
(WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
state inside FontDescription.
* platform/graphics/ios/FontCacheIOS.mm:
(WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
new FontSynthesis state inside FontDescription.
* platform/graphics/mac/FontCacheMac.mm:
(WebCore::FontCache::createFontPlatformData): Ditto.
* platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
* rendering/style/RenderStyle.h:
(WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
(WebCore::RenderStyle::setFontSynthesis): Ditto.
(WebCore::RenderStyle::initialFontSynthesis): Ditto.
* rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
* rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)

LayoutTests:
Implement font-synthesis CSS property
https://bugs.webkit.org/show_bug.cgi?id=144305

Reviewed by Andreas Kling.

Test all combinations of font-weight, font-style, and font-synthesis.

* fast/css3-text/font-synthesis-expected.html: Added.
* fast/css3-text/font-synthesis.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcss3textfontsynthesisparseexpectedtxt">trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcss3textfontsynthesisparsehtml">trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssCSSSegmentedFontFacecpp">trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderConverterh">trunk/Source/WebCore/css/StyleBuilderConverter.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleBuilderCustomh">trunk/Source/WebCore/css/StyleBuilderCustom.h</a></li>
<li><a href="#trunkSourceWebCorecssStyleResolvercpp">trunk/Source/WebCore/css/StyleResolver.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontDescriptionh">trunk/Source/WebCore/platform/graphics/FontDescription.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm">trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacFontCacheMacmm">trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm</a></li>
<li><a href="#trunkSourceWebCoreplatformtextTextFlagsh">trunk/Source/WebCore/platform/text/TextFlags.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleh">trunk/Source/WebCore/rendering/style/RenderStyle.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleRenderStyleConstantsh">trunk/Source/WebCore/rendering/style/RenderStyleConstants.h</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleStyleRareInheritedDatah">trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcss3textfontsynthesisexpectedhtml">trunk/LayoutTests/fast/css3-text/font-synthesis-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcss3textfontsynthesishtml">trunk/LayoutTests/fast/css3-text/font-synthesis.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/LayoutTests/ChangeLog        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-04-27  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Implement font-synthesis CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=144305
+
+        Reviewed by Andreas Kling.
+
+        Test all combinations of font-weight, font-style, and font-synthesis.
+
+        * fast/css3-text/font-synthesis-expected.html: Added.
+        * fast/css3-text/font-synthesis.html: Added.
+
</ins><span class="cx"> 2015-04-28  Brent Fulgham  &lt;bfulgham@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [Win] Temporarily disable WebGL support
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textfontsynthesisexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/font-synthesis-expected.html (0 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/font-synthesis-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css3-text/font-synthesis-expected.html        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+@font-face {
+    font-family: &quot;CustomAhem&quot;;
+    font-weight: 400;
+    font-style: normal;
+    src: url(&quot;../../resources/Ahem.ttf&quot;) format(&quot;truetype&quot;);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that the font-synthesis property disallows synthesis when it is specified.
+&lt;div style=&quot;font: 20px CustomAhem; position: relative;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 0px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;position: absolute; left: 150px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;position: absolute; left: 300px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;position: absolute; left: 450px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700; font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font: 20px CustomAhem; position: relative; top: 100px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 0px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;position: absolute; left: 150px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;position: absolute; left: 300px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;position: absolute; left: 450px; top: 0px;&quot;&gt;
+&lt;div&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700; font-style: italic;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font: 20px Ahem; position: relative; top: 200px;&quot;&gt;
+&lt;div&gt;
+ABCD
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcss3textfontsynthesisparseexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/LayoutTests/fast/css3-text/font-synthesis-parse-expected.txt        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -1,7 +1,7 @@
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is null
</span><del>-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;none&quot;
</del><ins>+PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 1
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is &quot;initial&quot;
</span><span class="lines">@@ -33,23 +33,23 @@
</span><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is null
</span><del>-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;none&quot;
</del><ins>+PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is null
</span><del>-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;none&quot;
</del><ins>+PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is null
</span><del>-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;none&quot;
</del><ins>+PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is null
</span><del>-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;none&quot;
</del><ins>+PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</ins><span class="cx"> PASS cssRule.type is cssRule.STYLE_RULE
</span><span class="cx"> PASS declaration.length is 0
</span><span class="cx"> PASS declaration.getPropertyValue('font-synthesis') is null
</span><del>-PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;none&quot;
</del><ins>+PASS computedStyle.getPropertyCSSValue('font-synthesis').cssText is &quot;style weight&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textfontsynthesisparsehtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/LayoutTests/fast/css3-text/font-synthesis-parse.html        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -7,14 +7,14 @@
</span><span class="cx">   &lt;div id=&quot;p&quot;&gt;&lt;/div&gt;
</span><span class="cx">   &lt;div id=&quot;q&quot;&gt;&lt;div id=&quot;r&quot;&gt;&lt;/div&gt;&lt;/div&gt;
</span><span class="cx">   &lt;script type=&quot;text/javascript&quot;&gt;
</span><del>-    function testEmptyIsNone(stylesheet, target) {
</del><ins>+    function testEmptyIsBoth(stylesheet, target) {
</ins><span class="cx">       cssRule = stylesheet.cssRules.item(0);
</span><span class="cx">       shouldBe(&quot;cssRule.type&quot;, &quot;cssRule.STYLE_RULE&quot;);
</span><span class="cx">       declaration = cssRule.style;
</span><span class="cx">       shouldBe(&quot;declaration.length&quot;, &quot;0&quot;);
</span><span class="cx">       shouldBe(&quot;declaration.getPropertyValue('font-synthesis')&quot;, &quot;null&quot;);
</span><span class="cx">       computedStyle = window.getComputedStyle(target, null);
</span><del>-      shouldBeEqualToString(&quot;computedStyle.getPropertyCSSValue('font-synthesis').cssText&quot;, &quot;none&quot;);
</del><ins>+      shouldBeEqualToString(&quot;computedStyle.getPropertyCSSValue('font-synthesis').cssText&quot;, &quot;style weight&quot;);
</ins><span class="cx">       stylesheet.deleteRule(0);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -79,7 +79,7 @@
</span><span class="cx">     var target = document.getElementById(&quot;p&quot;);
</span><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;#p { }&quot;, 0);
</span><del>-    testEmptyIsNone(stylesheet, target);
</del><ins>+    testEmptyIsBoth(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: initial; }&quot;, 0);
</span><span class="cx">     testInitialIsBoth(stylesheet, target);
</span><span class="lines">@@ -103,19 +103,19 @@
</span><span class="cx">     testStyleAndWeight(stylesheet, target);
</span><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: garbage style }&quot;, 0);
</span><del>-    testEmptyIsNone(stylesheet, target);
</del><ins>+    testEmptyIsBoth(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: style garbage }&quot;, 0);
</span><del>-    testEmptyIsNone(stylesheet, target);
</del><ins>+    testEmptyIsBoth(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: garbage style garbage }&quot;, 0);
</span><del>-    testEmptyIsNone(stylesheet, target);
</del><ins>+    testEmptyIsBoth(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: style garbage style }&quot;, 0);
</span><del>-    testEmptyIsNone(stylesheet, target);
</del><ins>+    testEmptyIsBoth(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">     stylesheet.insertRule(&quot;#p { font-synthesis: weight garbage }&quot;, 0);
</span><del>-    testEmptyIsNone(stylesheet, target);
</del><ins>+    testEmptyIsBoth(stylesheet, target);
</ins><span class="cx"> 
</span><span class="cx">   &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcss3textfontsynthesishtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css3-text/font-synthesis.html (0 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css3-text/font-synthesis.html                                (rev 0)
+++ trunk/LayoutTests/fast/css3-text/font-synthesis.html        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -0,0 +1,73 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;style&gt;
+@font-face {
+    font-family: &quot;CustomAhem&quot;;
+    font-weight: 400;
+    font-style: normal;
+    src: url(&quot;../../resources/Ahem.ttf&quot;) format(&quot;truetype&quot;);
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that the font-synthesis property disallows synthesis when it is specified.
+&lt;div style=&quot;font: 20px CustomAhem; position: relative;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 0px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700; position: absolute; left: 150px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font-style: italic; position: absolute; left: 300px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700; font-style: italic; position: absolute; left: 450px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font: 20px Ahem; position: relative; top: 100px;&quot;&gt;
+&lt;div style=&quot;position: absolute; left: 0px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700; position: absolute; left: 150px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font-style: italic; position: absolute; left: 300px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font-weight: 700; font-style: italic; position: absolute; left: 450px; top: 0px;&quot;&gt;
+&lt;div style=&quot;font-synthesis: none;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;div style=&quot;font-synthesis: weight style;&quot;&gt;ABCD&lt;/div&gt;
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;div style=&quot;font: 20px Ahem; position: relative; top: 200px; font-synthesis: none;&quot;&gt;
+&lt;div style=&quot;font-style: italic;&quot;&gt;
+ABCD
+&lt;/div&gt;
+&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/ChangeLog        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -1,3 +1,57 @@
</span><ins>+2015-04-27  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [Mac] [iOS] Implement font-synthesis CSS property
+        https://bugs.webkit.org/show_bug.cgi?id=144305
+
+        Reviewed by Andreas Kling.
+
+        This patch is fairly straightforward, though there are some particular pieces to the patch listed below.
+
+        The implementation of this font-synthesis CSS property lives inside FontCacheIOS and FontCacheMac. We already
+        determine if we should synthesize bold and italics, this CSS property simply guards that decision.
+
+        Because FontCache interacts with FontDescriptions and not RenderStyles, this patch moves the source of truth
+        regarding font-synthesis into FontDescription (from RenderStyle).
+
+        Test: fast/css3-text/font-synthesis.html
+
+        * css/CSSPropertyNames.in: Mark font-synthesis as a FontProperty, which means that the relevant state is kept
+        inside FontDescription. This also means that the property must be marked as a &quot;high priority&quot; property, which
+        is enforced by it existing at the top of CSSPropertyNames.in. The move to FontDescription must be done so that
+        FontCacheIOS and FontCacheMac have access to the saved state.
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::fontSynthesisFromStyle): Update to look for state in FontDescription instead of RenderStyle.
+        * css/CSSSegmentedFontFace.cpp:
+        (WebCore::CSSSegmentedFontFace::fontRanges): Guard the synthetic bold and synthic italic decision on the new
+        FontSynthesis state inside FontDescription.
+        * css/StyleBuilderConverter.h:
+        (WebCore::StyleBuilderConverter::convertFontSynthesis): Moved from
+        StyleBuilderCustom::applyValueFontSynthesis(). This is because of the updated options inside of
+        CSSPropertyNames.in
+        * css/StyleBuilderCustom.h:
+        (WebCore::StyleBuilderCustom::applyValueFontSynthesis): Deleted.
+        * platform/graphics/FontDescription.h:
+        (WebCore::FontDescription::FontDescription): Moved from RenderStyle.
+        (WebCore::FontDescription::fontSynthesis): Ditto.
+        (WebCore::FontDescription::setFontSynthesis): Ditto.
+        (WebCore::FontDescription::initialFontSynthesis): Ditto.
+        (WebCore::FontDescription::operator==): Update to include new state.
+        * platform/graphics/FontCache.h:
+        (WebCore::FontDescriptionFontDataCacheKey::makeFlagKey): Make FontDescription hashes sensitive to the new
+        state inside FontDescription.
+        * platform/graphics/ios/FontCacheIOS.mm:
+        (WebCore::FontCache::createFontPlatformData): Guard the synthetic bold and synthetic italic decision on the
+        new FontSynthesis state inside FontDescription.
+        * platform/graphics/mac/FontCacheMac.mm:
+        (WebCore::FontCache::createFontPlatformData): Ditto.
+        * platform/text/TextFlags.h: Move FontSynthesis type from RenderStyleConstants.
+        * rendering/style/RenderStyle.h:
+        (WebCore::RenderStyle::fontSynthesis): Moved to FontDescription.
+        (WebCore::RenderStyle::setFontSynthesis): Ditto.
+        (WebCore::RenderStyle::initialFontSynthesis): Ditto.
+        * rendering/style/RenderStyleConstants.h: Moved FontSynthesis type to TextFlags.
+        * rendering/style/StyleRareInheritedData.h: Remove state regarding font synthesis (moved to FontDescription)
+
</ins><span class="cx"> 2015-04-28  Youenn Fablet  &lt;youenn.fablet@crf.canon.fr&gt;
</span><span class="cx"> 
</span><span class="cx">         SharedBuffer::copy is not computing the buffer size correctly when having m_dataArray
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -1613,13 +1613,13 @@
</span><span class="cx"> 
</span><span class="cx"> static Ref&lt;CSSValue&gt; fontSynthesisFromStyle(RenderStyle&amp; style)
</span><span class="cx"> {
</span><del>-    if (style.fontSynthesis() == FontSynthesisNone)
</del><ins>+    if (style.fontDescription().fontSynthesis() == FontSynthesisNone)
</ins><span class="cx">         return cssValuePool().createIdentifierValue(CSSValueNone);
</span><span class="cx"> 
</span><span class="cx">     auto list = CSSValueList::createSpaceSeparated();
</span><del>-    if (style.fontSynthesis() &amp; FontSynthesisStyle)
</del><ins>+    if (style.fontDescription().fontSynthesis() &amp; FontSynthesisStyle)
</ins><span class="cx">         list.get().append(cssValuePool().createIdentifierValue(CSSValueStyle));
</span><del>-    if (style.fontSynthesis() &amp; FontSynthesisWeight)
</del><ins>+    if (style.fontDescription().fontSynthesis() &amp; FontSynthesisWeight)
</ins><span class="cx">         list.get().append(cssValuePool().createIdentifierValue(CSSValueWeight));
</span><span class="cx">     return Ref&lt;CSSValue&gt;(list.get());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -118,6 +118,7 @@
</span><span class="cx"> -webkit-writing-mode [Inherited, Custom=Value]
</span><span class="cx"> -epub-writing-mode = -webkit-writing-mode
</span><span class="cx"> zoom [Custom=All]
</span><ins>+font-synthesis [Inherited, FontProperty, Converter=FontSynthesis]
</ins><span class="cx"> 
</span><span class="cx"> // Keep this in between the highest priority props and the lower ones.
</span><span class="cx"> -webkit-ruby-position [Inherited]
</span><span class="lines">@@ -223,7 +224,6 @@
</span><span class="cx"> flood-opacity [SVG, Converter=Opacity]
</span><span class="cx"> font [Inherited, Longhands=font-family|font-size|font-style|font-variant|font-weight|line-height]
</span><span class="cx"> font-stretch [SkipBuilder]
</span><del>-font-synthesis [Inherited, Custom=Value]
</del><span class="cx"> glyph-orientation-horizontal [Inherited, SVG, Converter=GlyphOrientation]
</span><span class="cx"> glyph-orientation-vertical [Inherited, SVG, Converter=GlyphOrientationOrAuto]
</span><span class="cx"> height [Initial=initialSize, Converter=LengthSizing]
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSSegmentedFontFacecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/css/CSSSegmentedFontFace.cpp        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -113,7 +113,9 @@
</span><span class="cx">         return FontRanges();
</span><span class="cx"> 
</span><span class="cx">     FontTraitsMask desiredTraitsMask = fontDescription.traitsMask();
</span><del>-    unsigned hashKey = ((fontDescription.computedPixelSize() + 1) &lt;&lt; (FontTraitsMaskWidth + FontWidthVariantWidth + 1))
</del><ins>+    // FIXME: Unify this function with FontDescriptionFontDataCacheKey in FontCache.h (Or just use the regular FontCache instead of this)
+    unsigned hashKey = ((fontDescription.computedPixelSize() + 1) &lt;&lt; (FontTraitsMaskWidth + FontWidthVariantWidth + FontSynthesisWidth + 1))
+        | (fontDescription.fontSynthesis() &lt;&lt; (FontTraitsMaskWidth + FontWidthVariantWidth + 1))
</ins><span class="cx">         | ((fontDescription.orientation() == Vertical ? 1 : 0) &lt;&lt; (FontTraitsMaskWidth + FontWidthVariantWidth))
</span><span class="cx">         | fontDescription.widthVariant() &lt;&lt; FontTraitsMaskWidth
</span><span class="cx">         | desiredTraitsMask;
</span><span class="lines">@@ -125,9 +127,11 @@
</span><span class="cx">         for (auto&amp; face : m_fontFaces) {
</span><span class="cx">             if (!face-&gt;isValid())
</span><span class="cx">                 continue;
</span><ins>+
</ins><span class="cx">             FontTraitsMask traitsMask = face-&gt;traitsMask();
</span><del>-            bool syntheticBold = !(traitsMask &amp; (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) &amp;&amp; (desiredTraitsMask &amp; (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
-            bool syntheticItalic = !(traitsMask &amp; FontStyleItalicMask) &amp;&amp; (desiredTraitsMask &amp; FontStyleItalicMask);
</del><ins>+            bool syntheticBold = (fontDescription.fontSynthesis() &amp; FontSynthesisWeight) &amp;&amp; !(traitsMask &amp; (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask)) &amp;&amp; (desiredTraitsMask &amp; (FontWeight600Mask | FontWeight700Mask | FontWeight800Mask | FontWeight900Mask));
+            bool syntheticItalic = (fontDescription.fontSynthesis() &amp; FontSynthesisStyle) &amp;&amp; !(traitsMask &amp; FontStyleItalicMask) &amp;&amp; (desiredTraitsMask &amp; FontStyleItalicMask);
+
</ins><span class="cx">             if (RefPtr&lt;Font&gt; faceFont = face-&gt;font(fontDescription, syntheticBold, syntheticItalic))
</span><span class="cx">                 appendFontWithInvalidUnicodeRangeIfLoading(fontRanges, faceFont.releaseNonNull(), face-&gt;ranges());
</span><span class="cx">         }
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderConverterh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderConverter.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/css/StyleBuilderConverter.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -124,6 +124,7 @@
</span><span class="cx">     static EGlyphOrientation convertGlyphOrientation(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static EGlyphOrientation convertGlyphOrientationOrAuto(StyleResolver&amp;, CSSValue&amp;);
</span><span class="cx">     static Optional&lt;Length&gt; convertLineHeight(StyleResolver&amp;, CSSValue&amp;, float multiplier = 1.f);
</span><ins>+    static FontSynthesis convertFontSynthesis(StyleResolver&amp;, CSSValue&amp;);
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     friend class StyleBuilderCustom;
</span><span class="lines">@@ -1211,6 +1212,32 @@
</span><span class="cx">     return Nullopt;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+FontSynthesis StyleBuilderConverter::convertFontSynthesis(StyleResolver&amp;, CSSValue&amp; value)
+{
+    if (is&lt;CSSPrimitiveValue&gt;(value)) {
+        ASSERT(downcast&lt;CSSPrimitiveValue&gt;(value).getValueID() == CSSValueNone);
+        return FontSynthesisNone;
+    }
+
+    FontSynthesis result = FontSynthesisNone;
+    ASSERT(is&lt;CSSValueList&gt;(value));
+    for (CSSValue&amp; v : downcast&lt;CSSValueList&gt;(value)) {
+        switch (downcast&lt;CSSPrimitiveValue&gt;(v).getValueID()) {
+        case CSSValueWeight:
+            result |= FontSynthesisWeight;
+            break;
+        case CSSValueStyle:
+            result |= FontSynthesisStyle;
+            break;
+        default:
+            ASSERT_NOT_REACHED();
+            break;
+        }
+    }
+
+    return result;
+}
+
</ins><span class="cx"> } // namespace WebCore
</span><span class="cx"> 
</span><span class="cx"> #endif // StyleBuilderConverter_h
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleBuilderCustomh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleBuilderCustom.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/css/StyleBuilderCustom.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -76,7 +76,6 @@
</span><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><del>-    DECLARE_PROPERTY_CUSTOM_HANDLERS(FontSynthesis);
</del><span class="cx"> #if ENABLE(CSS_IMAGE_RESOLUTION)
</span><span class="cx">     DECLARE_PROPERTY_CUSTOM_HANDLERS(ImageResolution);
</span><span class="cx"> #endif
</span><span class="lines">@@ -1376,32 +1375,6 @@
</span><span class="cx">     styleResolver.setFontDescription(fontDescription);
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-inline void StyleBuilderCustom::applyValueFontSynthesis(StyleResolver&amp; styleResolver, CSSValue&amp; value)
-{
-    if (is&lt;CSSPrimitiveValue&gt;(value)) {
-        ASSERT(downcast&lt;CSSPrimitiveValue&gt;(value).getValueID() == CSSValueNone);
-        styleResolver.style()-&gt;setFontSynthesis(FontSynthesisNone);
-    }
-
-    FontSynthesis result = FontSynthesisNone;
-    ASSERT(is&lt;CSSValueList&gt;(value));
-    for (CSSValue&amp; i : downcast&lt;CSSValueList&gt;(value)) {
-        switch (downcast&lt;CSSPrimitiveValue&gt;(i).getValueID()) {
-        case CSSValueWeight:
-            result |= FontSynthesisWeight;
-            break;
-        case CSSValueStyle:
-            result |= FontSynthesisStyle;
-            break;
-        default:
-            ASSERT_NOT_REACHED();
-            break;
-        }
-    }
-
-    styleResolver.style()-&gt;setFontSynthesis(result);
-}
-
</del><span class="cx"> inline void StyleBuilderCustom::applyInitialColumnGap(StyleResolver&amp; styleResolver)
</span><span class="cx"> {
</span><span class="cx">     styleResolver.style()-&gt;setHasNormalColumnGap();
</span></span></pre></div>
<a id="trunkSourceWebCorecssStyleResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StyleResolver.cpp (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StyleResolver.cpp        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/css/StyleResolver.cpp        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -168,7 +168,7 @@
</span><span class="cx"> 
</span><span class="cx"> using namespace HTMLNames;
</span><span class="cx"> 
</span><del>-static const CSSPropertyID lastHighPriorityProperty = CSSPropertyZoom;
</del><ins>+static const CSSPropertyID lastHighPriorityProperty = CSSPropertyFontSynthesis;
</ins><span class="cx"> static const CSSPropertyID firstLowPriorityProperty = static_cast&lt;CSSPropertyID&gt;(lastHighPriorityProperty + 1);
</span><span class="cx"> 
</span><span class="cx"> class StyleResolver::CascadedProperties {
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -79,7 +79,8 @@
</span><span class="cx">     { }
</span><span class="cx">     static unsigned makeFlagKey(const FontDescription&amp; description)
</span><span class="cx">     {
</span><del>-        return static_cast&lt;unsigned&gt;(description.widthVariant()) &lt;&lt; 4
</del><ins>+        return static_cast&lt;unsigned&gt;(description.fontSynthesis()) &lt;&lt; 6
+            | static_cast&lt;unsigned&gt;(description.widthVariant()) &lt;&lt; 4
</ins><span class="cx">             | static_cast&lt;unsigned&gt;(description.nonCJKGlyphOrientation()) &lt;&lt; 3
</span><span class="cx">             | static_cast&lt;unsigned&gt;(description.orientation()) &lt;&lt; 2
</span><span class="cx">             | static_cast&lt;unsigned&gt;(description.italic()) &lt;&lt; 1
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontDescriptionh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontDescription.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontDescription.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/platform/graphics/FontDescription.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx">         , m_textRendering(AutoTextRendering)
</span><span class="cx">         , m_isSpecifiedFont(false)
</span><span class="cx">         , m_script(USCRIPT_COMMON)
</span><ins>+        , m_fontSynthesis(initialFontSynthesis())
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -109,6 +110,7 @@
</span><span class="cx">     NonCJKGlyphOrientation nonCJKGlyphOrientation() const { return static_cast&lt;NonCJKGlyphOrientation&gt;(m_nonCJKGlyphOrientation); }
</span><span class="cx">     FontWidthVariant widthVariant() const { return static_cast&lt;FontWidthVariant&gt;(m_widthVariant); }
</span><span class="cx">     FontFeatureSettings* featureSettings() const { return m_featureSettings.get(); }
</span><ins>+    FontSynthesis fontSynthesis() const { return static_cast&lt;FontSynthesis&gt;(m_fontSynthesis); }
</ins><span class="cx"> 
</span><span class="cx">     void setOneFamily(const AtomicString&amp; family) { ASSERT(m_families.size() == 1); m_families[0] = family; }
</span><span class="cx">     void setFamilies(const Vector&lt;AtomicString&gt;&amp; families) { m_families = RefCountedArray&lt;AtomicString&gt;(families); }
</span><span class="lines">@@ -147,6 +149,7 @@
</span><span class="cx">     void setWidthVariant(FontWidthVariant widthVariant) { m_widthVariant = widthVariant; }
</span><span class="cx">     void setScript(UScriptCode s) { m_script = s; }
</span><span class="cx">     void setFeatureSettings(PassRefPtr&lt;FontFeatureSettings&gt; settings) { m_featureSettings = settings; }
</span><ins>+    void setFontSynthesis(FontSynthesis fontSynthesis) { m_fontSynthesis = fontSynthesis; }
</ins><span class="cx"> 
</span><span class="cx"> #if ENABLE(IOS_TEXT_AUTOSIZING)
</span><span class="cx">     bool familiesEqualForTextAutoSizing(const FontDescription&amp; other) const;
</span><span class="lines">@@ -166,6 +169,7 @@
</span><span class="cx">     static Kerning initialKerning() { return AutoKerning; }
</span><span class="cx">     static FontSmoothingMode initialFontSmoothing() { return AutoSmoothing; }
</span><span class="cx">     static TextRenderingMode initialTextRenderingMode() { return AutoTextRendering; }
</span><ins>+    static FontSynthesis initialFontSynthesis() { return FontSynthesisWeight | FontSynthesisStyle; }
</ins><span class="cx"> 
</span><span class="cx"> private:
</span><span class="cx">     RefCountedArray&lt;AtomicString&gt; m_families;
</span><span class="lines">@@ -201,6 +205,7 @@
</span><span class="cx">     unsigned m_textRendering : 2; // TextRenderingMode
</span><span class="cx">     unsigned m_isSpecifiedFont : 1; // True if a web page specifies a non-generic font family as the first font family.
</span><span class="cx">     unsigned m_script : 7; // Used to help choose an appropriate font for generic font families.
</span><ins>+    unsigned m_fontSynthesis : 2; // FontSynthesis type
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> inline bool FontDescription::operator==(const FontDescription&amp; other) const
</span><span class="lines">@@ -225,7 +230,8 @@
</span><span class="cx">         &amp;&amp; m_nonCJKGlyphOrientation == other.m_nonCJKGlyphOrientation
</span><span class="cx">         &amp;&amp; m_widthVariant == other.m_widthVariant
</span><span class="cx">         &amp;&amp; m_script == other.m_script
</span><del>-        &amp;&amp; m_featureSettings == other.m_featureSettings;
</del><ins>+        &amp;&amp; m_featureSettings == other.m_featureSettings
+        &amp;&amp; m_fontSynthesis == other.m_fontSynthesis;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsiosFontCacheIOSmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/platform/graphics/ios/FontCacheIOS.mm        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -694,8 +694,8 @@
</span><span class="cx"> 
</span><span class="cx">     bool isAppleColorEmoji = CTFontIsAppleColorEmoji(ctFont.get());
</span><span class="cx"> 
</span><del>-    bool syntheticBold = (traits &amp; kCTFontTraitBold) &amp;&amp; !(actualTraits &amp; kCTFontTraitBold) &amp;&amp; !isAppleColorEmoji;
-    bool syntheticOblique = (traits &amp; kCTFontTraitItalic) &amp;&amp; !(actualTraits &amp; kCTFontTraitItalic) &amp;&amp; !isAppleColorEmoji;
</del><ins>+    bool syntheticBold = (fontDescription.fontSynthesis() &amp; FontSynthesisWeight) &amp;&amp; (traits &amp; kCTFontTraitBold) &amp;&amp; !(actualTraits &amp; kCTFontTraitBold) &amp;&amp; !isAppleColorEmoji;
+    bool syntheticOblique = (fontDescription.fontSynthesis() &amp; FontSynthesisStyle) &amp;&amp; (traits &amp; kCTFontTraitItalic) &amp;&amp; !(actualTraits &amp; kCTFontTraitItalic) &amp;&amp; !isAppleColorEmoji;
</ins><span class="cx"> 
</span><span class="cx">     auto result = std::make_unique&lt;FontPlatformData&gt;(ctFont.get(), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
</span><span class="cx">     if (isAppleColorEmoji)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacFontCacheMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/platform/graphics/mac/FontCacheMac.mm        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -509,8 +509,8 @@
</span><span class="cx">     NSInteger actualWeight = [fontManager weightOfFont:nsFont];
</span><span class="cx"> 
</span><span class="cx">     NSFont *platformFont = [nsFont printerFont];
</span><del>-    bool syntheticBold = isAppKitFontWeightBold(weight) &amp;&amp; !isAppKitFontWeightBold(actualWeight);
-    bool syntheticOblique = (traits &amp; NSFontItalicTrait) &amp;&amp; !(actualTraits &amp; NSFontItalicTrait);
</del><ins>+    bool syntheticBold = (fontDescription.fontSynthesis() &amp; FontSynthesisWeight) &amp;&amp; isAppKitFontWeightBold(weight) &amp;&amp; !isAppKitFontWeightBold(actualWeight);
+    bool syntheticOblique = (fontDescription.fontSynthesis() &amp; FontSynthesisStyle) &amp;&amp; (traits &amp; NSFontItalicTrait) &amp;&amp; !(actualTraits &amp; NSFontItalicTrait);
</ins><span class="cx"> 
</span><span class="cx">     return std::make_unique&lt;FontPlatformData&gt;(reinterpret_cast&lt;CTFontRef&gt;(platformFont), size, syntheticBold, syntheticOblique, fontDescription.orientation(), fontDescription.widthVariant());
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextTextFlagsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/text/TextFlags.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/TextFlags.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/platform/text/TextFlags.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -59,6 +59,14 @@
</span><span class="cx"> };
</span><span class="cx"> typedef unsigned ExpansionBehavior;
</span><span class="cx"> 
</span><ins>+enum FontSynthesisValues {
+    FontSynthesisNone = 0x0,
+    FontSynthesisWeight = 0x1,
+    FontSynthesisStyle = 0x2
+};
+typedef unsigned FontSynthesis;
+const unsigned FontSynthesisWidth = 2;
+
</ins><span class="cx"> enum FontWidthVariant {
</span><span class="cx">     RegularWidth,
</span><span class="cx">     HalfWidth,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyle.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/rendering/style/RenderStyle.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -1025,8 +1025,6 @@
</span><span class="cx"> 
</span><span class="cx">     TextOrientation textOrientation() const { return static_cast&lt;TextOrientation&gt;(rareInheritedData-&gt;m_textOrientation); }
</span><span class="cx"> 
</span><del>-    FontSynthesis fontSynthesis() const { return static_cast&lt;FontSynthesis&gt;(rareInheritedData-&gt;fontSynthesis); }
-
</del><span class="cx">     ObjectFit objectFit() const { return static_cast&lt;ObjectFit&gt;(rareNonInheritedData-&gt;m_objectFit); }
</span><span class="cx">     
</span><span class="cx">     // Return true if any transform related property (currently transform, transformStyle3D or perspective) 
</span><span class="lines">@@ -1541,7 +1539,6 @@
</span><span class="cx">     void setMarginAfterCollapse(EMarginCollapse c) { SET_VAR(rareNonInheritedData, marginAfterCollapse, c); }
</span><span class="cx">     void setWordBreak(EWordBreak b) { SET_VAR(rareInheritedData, wordBreak, b); }
</span><span class="cx">     void setOverflowWrap(EOverflowWrap b) { SET_VAR(rareInheritedData, overflowWrap, b); }
</span><del>-    void setFontSynthesis(FontSynthesis synthesis) { SET_VAR(rareInheritedData, fontSynthesis, synthesis); }
</del><span class="cx">     void setNBSPMode(ENBSPMode b) { SET_VAR(rareInheritedData, nbspMode, b); }
</span><span class="cx">     void setLineBreak(LineBreak b) { SET_VAR(rareInheritedData, lineBreak, b); }
</span><span class="cx">     void setHyphens(Hyphens h) { SET_VAR(rareInheritedData, hyphens, h); }
</span><span class="lines">@@ -2070,7 +2067,6 @@
</span><span class="cx">     static BlendMode initialBlendMode() { return BlendModeNormal; }
</span><span class="cx">     static Isolation initialIsolation() { return IsolationAuto; }
</span><span class="cx"> #endif
</span><del>-    static FontSynthesis initialFontSynthesis() { return FontSynthesisStyle | FontSynthesisWeight; }
</del><span class="cx"> 
</span><span class="cx">     static ptrdiff_t noninheritedFlagsMemoryOffset() { return OBJECT_OFFSETOF(RenderStyle, noninherited_flags); }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleRenderStyleConstantsh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/RenderStyleConstants.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/rendering/style/RenderStyleConstants.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -417,13 +417,6 @@
</span><span class="cx">     CAPITALIZE, UPPERCASE, LOWERCASE, TTNONE
</span><span class="cx"> };
</span><span class="cx"> 
</span><del>-enum FontSynthesisValues {
-    FontSynthesisNone = 0x0,
-    FontSynthesisWeight = 0x1,
-    FontSynthesisStyle = 0x2
-};
-typedef unsigned FontSynthesis;
-
</del><span class="cx"> #if ENABLE(LETTERPRESS)
</span><span class="cx"> static const size_t TextDecorationBits = 5;
</span><span class="cx"> #else
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleStyleRareInheritedDatah"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h (183493 => 183494)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2015-04-28 18:04:11 UTC (rev 183493)
+++ trunk/Source/WebCore/rendering/style/StyleRareInheritedData.h        2015-04-28 18:36:59 UTC (rev 183494)
</span><span class="lines">@@ -133,8 +133,6 @@
</span><span class="cx">     unsigned trailingWord : 1;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><del>-    unsigned fontSynthesis : 2;
-
</del><span class="cx">     AtomicString hyphenationString;
</span><span class="cx">     short hyphenationLimitBefore;
</span><span class="cx">     short hyphenationLimitAfter;
</span></span></pre>
</div>
</div>

</body>
</html>