<!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>[180191] 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/180191">180191</a></dd>
<dt>Author</dt> <dd>enrica@apple.com</dd>
<dt>Date</dt> <dd>2015-02-16 17:05:28 -0800 (Mon, 16 Feb 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>Emoji sequences do not render properly.
https://bugs.webkit.org/show_bug.cgi?id=141661
rdar://problem/19820463

Reviewed by Sam Weinig.

Source/WebCore:

Emoji sequences and emoji with variations should be rendered
using the Complex code path and should be treated as graphemes.
This change modifies advanceByCombiningCharacterSequence to add
this logic.

Test: fast/text/emoji.html

* WebCore.xcodeproj/project.pbxproj:
* platform/graphics/FontCascade.cpp:
(WebCore::FontCascade::characterRangeCodePath):
* platform/graphics/mac/ComplexTextController.cpp:
(WebCore::advanceByCombiningCharacterSequence): Implements a simple
logic to treat emoji sequences and emoji with variations as graphemes.
* platform/text/CharacterProperties.h: Added.
(WebCore::isEmojiGroupCandidate):
(WebCore::isEmojiModifier):
(WebCore::isVariationSelector):
* rendering/RenderText.cpp:
(WebCore::isEmojiGroupCandidate): Deleted.
(WebCore::isEmojiModifier): Deleted.

LayoutTests:

* TestExpectations:
* fast/text/emoji-expected.txt: Added.
* fast/text/emoji.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsTestExpectations">trunk/LayoutTests/TestExpectations</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsFontCascadecpp">trunk/Source/WebCore/platform/graphics/FontCascade.cpp</a></li>
<li><a href="#trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp">trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderTextcpp">trunk/Source/WebCore/rendering/RenderText.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextemojiexpectedtxt">trunk/LayoutTests/fast/text/emoji-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfasttextemojihtml">trunk/LayoutTests/fast/text/emoji.html</a></li>
<li><a href="#trunkSourceWebCoreplatformtextCharacterPropertiesh">trunk/Source/WebCore/platform/text/CharacterProperties.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (180190 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-02-17 01:02:17 UTC (rev 180190)
+++ trunk/LayoutTests/ChangeLog        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -1,3 +1,15 @@
</span><ins>+2015-02-16  Enrica Casucci  &lt;enrica@apple.com&gt;
+
+        Emoji sequences do not render properly.
+        https://bugs.webkit.org/show_bug.cgi?id=141661
+        rdar://problem/19820463
+
+        Reviewed by Sam Weinig.
+
+        * TestExpectations:
+        * fast/text/emoji-expected.txt: Added.
+        * fast/text/emoji.html: Added.
+
</ins><span class="cx"> 2015-02-16  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Update fast/dom/{Element,Range}/getClientRects.html after r177774
</span></span></pre></div>
<a id="trunkLayoutTestsTestExpectations"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/TestExpectations (180190 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/TestExpectations        2015-02-17 01:02:17 UTC (rev 180190)
+++ trunk/LayoutTests/TestExpectations        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -123,6 +123,8 @@
</span><span class="cx"> 
</span><span class="cx"> webkit.org/b/133057 fast/table/border-collapsing/collapsed-borders-adjoining-sections.html [ ImageOnlyFailure ]
</span><span class="cx"> 
</span><ins>+webkit.org/b/141661 fast/text/emoji.html [ Failure ]
+
</ins><span class="cx"> webkit.org/b/128736 inspector-protocol/debugger/setBreakpoint-dfg.html [ Failure Pass ]
</span><span class="cx"> webkit.org/b/134982 inspector-protocol/debugger/setBreakpoint-dfg-and-modify-local.html [ Failure Pass ]
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextemojiexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/emoji-expected.txt (0 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/emoji-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/text/emoji-expected.txt        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -0,0 +1,23 @@
</span><ins>+layer at (0,0) size 800x600
+  RenderView at (0,0) size 800x600
+layer at (0,0) size 800x600
+  RenderBlock {HTML} at (0,0) size 800x600
+    RenderBody {BODY} at (8,8) size 784x584
+      RenderBlock (anonymous) at (0,0) size 784x18
+        RenderText {#text} at (0,0) size 470x18
+          text run at (0,0) width 470: &quot;This test validate rendering of emoji sequences and emoji with modifiers.&quot;
+      RenderBlock {DIV} at (0,18) size 784x235
+        RenderText {#text} at (0,4) size 180x41
+          text run at (0,4) width 180: &quot;\x{D83D}\x{DC66}\x{D83C}\x{DFFB}\x{D83D}\x{DC69}\x{D83C}\x{DFFC}\x{D83D}\x{DC66}\x{D83C}\x{DFFE}\x{2764}\x{FE0F}\x{D83D}\x{DC8B}&quot;
+        RenderBR {BR} at (180,36) size 0x0
+        RenderText {#text} at (0,51) size 243x41
+          text run at (0,51) width 243: &quot;\x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC66} \x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC67} \x{D83D}\x{DC6A} \x{D83D}\x{DC66}\x{D83C}\x{DFFB}\x{D83D}\x{DC69}\x{D83C}\x{DFFC}\x{D83D}\x{DC66}\x{D83C}\x{DFFE}&quot;
+        RenderBR {BR} at (243,83) size 0x0
+        RenderText {#text} at (0,98) size 216x41
+          text run at (0,98) width 216: &quot;\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC66} \x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC67} \x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC67}\x{200D}\x{D83D}\x{DC66} \x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC66}\x{200D}\x{D83D}\x{DC66} \x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC69}\x{200D}\x{D83D}\x{DC67}\x{200D}\x{D83D}\x{DC67}&quot;
+        RenderBR {BR} at (216,130) size 0x0
+        RenderText {#text} at (0,145) size 216x41
+          text run at (0,145) width 216: &quot;\x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC66} \x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC67} \x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC67}\x{200D}\x{D83D}\x{DC66} \x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC66}\x{200D}\x{D83D}\x{DC66} \x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC68}\x{200D}\x{D83D}\x{DC67}\x{200D}\x{D83D}\x{DC67}&quot;
+        RenderBR {BR} at (216,177) size 0x0
+        RenderText {#text} at (0,192) size 216x41
+          text run at (0,192) width 216: &quot;\x{D83D}\x{DC69}\x{200D}\x{2764}\x{FE0F}\x{200D}\x{D83D}\x{DC69} \x{D83D}\x{DC68}\x{200D}\x{2764}\x{FE0F}\x{200D}\x{D83D}\x{DC68} \x{D83D}\x{DC69}\x{200D}\x{2764}\x{FE0F}\x{200D}\x{D83D}\x{DC8B}\x{200D}\x{D83D}\x{DC69} \x{D83D}\x{DC68}\x{200D}\x{2764}\x{FE0F}\x{200D}\x{D83D}\x{DC8B}\x{200D}\x{D83D}\x{DC68} \x{D83D}\x{DC69}\x{200D}\x{2764}\x{FE0F}\x{200D}\x{D83D}\x{DC69}&quot;
</ins></span></pre></div>
<a id="trunkLayoutTestsfasttextemojihtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/emoji.html (0 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/emoji.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/emoji.html        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -0,0 +1,12 @@
</span><ins>+&lt;html&gt;
+&lt;body&gt;
+    This test validate rendering of emoji sequences and emoji with modifiers.
+&lt;div style='font-size: 36px'&gt;
+&amp;#x1F466;&amp;#x1F3FB;&amp;#x1F469;&amp;#x1F3FC;&amp;#x1F466;&amp;#x1F3FE;&amp;#x2764;&amp;#xFE0F;&amp;#x1F48B;&lt;br&gt;
+&amp;#x1F468;&amp;#x200D;&amp;#x1F469;&amp;#x200D;&amp;#x1F466; &amp;#x1F468;&amp;#x200D;&amp;#x1F469;&amp;#x200D;&amp;#x1F467; &amp;#x1F46A; &amp;#x1F466;&amp;#x1F3FB;&amp;#x1F469;&amp;#x1F3FC;&amp;#x1F466;&amp;#x1F3FE;&lt;br&gt;
+&amp;#x1F469;&amp;#x200D;&amp;#x1F469;&amp;#x200D;&amp;#x1F466; &amp;#x1F469;&amp;#x200D;&amp;#x1F469;&amp;#x200D;&amp;#x1F467; &amp;#x1F469;&amp;#x200D;&amp;#x1F469;&amp;#x200D;&amp;#x1F467;&amp;#x200D;&amp;#x1F466; &amp;#x1F469;&amp;#x200D;&amp;#x1F469;&amp;#x200D;&amp;#x1F466;&amp;#x200D;&amp;#x1F466; &amp;#x1F469;&amp;#x200D;&amp;#x1F469;&amp;#x200D;&amp;#x1F467;&amp;#x200D;&amp;#x1F467;&lt;br&gt;
+&amp;#x1F468;&amp;#x200D;&amp;#x1F468;&amp;#x200D;&amp;#x1F466; &amp;#x1F468;&amp;#x200D;&amp;#x1F468;&amp;#x200D;&amp;#x1F467; &amp;#x1F468;&amp;#x200D;&amp;#x1F468;&amp;#x200D;&amp;#x1F467;&amp;#x200D;&amp;#x1F466; &amp;#x1F468;&amp;#x200D;&amp;#x1F468;&amp;#x200D;&amp;#x1F466;&amp;#x200D;&amp;#x1F466; &amp;#x1F468;&amp;#x200D;&amp;#x1F468;&amp;#x200D;&amp;#x1F467;&amp;#x200D;&amp;#x1F467;&lt;br&gt;
+&amp;#x1F469;&amp;#x200D;&amp;#x2764;&amp;#xFE0F;&amp;#x200D;&amp;#x1F469; &amp;#x1F468;&amp;#x200D;&amp;#x2764;&amp;#xFE0F;&amp;#x200D;&amp;#x1F468; &amp;#x1F469;&amp;#x200D;&amp;#x2764;&amp;#xFE0F;&amp;#x200D;&amp;#x1F48B;&amp;#x200D;&amp;#x1F469; &amp;#x1F468;&amp;#x200D;&amp;#x2764;&amp;#xFE0F;&amp;#x200D;&amp;#x1F48B;&amp;#x200D;&amp;#x1F468; &amp;#x1F469;&amp;#x200D;&amp;#x2764;&amp;#xFE0F;&amp;#x200D;&amp;#x1F469;
+&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 (180190 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-02-17 01:02:17 UTC (rev 180190)
+++ trunk/Source/WebCore/ChangeLog        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2015-02-16  Enrica Casucci  &lt;enrica@apple.com&gt;
+
+        Emoji sequences do not render properly.
+        https://bugs.webkit.org/show_bug.cgi?id=141661
+        rdar://problem/19820463
+
+        Reviewed by Sam Weinig.
+
+        Emoji sequences and emoji with variations should be rendered
+        using the Complex code path and should be treated as graphemes.
+        This change modifies advanceByCombiningCharacterSequence to add
+        this logic.
+
+        Test: fast/text/emoji.html
+
+        * WebCore.xcodeproj/project.pbxproj:
+        * platform/graphics/FontCascade.cpp:
+        (WebCore::FontCascade::characterRangeCodePath):
+        * platform/graphics/mac/ComplexTextController.cpp:
+        (WebCore::advanceByCombiningCharacterSequence): Implements a simple
+        logic to treat emoji sequences and emoji with variations as graphemes.
+        * platform/text/CharacterProperties.h: Added.
+        (WebCore::isEmojiGroupCandidate):
+        (WebCore::isEmojiModifier):
+        (WebCore::isVariationSelector):
+        * rendering/RenderText.cpp:
+        (WebCore::isEmojiGroupCandidate): Deleted.
+        (WebCore::isEmojiModifier): Deleted.
+
</ins><span class="cx"> 2015-02-16  Zalan Bujtas  &lt;zalan@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         RenderTableRow should check if it has access to its ancestor chain.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (180190 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-02-17 01:02:17 UTC (rev 180190)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -5568,6 +5568,7 @@
</span><span class="cx">                 C5278B0C17F212EA003A2998 /* PlatformPasteboardIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C5278B0B17F212EA003A2998 /* PlatformPasteboardIOS.mm */; };
</span><span class="cx">                 C544274B11A57E7A0063A749 /* DOMStringList.h in Headers */ = {isa = PBXBuildFile; fileRef = C544274911A57E7A0063A749 /* DOMStringList.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 C55610F111A704EB00B82D27 /* DOMStringList.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C55610F011A704EB00B82D27 /* DOMStringList.cpp */; };
</span><ins>+                C5592F781A92AA28001F8862 /* CharacterProperties.h in Headers */ = {isa = PBXBuildFile; fileRef = C5592F771A92AA28001F8862 /* CharacterProperties.h */; };
</ins><span class="cx">                 C55C7BA11718AFBA001327E4 /* RenderThemeIOS.mm in Sources */ = {isa = PBXBuildFile; fileRef = C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */; };
</span><span class="cx">                 C572EE1F1201C9BC007D8F82 /* JSIDBIndex.h in Headers */ = {isa = PBXBuildFile; fileRef = C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */; };
</span><span class="cx">                 C57FEDE11212EE9C0097BE65 /* FileSystem.cpp in Sources */ = {isa = PBXBuildFile; fileRef = C57FEDE01212EE9C0097BE65 /* FileSystem.cpp */; };
</span><span class="lines">@@ -13026,6 +13027,7 @@
</span><span class="cx">                 C544274911A57E7A0063A749 /* DOMStringList.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMStringList.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C544274A11A57E7A0063A749 /* DOMStringList.idl */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = text; path = DOMStringList.idl; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C55610F011A704EB00B82D27 /* DOMStringList.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = DOMStringList.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                C5592F771A92AA28001F8862 /* CharacterProperties.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CharacterProperties.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 C55C7BA01718AFBA001327E4 /* RenderThemeIOS.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = RenderThemeIOS.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C572EE1D1201C9BC007D8F82 /* JSIDBIndex.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = JSIDBIndex.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 C57FEDE01212EE9C0097BE65 /* FileSystem.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = FileSystem.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -20709,6 +20711,7 @@
</span><span class="cx">                                 B2C3D9F30D006C1D00EF6F26 /* BidiContext.h */,
</span><span class="cx">                                 B2C3D9F40D006C1D00EF6F26 /* BidiResolver.h */,
</span><span class="cx">                                 A8C402921348B2220063F1E5 /* BidiRunList.h */,
</span><ins>+                                C5592F771A92AA28001F8862 /* CharacterProperties.h */,
</ins><span class="cx">                                 0FDA7C2018832BCC00C954B5 /* DateTimeFormat.cpp */,
</span><span class="cx">                                 453EB635159C570400001BB7 /* DateTimeFormat.h */,
</span><span class="cx">                                 CECCFC3A141973D5002A0AC1 /* DecodeEscapeSequences.h */,
</span><span class="lines">@@ -23914,6 +23917,7 @@
</span><span class="cx">                                 59A8F1D811A69520001AC34A /* DeviceOrientationClient.h in Headers */,
</span><span class="cx">                                 3140379D124BEA7F00AF40E4 /* DeviceOrientationClientIOS.h in Headers */,
</span><span class="cx">                                 59309A1311F4AE6A00250603 /* DeviceOrientationClientMock.h in Headers */,
</span><ins>+                                C5592F781A92AA28001F8862 /* CharacterProperties.h in Headers */,
</ins><span class="cx">                                 59A8F1D611A69513001AC34A /* DeviceOrientationController.h in Headers */,
</span><span class="cx">                                 590E1B4911E4EF4B0069F784 /* DeviceOrientationData.h in Headers */,
</span><span class="cx">                                 59A85EA4119D68EC00DEF1EF /* DeviceOrientationEvent.h in Headers */,
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsFontCascadecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/FontCascade.cpp (180190 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-02-17 01:02:17 UTC (rev 180190)
+++ trunk/Source/WebCore/platform/graphics/FontCascade.cpp        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -24,6 +24,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;FontCascade.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CharacterProperties.h&quot;
</ins><span class="cx"> #include &quot;FloatRect.h&quot;
</span><span class="cx"> #include &quot;FontCache.h&quot;
</span><span class="cx"> #include &quot;GlyphBuffer.h&quot;
</span><span class="lines">@@ -771,6 +772,8 @@
</span><span class="cx">                 previousCharacterIsEmojiGroupCandidate = true;
</span><span class="cx">                 continue;
</span><span class="cx">             }
</span><ins>+            if (isEmojiModifier(supplementaryCharacter))
+                return Complex;
</ins><span class="cx">             if (supplementaryCharacter &lt; 0xE0100) // U+E0100 through U+E01EF Unicode variation selectors.
</span><span class="cx">                 continue;
</span><span class="cx">             if (supplementaryCharacter &lt;= 0xE01EF)
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformgraphicsmacComplexTextControllercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp (180190 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2015-02-17 01:02:17 UTC (rev 180190)
+++ trunk/Source/WebCore/platform/graphics/mac/ComplexTextController.cpp        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -25,6 +25,7 @@
</span><span class="cx"> #include &quot;config.h&quot;
</span><span class="cx"> #include &quot;ComplexTextController.h&quot;
</span><span class="cx"> 
</span><ins>+#include &quot;CharacterProperties.h&quot;
</ins><span class="cx"> #include &quot;FloatSize.h&quot;
</span><span class="cx"> #include &quot;FontCascade.h&quot;
</span><span class="cx"> #include &quot;RenderBlock.h&quot;
</span><span class="lines">@@ -258,6 +259,8 @@
</span><span class="cx">     return 0;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+// FIXME: We should consider reimplementing this function using ICU to advance by grapheme.
+// The current implementation only considers explicitly emoji sequences and emoji variations.
</ins><span class="cx"> static bool advanceByCombiningCharacterSequence(const UChar*&amp; iterator, const UChar* end, UChar32&amp; baseCharacter, unsigned&amp; markCount)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(iterator &lt; end);
</span><span class="lines">@@ -268,17 +271,33 @@
</span><span class="cx">     unsigned remainingCharacters = end - iterator;
</span><span class="cx">     U16_NEXT(iterator, i, remainingCharacters, baseCharacter);
</span><span class="cx">     iterator = iterator + i;
</span><del>-
</del><span class="cx">     if (U_IS_SURROGATE(baseCharacter))
</span><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // Consume marks.
</span><ins>+    bool sawEmojiGroupCandidate = isEmojiGroupCandidate(baseCharacter);
+    bool sawJoiner = false;
</ins><span class="cx">     while (iterator &lt; end) {
</span><span class="cx">         UChar32 nextCharacter;
</span><span class="cx">         int markLength = 0;
</span><ins>+        bool shouldContinue = false;
</ins><span class="cx">         U16_NEXT(iterator, markLength, end - iterator, nextCharacter);
</span><del>-        if (!(U_GET_GC_MASK(nextCharacter) &amp; U_GC_M_MASK))
</del><ins>+
+        if (isVariationSelector(nextCharacter) || isEmojiModifier(nextCharacter))
+            shouldContinue = true;
+
+        if (sawJoiner &amp;&amp; isEmojiGroupCandidate(nextCharacter))
+            shouldContinue = true;
+
+        sawJoiner = false;
+        if (sawEmojiGroupCandidate &amp;&amp; nextCharacter == zeroWidthJoiner) {
+            sawJoiner = true;
+            shouldContinue = true;
+        }
+        
+        if (!shouldContinue &amp;&amp; !(U_GET_GC_MASK(nextCharacter) &amp; U_GC_M_MASK))
</ins><span class="cx">             break;
</span><ins>+
</ins><span class="cx">         markCount += markLength;
</span><span class="cx">         iterator += markLength;
</span><span class="cx">     }
</span></span></pre></div>
<a id="trunkSourceWebCoreplatformtextCharacterPropertiesh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/platform/text/CharacterProperties.h (0 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/platform/text/CharacterProperties.h                                (rev 0)
+++ trunk/Source/WebCore/platform/text/CharacterProperties.h        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -0,0 +1,48 @@
</span><ins>+/*
+ * Copyright (C) 2015 Apple, Inc.  All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ *    notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ *    notice, this list of conditions and the following disclaimer in the
+ *    documentation and/or other materials provided with the distribution.
+ *
+ * THIS SOFTWARE IS PROVIDED BY APPLE INC. ``AS IS'' AND ANY
+ * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR
+ * PURPOSE ARE DISCLAIMED.  IN NO EVENT SHALL APPLE INC. OR
+ * CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL,
+ * EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO,
+ * PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
+ * PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY
+ * OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CharacterProperties_h
+#define CharacterProperties_h
+
+namespace WebCore {
+
+static inline bool isEmojiGroupCandidate(UChar32 character)
+{
+    return (character &gt;= 0x1F466 &amp;&amp; character &lt;= 0x1F469) || character == 0x2764 || character == 0x1F48B;
+}
+
+static inline bool isEmojiModifier(UChar32 character)
+{
+    return character &gt;= 0x1F3FB &amp;&amp; character &lt;= 0x1F3FF;
+}
+
+inline bool isVariationSelector(UChar32 character)
+{
+    return character &gt;= 0xFE00 &amp;&amp; character &lt;= 0xFE0F;
+}
+
+}
+
+#endif
</ins></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderTextcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderText.cpp (180190 => 180191)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderText.cpp        2015-02-17 01:02:17 UTC (rev 180190)
+++ trunk/Source/WebCore/rendering/RenderText.cpp        2015-02-17 01:05:28 UTC (rev 180191)
</span><span class="lines">@@ -26,6 +26,7 @@
</span><span class="cx"> #include &quot;RenderText.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #include &quot;AXObjectCache.h&quot;
</span><ins>+#include &quot;CharacterProperties.h&quot;
</ins><span class="cx"> #include &quot;EllipsisBox.h&quot;
</span><span class="cx"> #include &quot;FloatQuad.h&quot;
</span><span class="cx"> #include &quot;Frame.h&quot;
</span><span class="lines">@@ -1438,16 +1439,6 @@
</span><span class="cx">     return 0x1F1E6 &lt;= character &amp;&amp; character &lt;= 0x1F1FF;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-static inline bool isEmojiGroupCandidate(UChar32 character)
-{
-    return (character &gt;= 0x1F466 &amp;&amp; character &lt;= 0x1F469) || character == 0x2764 || character == 0x1F48B;
-}
-
-static inline bool isEmojiModifier(UChar32 character)
-{
-    return character &gt;= 0x1F3FB &amp;&amp; character &lt;= 0x1F3FF;
-}
-
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> int RenderText::previousOffsetForBackwardDeletion(int current) const
</span></span></pre>
</div>
</div>

</body>
</html>