<!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>[197573] 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/197573">197573</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2016-03-04 11:09:37 -0800 (Fri, 04 Mar 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>Whitespace causes font-variant: all-small-caps to synthesize
https://bugs.webkit.org/show_bug.cgi?id=155004
&lt;rdar://problem/24630796&gt;

Reviewed by Darin Adler.

Source/WebCore:

Many fonts (such as Avenir Next) don't report to support whitespace characters under
smcp or c2sc. Previously, we were using this as a signal to synthesize small caps
instead of true small caps. However, a better solution is for whitespace to never
cause synthesis with all-small-caps.

Test: fast/text/all-small-caps-whitespace.html

* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::shouldSynthesize):
(WebCore::ComplexTextController::collectComplexTextRuns):

Tools:

* DumpRenderTree/mac/DumpRenderTree.mm:
(allowedFontFamilySet):
* WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
(WTR::allowedFontFamilySet):
* WebKitTestRunner/mac/TestControllerMac.mm:
(WTR::allowedFontFamilySet):

LayoutTests:

* fast/text/all-small-caps-whitespace-expected.html: Added.
* fast/text/all-small-caps-whitespace.html: Added.
* platform/mac/TestExpectations: Skip on platforms which don't support proper coverage
queries.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp">trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsDumpRenderTreemacDumpRenderTreemm">trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnerInjectedBundlecocoaActivateFontsCocoamm">trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm</a></li>
<li><a href="#trunkToolsWebKitTestRunnermacTestControllerMacmm">trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextallsmallcapswhitespaceexpectedhtml">trunk/LayoutTests/fast/text/all-small-caps-whitespace-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextallsmallcapswhitespacehtml">trunk/LayoutTests/fast/text/all-small-caps-whitespace.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/LayoutTests/ChangeLog        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -1,3 +1,16 @@
</span><ins>+2016-03-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        Whitespace causes font-variant: all-small-caps to synthesize
+        https://bugs.webkit.org/show_bug.cgi?id=155004
+        &lt;rdar://problem/24630796&gt;
+
+        Reviewed by Darin Adler.
+
+        * fast/text/all-small-caps-whitespace-expected.html: Added.
+        * fast/text/all-small-caps-whitespace.html: Added.
+        * platform/mac/TestExpectations: Skip on platforms which don't support proper coverage
+        queries.
+
</ins><span class="cx"> 2016-03-04  Simon Fraser  &lt;simon.fraser@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION (r197541): many tiled drawing tests failing after new &quot;large tile size&quot; logic was added
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextallsmallcapswhitespaceexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/all-small-caps-whitespace-expected.html (0 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/all-small-caps-whitespace-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/all-small-caps-whitespace-expected.html        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that font-variant: all-small-caps doesn't cause synthesis due to whitespace. Avenir Next says that it supports all of the following characters except the space. This space character should not make us synthesize.
+&lt;div style=&quot;font: 100px 'Avenir Next'; font-feature-settings: 'smcp', 'c2sc';&quot;&gt;Hello Kitty!&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasttextallsmallcapswhitespacehtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/all-small-caps-whitespace.html (0 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/all-small-caps-whitespace.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/all-small-caps-whitespace.html        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -0,0 +1,9 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that font-variant: all-small-caps doesn't cause synthesis due to whitespace. Avenir Next says that it supports all of the following characters except the space. This space character should not make us synthesize.
+&lt;div style=&quot;font: 100px 'Avenir Next'; font-variant: all-small-caps;&quot;&gt;Hello Kitty!&lt;/div&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -1296,6 +1296,7 @@
</span><span class="cx"> # Yosemite and El Capitan do not support font feature coverage queries.
</span><span class="cx"> [ Yosemite ElCapitan ] css3/font-variant-small-caps-synthesis-coverage.html [ ImageOnlyFailure ]
</span><span class="cx"> [ Yosemite ElCapitan ] css3/font-variant-petite-caps-synthesis-coverage.html [ ImageOnlyFailure ]
</span><ins>+[ Yosemite ElCapitan ] fast/text/all-small-caps-whitespace.html [ ImageOnlyFailure ]
</ins><span class="cx"> 
</span><span class="cx"> # Temporarily disable font feature synthesis tests.
</span><span class="cx"> [ Yosemite ElCapitan ] css3/font-variant-small-caps-synthesis.html [ ImageOnlyFailure ]
</span><span class="lines">@@ -1328,3 +1329,4 @@
</span><span class="cx"> webkit.org/b/152506 webgl/1.0.2/conformance/extensions/get-extension.html [ Pass Timeout ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/154709 [ ElCapitan+ ] fast/text/crash-complex-text-surrogate.html [ Pass Failure ]
</span><ins>+
</ins></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/Source/WebCore/ChangeLog        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -1,5 +1,24 @@
</span><span class="cx"> 2016-03-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Whitespace causes font-variant: all-small-caps to synthesize
+        https://bugs.webkit.org/show_bug.cgi?id=155004
+        &lt;rdar://problem/24630796&gt;
+
+        Reviewed by Darin Adler.
+
+        Many fonts (such as Avenir Next) don't report to support whitespace characters under
+        smcp or c2sc. Previously, we were using this as a signal to synthesize small caps
+        instead of true small caps. However, a better solution is for whitespace to never
+        cause synthesis with all-small-caps.
+
+        Test: fast/text/all-small-caps-whitespace.html
+
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::shouldSynthesize):
+        (WebCore::ComplexTextController::collectComplexTextRuns):
+
+2016-03-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
</ins><span class="cx">         [iOS] Crash during font loading when injected bundle cancels load
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=155001
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -304,6 +304,17 @@
</span><span class="cx">     return Nullopt;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool shouldSynthesize(const Font* nextFont, UChar32 baseCharacter, Optional&lt;UChar32&gt; capitalizedBase, FontVariantCaps fontVariantCaps, bool engageAllSmallCapsProcessing)
+{
+    if (!nextFont || nextFont == Font::systemFallback())
+        return false;
+    if (engageAllSmallCapsProcessing &amp;&amp; isASCIISpace(baseCharacter))
+        return false;
+    if (!engageAllSmallCapsProcessing &amp;&amp; !capitalizedBase)
+        return false;
+    return !nextFont-&gt;variantCapsSupportsCharacterForSynthesis(fontVariantCaps, baseCharacter);
+}
+
</ins><span class="cx"> void ComplexTextController::collectComplexTextRuns()
</span><span class="cx"> {
</span><span class="cx">     if (!m_end)
</span><span class="lines">@@ -346,8 +357,7 @@
</span><span class="cx">     bool nextIsSmallCaps = false;
</span><span class="cx"> 
</span><span class="cx">     auto capitalizedBase = capitalized(baseCharacter);
</span><del>-    if (nextFont &amp;&amp; nextFont != Font::systemFallback() &amp;&amp; (capitalizedBase || engageAllSmallCapsProcessing)
-        &amp;&amp; !nextFont-&gt;variantCapsSupportsCharacterForSynthesis(fontVariantCaps, baseCharacter)) {
</del><ins>+    if (shouldSynthesize(nextFont, baseCharacter, capitalizedBase, fontVariantCaps, engageAllSmallCapsProcessing)) {
</ins><span class="cx">         synthesizedFont = &amp;nextFont-&gt;noSynthesizableFeaturesFont();
</span><span class="cx">         smallSynthesizedFont = synthesizedFont-&gt;smallCapsFont(m_font.fontDescription());
</span><span class="cx">         UChar32 characterToWrite = capitalizedBase ? capitalizedBase.value() : cp[0];
</span><span class="lines">@@ -388,8 +398,7 @@
</span><span class="cx">             nextFont = m_font.fontForCombiningCharacterSequence(cp + index, curr - cp - index);
</span><span class="cx"> 
</span><span class="cx">         capitalizedBase = capitalized(baseCharacter);
</span><del>-        if (!synthesizedFont &amp;&amp; nextFont &amp;&amp; nextFont != Font::systemFallback() &amp;&amp; (capitalizedBase || engageAllSmallCapsProcessing)
-            &amp;&amp; !nextFont-&gt;variantCapsSupportsCharacterForSynthesis(fontVariantCaps, baseCharacter)) {
</del><ins>+        if (!synthesizedFont &amp;&amp; shouldSynthesize(nextFont, baseCharacter, capitalizedBase, fontVariantCaps, engageAllSmallCapsProcessing)) {
</ins><span class="cx">             // Rather than synthesize each character individually, we should synthesize the entire &quot;run&quot; if any character requires synthesis.
</span><span class="cx">             synthesizedFont = &amp;nextFont-&gt;noSynthesizableFeaturesFont();
</span><span class="cx">             smallSynthesizedFont = synthesizedFont-&gt;smallCapsFont(m_font.fontDescription());
</span></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/Tools/ChangeLog        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -1,5 +1,20 @@
</span><span class="cx"> 2016-03-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><ins>+        Whitespace causes font-variant: all-small-caps to synthesize
+        https://bugs.webkit.org/show_bug.cgi?id=155004
+        &lt;rdar://problem/24630796&gt;
+
+        Reviewed by Darin Adler.
+
+        * DumpRenderTree/mac/DumpRenderTree.mm:
+        (allowedFontFamilySet):
+        * WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm:
+        (WTR::allowedFontFamilySet):
+        * WebKitTestRunner/mac/TestControllerMac.mm:
+        (WTR::allowedFontFamilySet):
+
+2016-03-04  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
</ins><span class="cx">         [iOS] Crash during font loading when injected bundle cancels load
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=155001
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkToolsDumpRenderTreemacDumpRenderTreemm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/Tools/DumpRenderTree/mac/DumpRenderTree.mm        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -319,6 +319,7 @@
</span><span class="cx">         @&quot;Arial Rounded MT Bold&quot;,
</span><span class="cx">         @&quot;Arial Unicode MS&quot;,
</span><span class="cx">         @&quot;Arial&quot;,
</span><ins>+        @&quot;Avenir Next&quot;,
</ins><span class="cx">         @&quot;Ayuthaya&quot;,
</span><span class="cx">         @&quot;Baghdad&quot;,
</span><span class="cx">         @&quot;Baskerville&quot;,
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnerInjectedBundlecocoaActivateFontsCocoamm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/Tools/WebKitTestRunner/InjectedBundle/cocoa/ActivateFontsCocoa.mm        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -68,6 +68,7 @@
</span><span class="cx">         @&quot;Arial Rounded MT Bold&quot;,
</span><span class="cx">         @&quot;Arial Unicode MS&quot;,
</span><span class="cx">         @&quot;Arial&quot;,
</span><ins>+        @&quot;Avenir Next&quot;,
</ins><span class="cx">         @&quot;Ayuthaya&quot;,
</span><span class="cx">         @&quot;Baghdad&quot;,
</span><span class="cx">         @&quot;Baskerville&quot;,
</span></span></pre></div>
<a id="trunkToolsWebKitTestRunnermacTestControllerMacmm"></a>
<div class="modfile"><h4>Modified: trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm (197572 => 197573)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2016-03-04 19:05:00 UTC (rev 197572)
+++ trunk/Tools/WebKitTestRunner/mac/TestControllerMac.mm        2016-03-04 19:09:37 UTC (rev 197573)
</span><span class="lines">@@ -149,6 +149,7 @@
</span><span class="cx">         @&quot;Arial Rounded MT Bold&quot;,
</span><span class="cx">         @&quot;Arial Unicode MS&quot;,
</span><span class="cx">         @&quot;Arial&quot;,
</span><ins>+        @&quot;Avenir Next&quot;,
</ins><span class="cx">         @&quot;Ayuthaya&quot;,
</span><span class="cx">         @&quot;Baghdad&quot;,
</span><span class="cx">         @&quot;Baskerville&quot;,
</span></span></pre>
</div>
</div>

</body>
</html>