<!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>[201978] 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/201978">201978</a></dd>
<dt>Author</dt> <dd>mmaxfield@apple.com</dd>
<dt>Date</dt> <dd>2016-06-11 14:48:15 -0700 (Sat, 11 Jun 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
https://bugs.webkit.org/show_bug.cgi?id=158649
&lt;rdar://problem/13258122&gt;

Reviewed by Darin Adler.

Source/WebCore:

There are many Chinese websites which hardcode Windows font names.
We should map these to fonts which best match them on Cocoa operating
systems. We can do this by using our existing fallback font name
infrastructure.

Tests: fast/text/chinese-font-name-aliases-2.html
       fast/text/chinese-font-name-aliases.html

* platform/graphics/FontCache.cpp:
(WebCore::FontCache::alternateFamilyName):
(WebCore::alternateFamilyName): Deleted.
* platform/graphics/FontCache.h:
* platform/graphics/cocoa/FontCacheCoreText.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/freetype/FontCacheFreeType.cpp:
(WebCore::FontCache::platformAlternateFamilyName):
* platform/graphics/win/FontCacheWin.cpp:
(WebCore::FontCache::platformAlternateFamilyName):

Source/WTF:

* wtf/text/StringCommon.h:
(WTF::naiveEqualWithoutPerformingUnicodeNormalization): Added.

Tools:

* TestWebKitAPI/Tests/WTF/WTFString.h:
(TestWebKitAPI::TEST):

LayoutTests:

Because this tests platform-specific font names, the test must
be platform-specific. Because it's a ref test, make two tests which
are mutually-exclusive on Cocoa platforms, and expected to fail
everywhere else.

* fast/text/chinese-font-name-aliases-2-expected.html: Added.
* fast/text/chinese-font-name-aliases-2.html: Added.
* fast/text/chinese-font-name-aliases-expected.html: Added.
* fast/text/chinese-font-name-aliases.html: Added.
* platform/efl/TestExpectations:
* platform/gtk/TestExpectations:
* platform/ios-simulator/TestExpectations:
* platform/mac/TestExpectations:
* platform/win/TestExpectations:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsplatformeflTestExpectations">trunk/LayoutTests/platform/efl/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformgtkTestExpectations">trunk/LayoutTests/platform/gtk/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformiossimulatorTestExpectations">trunk/LayoutTests/platform/ios-simulator/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformmacTestExpectations">trunk/LayoutTests/platform/mac/TestExpectations</a></li>
<li><a href="#trunkLayoutTestsplatformwinTestExpectations">trunk/LayoutTests/platform/win/TestExpectations</a></li>
<li><a href="#trunkSourceWTFChangeLog">trunk/Source/WTF/ChangeLog</a></li>
<li><a href="#trunkSourceWTFwtftextStringCommonh">trunk/Source/WTF/wtf/text/StringCommon.h</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCachecpp">trunk/Source/WebCore/platform/graphics/FontCache.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCacheh">trunk/Source/WebCore/platform/graphics/FontCache.h</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp">trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp">trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicswinFontCacheWincpp">trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp</a></li>
<li><a href="#trunkToolsChangeLog">trunk/Tools/ChangeLog</a></li>
<li><a href="#trunkToolsTestWebKitAPITestsWTFWTFStringcpp">trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextchinesefontnamealiases2expectedhtml">trunk/LayoutTests/fast/text/chinese-font-name-aliases-2-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextchinesefontnamealiases2html">trunk/LayoutTests/fast/text/chinese-font-name-aliases-2.html</a></li>
<li><a href="#trunkLayoutTestsfasttextchinesefontnamealiasesexpectedhtml">trunk/LayoutTests/fast/text/chinese-font-name-aliases-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextchinesefontnamealiaseshtml">trunk/LayoutTests/fast/text/chinese-font-name-aliases.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/LayoutTests/ChangeLog        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2016-06-11  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
+        https://bugs.webkit.org/show_bug.cgi?id=158649
+        &lt;rdar://problem/13258122&gt;
+
+        Reviewed by Darin Adler.
+
+        Because this tests platform-specific font names, the test must
+        be platform-specific. Because it's a ref test, make two tests which
+        are mutually-exclusive on Cocoa platforms, and expected to fail
+        everywhere else.
+
+        * fast/text/chinese-font-name-aliases-2-expected.html: Added.
+        * fast/text/chinese-font-name-aliases-2.html: Added.
+        * fast/text/chinese-font-name-aliases-expected.html: Added.
+        * fast/text/chinese-font-name-aliases.html: Added.
+        * platform/efl/TestExpectations:
+        * platform/gtk/TestExpectations:
+        * platform/ios-simulator/TestExpectations:
+        * platform/mac/TestExpectations:
+        * platform/win/TestExpectations:
+
</ins><span class="cx"> 2016-06-11  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r201967, r201968, and r201972.
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextchinesefontnamealiases2expectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/chinese-font-name-aliases-2-expected.html (0 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/chinese-font-name-aliases-2-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/chinese-font-name-aliases-2-expected.html        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;style&gt;
+.item {
+        font-size: 48px;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that Windows font names are aliased to specific fonts which exist on Cocoa platforms. Note the expected results of this test will vary depending on which operating system is used.
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Heiti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Heiti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Heiti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Heiti TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Heiti TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextchinesefontnamealiases2html"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/chinese-font-name-aliases-2.html (0 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/chinese-font-name-aliases-2.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/chinese-font-name-aliases-2.html        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -0,0 +1,24 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;style&gt;
+.item {
+        font-size: 48px;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that Windows font names are aliased to specific fonts which exist on Cocoa platforms. Note the expected results of this test will vary depending on which operating system is used.
+&lt;span class=&quot;item&quot; style=&quot;font-family: '宋体';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '\5b8b\4f53';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'SimSun';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Microsoft YaHei';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '微软雅黑';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '黑体';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Microsoft JhengHei';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '微軟正黑體';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'MS MingLiU';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '微軟新細明體';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextchinesefontnamealiasesexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/chinese-font-name-aliases-expected.html (0 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/chinese-font-name-aliases-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/chinese-font-name-aliases-expected.html        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;style&gt;
+.item {
+        font-size: 48px;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that Windows font names are aliased to specific fonts which exist on Cocoa platforms. Note the expected results of this test will vary depending on which operating system is used.
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'PingFang SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'PingFang SC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'PingFang TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'PingFang TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Songti TC';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextchinesefontnamealiaseshtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/chinese-font-name-aliases.html (0 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/chinese-font-name-aliases.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/chinese-font-name-aliases.html        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;meta charset=&quot;utf-8&quot;&gt;
+&lt;style&gt;
+.item {
+        font-size: 48px;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body&gt;
+This test makes sure that Windows font names are aliased to specific fonts which exist on Cocoa platforms. Note the expected results of this test will vary depending on which operating system is used.
+&lt;span class=&quot;item&quot; style=&quot;font-family: '宋体';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '\5b8b\4f53';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'SimSun';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '微软雅黑';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '黑体';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'Microsoft JhengHei';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '微軟正黑體';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: 'MS MingLiU';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;span class=&quot;item&quot; style=&quot;font-family: '微軟新細明體';&quot;&gt;纸牌屋雪&lt;/span&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkLayoutTestsplatformeflTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/efl/TestExpectations (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/efl/TestExpectations        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/LayoutTests/platform/efl/TestExpectations        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -2627,3 +2627,7 @@
</span><span class="cx"> webkit.org/b/158412 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/readyState_during_canplaythrough.html [ Failure ]
</span><span class="cx"> webkit.org/b/158412 imported/w3c/web-platform-tests/html/semantics/embedded-content/media-elements/track/track-element/track-api-texttracks.html [ Failure ]
</span><span class="cx"> webkit.org/b/158412 imported/w3c/web-platform-tests/html/semantics/embedded-content/the-img-element/sizes/parse-a-sizes-attribute.html [ Crash ]
</span><ins>+
+# These tests hardcode platform-specific font aliases.
+webkit.org/b/158649 fast/text/chinese-font-name-aliases.html [ ImageOnlyFailure ]
+webkit.org/b/158649 fast/text/chinese-font-name-aliases-2.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformgtkTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/TestExpectations (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/TestExpectations        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/LayoutTests/platform/gtk/TestExpectations        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -2648,3 +2648,7 @@
</span><span class="cx"> 
</span><span class="cx"> # Timing out on OS X.
</span><span class="cx"> imported/w3c/web-platform-tests/IndexedDB/idbcursor_iterating.htm [ Pass ]
</span><ins>+
+# These tests hardcode platform-specific font aliases.
+webkit.org/b/158649 fast/text/chinese-font-name-aliases.html [ ImageOnlyFailure ]
+webkit.org/b/158649 fast/text/chinese-font-name-aliases-2.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformiossimulatorTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/ios-simulator/TestExpectations (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/LayoutTests/platform/ios-simulator/TestExpectations        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -3001,3 +3001,6 @@
</span><span class="cx"> webkit.org/b/157916 http/tests/misc/slow-loading-animated-image.html [ Pass ImageOnlyFailure ]
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/158618 fast/hidpi/hidpi-3x-device-pixel-ratio.html [ Failure ]
</span><ins>+
+# These tests hardcode platform-specific font aliases.
+webkit.org/b/158649 fast/text/chinese-font-name-aliases-2.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformmacTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac/TestExpectations (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac/TestExpectations        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/LayoutTests/platform/mac/TestExpectations        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -1355,3 +1355,7 @@
</span><span class="cx"> webkit.org/b/143653 [ Yosemite ] http/tests/websocket/tests/hybi/upgrade-simple-ws.html [ Skip ] # Timeout
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/158534 css3/filters/backdrop/dynamic-backdrop-filter-change.html [ Pass ImageOnlyFailure ]
</span><ins>+
+# These tests hardcode platform-specific font aliases.
+webkit.org/b/158649 [ Yosemite ] fast/text/chinese-font-name-aliases.html [ ImageOnlyFailure ]
+webkit.org/b/158649 [ ElCapitan ] fast/text/chinese-font-name-aliases-2.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkLayoutTestsplatformwinTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/win/TestExpectations (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/win/TestExpectations        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/LayoutTests/platform/win/TestExpectations        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -3387,3 +3387,7 @@
</span><span class="cx"> 
</span><span class="cx"> # dumpPolicyDelegateCallbacks is not supported in DumpRenderTree
</span><span class="cx"> fast/loader/iframe-src-invalid-url.html [ Skip ]
</span><ins>+
+# These tests hardcode platform-specific font aliases.
+webkit.org/b/158649 fast/text/chinese-font-name-aliases.html [ ImageOnlyFailure ]
+webkit.org/b/158649 fast/text/chinese-font-name-aliases-2.html [ ImageOnlyFailure ]
</ins></span></pre></div>
<a id="trunkSourceWTFChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/ChangeLog (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/ChangeLog        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WTF/ChangeLog        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-11  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
+        https://bugs.webkit.org/show_bug.cgi?id=158649
+        &lt;rdar://problem/13258122&gt;
+
+        Reviewed by Darin Adler.
+
+        * wtf/text/StringCommon.h:
+        (WTF::naiveEqualWithoutPerformingUnicodeNormalization): Added.
+
</ins><span class="cx"> 2016-06-11  Chris Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         WorkerNavigator is missing some attributes
</span></span></pre></div>
<a id="trunkSourceWTFwtftextStringCommonh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WTF/wtf/text/StringCommon.h (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WTF/wtf/text/StringCommon.h        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WTF/wtf/text/StringCommon.h        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -323,6 +323,17 @@
</span><span class="cx">     return equal(*a, *b);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+template&lt;typename StringClass, unsigned length&gt; bool naiveEqualWithoutPerformingUnicodeNormalization(const StringClass&amp; a, const UChar (&amp;codepoints)[length])
+{
+    if (a.length() != length)
+        return false;
+
+    if (a.is8Bit())
+        return equal(a.characters8(), codepoints, length);
+
+    return equal(a.characters16(), codepoints, length);
+}
+
</ins><span class="cx"> template&lt;typename CharacterTypeA, typename CharacterTypeB&gt;
</span><span class="cx"> inline bool equalIgnoringASCIICase(const CharacterTypeA* a, const CharacterTypeB* b, unsigned length)
</span><span class="cx"> {
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WebCore/ChangeLog        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -1,3 +1,30 @@
</span><ins>+2016-06-11  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
+        https://bugs.webkit.org/show_bug.cgi?id=158649
+        &lt;rdar://problem/13258122&gt;
+
+        Reviewed by Darin Adler.
+
+        There are many Chinese websites which hardcode Windows font names.
+        We should map these to fonts which best match them on Cocoa operating
+        systems. We can do this by using our existing fallback font name
+        infrastructure.
+
+        Tests: fast/text/chinese-font-name-aliases-2.html
+               fast/text/chinese-font-name-aliases.html
+
+        * platform/graphics/FontCache.cpp:
+        (WebCore::FontCache::alternateFamilyName):
+        (WebCore::alternateFamilyName): Deleted.
+        * platform/graphics/FontCache.h:
+        * platform/graphics/cocoa/FontCacheCoreText.cpp:
+        (WebCore::FontCache::platformAlternateFamilyName):
+        * platform/graphics/freetype/FontCacheFreeType.cpp:
+        (WebCore::FontCache::platformAlternateFamilyName):
+        * platform/graphics/win/FontCacheWin.cpp:
+        (WebCore::FontCache::platformAlternateFamilyName):
+
</ins><span class="cx"> 2016-06-11  Commit Queue  &lt;commit-queue@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed, rolling out r201967, r201968, and r201972.
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCachecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.cpp (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.cpp        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WebCore/platform/graphics/FontCache.cpp        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -159,33 +159,33 @@
</span><span class="cx">     return cache;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static AtomicString alternateFamilyName(const AtomicString&amp; familyName)
</del><ins>+const AtomicString&amp; FontCache::alternateFamilyName(const AtomicString&amp; familyName)
</ins><span class="cx"> {
</span><ins>+    static NeverDestroyed&lt;AtomicString&gt; helvetica(&quot;Helvetica&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; timesNewRoman(&quot;Times New Roman&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; courierNew(&quot;Courier New&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; arial(&quot;Arial&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; courier(&quot;Courier&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; times(&quot;Times&quot;, AtomicString::ConstructFromLiteral);
+
+    const AtomicString&amp; platformSpecificAlternate = platformAlternateFamilyName(familyName);
+    if (!platformSpecificAlternate.isNull())
+        return platformSpecificAlternate;
+
</ins><span class="cx">     switch (familyName.length()) {
</span><span class="cx">     case 5:
</span><span class="cx">         if (equalLettersIgnoringASCIICase(familyName, &quot;arial&quot;))
</span><del>-            return AtomicString(&quot;Helvetica&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+            return helvetica;
</ins><span class="cx">         if (equalLettersIgnoringASCIICase(familyName, &quot;times&quot;))
</span><del>-            return AtomicString(&quot;Times New Roman&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+            return timesNewRoman;
</ins><span class="cx">         break;
</span><span class="cx">     case 7:
</span><span class="cx">         if (equalLettersIgnoringASCIICase(familyName, &quot;courier&quot;))
</span><del>-            return AtomicString(&quot;Courier New&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+            return courierNew;
</ins><span class="cx">         break;
</span><del>-#if OS(WINDOWS)
-    // On Windows, we don't support bitmap fonts, but legacy content expects support.
-    // Thus we allow Times New Roman as an alternative for the bitmap font MS Serif,
-    // even if the webpage does not specify fallback.
-    // FIXME: Seems unlikely this is still needed. If it was really needed, I think we
-    // would need it on other platforms too.
-    case 8:
-        if (equalLettersIgnoringASCIICase(familyName, &quot;ms serif&quot;))
-            return AtomicString(&quot;Times New Roman&quot;, AtomicString::ConstructFromLiteral);
-        break;
-#endif
</del><span class="cx">     case 9:
</span><span class="cx">         if (equalLettersIgnoringASCIICase(familyName, &quot;helvetica&quot;))
</span><del>-            return AtomicString(&quot;Arial&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+            return arial;
</ins><span class="cx">         break;
</span><span class="cx"> #if !OS(WINDOWS)
</span><span class="cx">     // On Windows, Courier New is a TrueType font that is always present and
</span><span class="lines">@@ -195,23 +195,12 @@
</span><span class="cx">     // only be tried if Courier New is not found.
</span><span class="cx">     case 11:
</span><span class="cx">         if (equalLettersIgnoringASCIICase(familyName, &quot;courier new&quot;))
</span><del>-            return AtomicString(&quot;Courier&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+            return courier;
</ins><span class="cx">         break;
</span><span class="cx"> #endif
</span><del>-#if OS(WINDOWS)
-    // On Windows, we don't support bitmap fonts, but legacy content expects support.
-    // Thus we allow Microsoft Sans Serif as an alternative for the bitmap font MS Sans Serif,
-    // even if the webpage does not specify fallback.
-    // FIXME: Seems unlikely this is still needed. If it was really needed, I think we
-    // would need it on other platforms too.
-    case 13:
-        if (equalLettersIgnoringASCIICase(familyName, &quot;ms sans serif&quot;))
-            return AtomicString(&quot;Microsoft Sans Serif&quot;, AtomicString::ConstructFromLiteral);
-        break;
-#endif
</del><span class="cx">     case 15:
</span><span class="cx">         if (equalLettersIgnoringASCIICase(familyName, &quot;times new roman&quot;))
</span><del>-            return AtomicString(&quot;Times&quot;, AtomicString::ConstructFromLiteral);
</del><ins>+            return times;
</ins><span class="cx">         break;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -251,7 +240,7 @@
</span><span class="cx">         if (!it-&gt;value &amp;&amp; !checkingAlternateName) {
</span><span class="cx">             // We were unable to find a font.  We have a small set of fonts that we alias to other names,
</span><span class="cx">             // e.g., Arial/Helvetica, Courier/Courier New, etc.  Try looking up the font under the aliased name.
</span><del>-            const AtomicString alternateName = alternateFamilyName(familyName);
</del><ins>+            const AtomicString&amp; alternateName = alternateFamilyName(familyName);
</ins><span class="cx">             if (!alternateName.isNull()) {
</span><span class="cx">                 FontPlatformData* fontPlatformDataForAlternateName = getCachedFontPlatformData(fontDescription, alternateName, fontFaceFeatures, fontFaceVariantSettings, true);
</span><span class="cx">                 // Lookup the key in the hash table again as the previous iterator may have
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCacheh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCache.h (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCache.h        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WebCore/platform/graphics/FontCache.h        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -226,6 +226,9 @@
</span><span class="cx">     FontPlatformData* getCustomFallbackFont(const UInt32, const FontDescription&amp;);
</span><span class="cx"> #endif
</span><span class="cx">     std::unique_ptr&lt;FontPlatformData&gt; createFontPlatformData(const FontDescription&amp;, const AtomicString&amp; family, const FontFeatureSettings* fontFaceFeatures, const FontVariantSettings* fontFaceVariantSettings);
</span><ins>+    
+    static const AtomicString&amp; alternateFamilyName(const AtomicString&amp;);
+    static const AtomicString&amp; platformAlternateFamilyName(const AtomicString&amp;);
</ins><span class="cx"> 
</span><span class="cx">     Timer m_purgeTimer;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicscocoaFontCacheCoreTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WebCore/platform/graphics/cocoa/FontCacheCoreText.cpp        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -796,4 +796,64 @@
</span><span class="cx">     return fontForPlatformData(alternateFont);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const AtomicString&amp; FontCache::platformAlternateFamilyName(const AtomicString&amp; familyName)
+{
+    static const UChar songtiString[] = { 0x5b8b, 0x4f53 };
+    static const UChar weiruanYaHeiString[] = { 0x5fae, 0x8f6f, 0x96c5, 0x9ed1 };
+    static const UChar heitiString[] = { 0x9ed1, 0x4f53 };
+    static const UChar weiruanZhengHeitiString[] = { 0x5fae, 0x8edf, 0x6b63, 0x9ed1, 0x9ad4 };
+    static const UChar weiruanXinXiMingTi[] = { 0x5fae, 0x8edf, 0x65b0, 0x7d30, 0x660e, 0x9ad4 };
+
+    static NeverDestroyed&lt;AtomicString&gt; songtiSC(&quot;Songti SC&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; songtiTC(&quot;Songti TC&quot;, AtomicString::ConstructFromLiteral);
+#if (PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &gt;= 101100) || PLATFORM(IOS)
+    static NeverDestroyed&lt;AtomicString&gt; heitiSCReplacement(&quot;PingFang SC&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; heitiTCReplacement(&quot;PingFang TC&quot;, AtomicString::ConstructFromLiteral);
+#else
+    static NeverDestroyed&lt;AtomicString&gt; heitiSCReplacement(&quot;Heiti SC&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; heitiTCReplacement(&quot;Heiti TC&quot;, AtomicString::ConstructFromLiteral);
+#endif
+
+    switch (familyName.length()) {
+    case 2:
+        if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, songtiString))
+            return songtiSC;
+        if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, heitiString))
+            return heitiSCReplacement;
+        break;
+    case 4:
+        if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, weiruanYaHeiString))
+            return heitiSCReplacement;
+        break;
+    case 5:
+        if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, weiruanZhengHeitiString))
+            return heitiTCReplacement;
+        break;
+    case 6:
+        if (equalLettersIgnoringASCIICase(familyName, &quot;simsun&quot;))
+            return songtiSC;
+        if (naiveEqualWithoutPerformingUnicodeNormalization(familyName, weiruanXinXiMingTi))
+            return songtiTC;
+        break;
+    case 10:
+        if (equalLettersIgnoringASCIICase(familyName, &quot;ms mingliu&quot;))
+            return songtiTC;
+        if (equalIgnoringASCIICase(familyName, &quot;\\5b8b\\4f53&quot;))
+            return songtiSC;
+        break;
+#if PLATFORM(MAC) &amp;&amp; __MAC_OS_X_VERSION_MIN_REQUIRED &lt; 101100
+    case 15:
+        if (equalLettersIgnoringASCIICase(familyName, &quot;microsoft yahei&quot;))
+            return heitiSCReplacement;
+        break;
+#endif
+    case 18:
+        if (equalLettersIgnoringASCIICase(familyName, &quot;microsoft jhenghei&quot;))
+            return heitiTCReplacement;
+        break;
+    }
+
+    return nullAtom;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsfreetypeFontCacheFreeTypecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WebCore/platform/graphics/freetype/FontCacheFreeType.cpp        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -383,4 +383,9 @@
</span><span class="cx">     return platformData;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const AtomicString&amp; FontCache::platformAlternateFamilyName(const AtomicString&amp; familyName)
+{
+    return nullAtom;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicswinFontCacheWincpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Source/WebCore/platform/graphics/win/FontCacheWin.cpp        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -604,4 +604,32 @@
</span><span class="cx">     return result;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+const AtomicString&amp; FontCache::platformAlternateFamilyName(const AtomicString&amp; familyName)
+{
+    static NeverDestroyed&lt;AtomicString&gt; timesNewRoman(&quot;Times New Roman&quot;, AtomicString::ConstructFromLiteral);
+    static NeverDestroyed&lt;AtomicString&gt; microsoftSansSerif(&quot;Microsoft Sans Serif&quot;, AtomicString::ConstructFromLiteral);
+
+    switch (familyName.length()) {
+    // On Windows, we don't support bitmap fonts, but legacy content expects support.
+    // Thus we allow Times New Roman as an alternative for the bitmap font MS Serif,
+    // even if the webpage does not specify fallback.
+    // FIXME: Seems unlikely this is still needed. If it was really needed, I think we
+    // would need it on other platforms too.
+    case 8:
+        if (equalLettersIgnoringASCIICase(familyName, &quot;ms serif&quot;))
+            return timesNewRoman;
+        break;
+    // On Windows, we don't support bitmap fonts, but legacy content expects support.
+    // Thus we allow Microsoft Sans Serif as an alternative for the bitmap font MS Sans Serif,
+    // even if the webpage does not specify fallback.
+    // FIXME: Seems unlikely this is still needed. If it was really needed, I think we
+    // would need it on other platforms too.
+    case 13:
+        if (equalLettersIgnoringASCIICase(familyName, &quot;ms sans serif&quot;))
+            return microsoftSansSerif;
+        break;
+    }
+    return nullAtom;
</ins><span class="cx"> }
</span><ins>+
+}
</ins></span></pre></div>
<a id="trunkToolsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Tools/ChangeLog (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/ChangeLog        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Tools/ChangeLog        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -1,3 +1,14 @@
</span><ins>+2016-06-11  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
+
+        [Cocoa] Map commonly used Chinese Windows font names to names present on Cocoa operating systems
+        https://bugs.webkit.org/show_bug.cgi?id=158649
+        &lt;rdar://problem/13258122&gt;
+
+        Reviewed by Darin Adler.
+
+        * TestWebKitAPI/Tests/WTF/WTFString.h:
+        (TestWebKitAPI::TEST):
+
</ins><span class="cx"> 2016-06-10  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Fix CMake build.
</span></span></pre></div>
<a id="trunkToolsTestWebKitAPITestsWTFWTFStringcpp"></a>
<div class="modfile"><h4>Modified: trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp (201977 => 201978)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp        2016-06-11 20:05:55 UTC (rev 201977)
+++ trunk/Tools/TestWebKitAPI/Tests/WTF/WTFString.cpp        2016-06-11 21:48:15 UTC (rev 201978)
</span><span class="lines">@@ -292,4 +292,25 @@
</span><span class="cx">     ASSERT_EQ(string2.existingHash(), 0u);
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+TEST(WTF, StringNaiveUnicodeEqual)
+{
+    String string1(&quot;abc&quot;);
+    ASSERT_FALSE(string1.isNull());
+    ASSERT_TRUE(string1.is8Bit());
+    UChar ab[] = { 'a', 'b' };
+    UChar abc[] = { 'a', 'b', 'c' };
+    UChar abcd[] = { 'a', 'b', 'c', 'd' };
+    UChar aBc[] = { 'a', 'B', 'c' };
+    ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string1, ab));
+    ASSERT_TRUE(naiveEqualWithoutPerformingUnicodeNormalization(string1, abc));
+    ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string1, abcd));
+    ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string1, aBc));
+
+    String string2(abc, 3);
+    ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string2, ab));
+    ASSERT_TRUE(naiveEqualWithoutPerformingUnicodeNormalization(string2, abc));
+    ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string2, abcd));
+    ASSERT_FALSE(naiveEqualWithoutPerformingUnicodeNormalization(string2, aBc));
+}
+
</ins><span class="cx"> } // namespace TestWebKitAPI
</span></span></pre>
</div>
</div>

</body>
</html>