<!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>[173943] 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/173943">173943</a></dd>
<dt>Author</dt> <dd>darin@apple.com</dd>
<dt>Date</dt> <dd>2014-09-24 19:53:48 -0700 (Wed, 24 Sep 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs.
https://bugs.webkit.org/show_bug.cgi?id=70029

Reviewed by Dan Bernstein.

Source/WebCore:

Test: fast/text/international/old-turkic-direction.html

* CMakeLists.txt: Added InlineIterator.cpp.
* WebCore.vcxproj/WebCore.vcxproj: Ditto.
* WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
* WebCore.xcodeproj/project.pbxproj: Ditto.
* rendering/RenderingAllInOne.cpp: Ditto.

* rendering/InlineIterator.cpp: Added.
(WebCore::InlineIterator::surrogateTextDirection): New function used to compute the direction
when a surrogate pair is involved.
* rendering/InlineIterator.h: Made the characterAt function private.
(WebCore::InlineIterator::previousInSameNode): Took out unneeded range check. A zero will underflow
and become a large number and the characterAt function will return 0 in that case.
(WebCore::InlineIterator::direction): Added code to check U16_IS_SINGLE before calling
u_charDirection, and call surrogateTextDirection instead.

LayoutTests:

* fast/text/international/old-turkic-direction.html: Added.
* fast/text/international/old-turkic-direction-expected.html: Added.</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxproj">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj</a></li>
<li><a href="#trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters">trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineIteratorh">trunk/Source/WebCore/rendering/InlineIterator.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderingAllInOnecpp">trunk/Source/WebCore/rendering/RenderingAllInOne.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfasttextinternationaloldturkicdirectionexpectedhtml">trunk/LayoutTests/fast/text/international/old-turkic-direction-expected.html</a></li>
<li><a href="#trunkLayoutTestsfasttextinternationaloldturkicdirectionhtml">trunk/LayoutTests/fast/text/international/old-turkic-direction.html</a></li>
<li><a href="#trunkSourceWebCorerenderingInlineIteratorcpp">trunk/Source/WebCore/rendering/InlineIterator.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/LayoutTests/ChangeLog        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2014-09-24  Darin Adler  &lt;darin@apple.com&gt;
+
+        Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs.
+        https://bugs.webkit.org/show_bug.cgi?id=70029
+
+        Reviewed by Dan Bernstein.
+
+        * fast/text/international/old-turkic-direction.html: Added.
+        * fast/text/international/old-turkic-direction-expected.html: Added.
+
</ins><span class="cx"> 2014-09-22  Myles C. Maxfield  &lt;mmaxfield@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         REGRESSION: Text with a zero offset, zero blur shadow vanishes
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextinternationaloldturkicdirectionexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/international/old-turkic-direction-expected.html (0 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/international/old-turkic-direction-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/international/old-turkic-direction-expected.html        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;body&gt;
+&lt;p&gt;Test that checks that at least one Old Turkic character has RTL direction.&lt;/p&gt;
+&lt;p&gt;Word that starts with an Old Turkic character, with and without RTL override:&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;&lt;bdo dir=&quot;rtl&quot;&gt;&amp;#x10C00;a&lt;/bdo&gt;&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;&lt;bdo dir=&quot;rtl&quot;&gt;&amp;#x10C00;a&lt;/bdo&gt;&lt;/p&gt;
+&lt;p&gt;Word that has an Old Turkic character in the middle, with and without RTL override:&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;&lt;bdo dir=&quot;rtl&quot;&gt;b&amp;#x10C00;c&lt;/bdo&gt;&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;&lt;bdo dir=&quot;rtl&quot;&gt;b&amp;#x10C00;c&lt;/bdo&gt;&lt;/p&gt;
+&lt;/body&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/text/international/old-turkic-direction-expected.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfasttextinternationaloldturkicdirectionhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/text/international/old-turkic-direction.html (0 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/international/old-turkic-direction.html                                (rev 0)
+++ trunk/LayoutTests/fast/text/international/old-turkic-direction.html        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -0,0 +1,10 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;body&gt;
+&lt;p&gt;Test that checks that at least one Old Turkic character has RTL direction.&lt;/p&gt;
+&lt;p&gt;Word that starts with an Old Turkic character, with and without RTL override:&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;&amp;#x10C00;a&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;&lt;bdo dir=&quot;rtl&quot;&gt;&amp;#x10C00;a&lt;/bdo&gt;&lt;/p&gt;
+&lt;p&gt;Word that has an Old Turkic character in the middle, with and without RTL override:&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;b&amp;#x10C00;c&lt;/p&gt;
+&lt;p dir=&quot;rtl&quot; style=&quot;width:100px&quot;&gt;&lt;bdo dir=&quot;rtl&quot;&gt;b&amp;#x10C00;c&lt;/bdo&gt;&lt;/p&gt;
+&lt;/body&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/text/international/old-turkic-direction.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/Source/WebCore/CMakeLists.txt        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -2281,6 +2281,7 @@
</span><span class="cx">     rendering/InlineBox.cpp
</span><span class="cx">     rendering/InlineElementBox.cpp
</span><span class="cx">     rendering/InlineFlowBox.cpp
</span><ins>+    rendering/InlineIterator.cpp
</ins><span class="cx">     rendering/InlineTextBox.cpp
</span><span class="cx">     rendering/LayoutRepainter.cpp
</span><span class="cx">     rendering/LayoutState.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/Source/WebCore/ChangeLog        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -1,3 +1,27 @@
</span><ins>+2014-09-24  Darin Adler  &lt;darin@apple.com&gt;
+
+        Old Turkic characters behave as left-to-right instead of right-to-left, because they are encoded as surrogate pairs.
+        https://bugs.webkit.org/show_bug.cgi?id=70029
+
+        Reviewed by Dan Bernstein.
+
+        Test: fast/text/international/old-turkic-direction.html
+
+        * CMakeLists.txt: Added InlineIterator.cpp.
+        * WebCore.vcxproj/WebCore.vcxproj: Ditto.
+        * WebCore.vcxproj/WebCore.vcxproj.filters: Ditto.
+        * WebCore.xcodeproj/project.pbxproj: Ditto.
+        * rendering/RenderingAllInOne.cpp: Ditto.
+
+        * rendering/InlineIterator.cpp: Added.
+        (WebCore::InlineIterator::surrogateTextDirection): New function used to compute the direction
+        when a surrogate pair is involved.
+        * rendering/InlineIterator.h: Made the characterAt function private.
+        (WebCore::InlineIterator::previousInSameNode): Took out unneeded range check. A zero will underflow
+        and become a large number and the characterAt function will return 0 in that case.
+        (WebCore::InlineIterator::direction): Added code to check U16_IS_SINGLE before calling
+        u_charDirection, and call surrogateTextDirection instead.
+
</ins><span class="cx"> 2014-09-24  Christophe Dumez  &lt;cdumez@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Unreviewed build fix after r173941.
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -10076,6 +10076,20 @@
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\rendering\InlineIterator.cpp&quot;&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='DebugSuffix|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Release_WinCairo|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+      &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Production|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\InlineTextBox.cpp&quot;&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|Win32'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span><span class="cx">       &lt;ExcludedFromBuild Condition=&quot;'$(Configuration)|$(Platform)'=='Debug|x64'&quot;&gt;true&lt;/ExcludedFromBuild&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorevcxprojWebCorevcxprojfilters"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/Source/WebCore/WebCore.vcxproj/WebCore.vcxproj.filters        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -2400,6 +2400,9 @@
</span><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\InlineFlowBox.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span><ins>+    &lt;ClCompile Include=&quot;..\rendering\InlineIterator.cpp&quot;&gt;
+      &lt;Filter&gt;rendering&lt;/Filter&gt;
+    &lt;/ClCompile&gt;
</ins><span class="cx">     &lt;ClCompile Include=&quot;..\rendering\InlineTextBox.cpp&quot;&gt;
</span><span class="cx">       &lt;Filter&gt;rendering&lt;/Filter&gt;
</span><span class="cx">     &lt;/ClCompile&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -3117,6 +3117,7 @@
</span><span class="cx">                 9307F1D70AF2D59000DBA31A /* HitTestResult.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */; };
</span><span class="cx">                 9307F1D80AF2D59000DBA31A /* HitTestResult.h in Headers */ = {isa = PBXBuildFile; fileRef = 9307F1D60AF2D59000DBA31A /* HitTestResult.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 930908910AF7EDE40081DF01 /* HitTestRequest.h in Headers */ = {isa = PBXBuildFile; fileRef = 930908900AF7EDE40081DF01 /* HitTestRequest.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><ins>+                930C90DD19CF965300D6C21A /* InlineIterator.cpp in Sources */ = {isa = PBXBuildFile; fileRef = 930C90DC19CF965300D6C21A /* InlineIterator.cpp */; };
</ins><span class="cx">                 930FC68A1072B9280045293E /* TextRenderingMode.h in Headers */ = {isa = PBXBuildFile; fileRef = 930FC6891072B9280045293E /* TextRenderingMode.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 93153BCD1417FBBF00FCF5BE /* deleteButton@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BCC1417FBBF00FCF5BE /* deleteButton@2x.png */; };
</span><span class="cx">                 93153BCF1417FBDB00FCF5BE /* deleteButtonPressed@2x.png in Resources */ = {isa = PBXBuildFile; fileRef = 93153BCE1417FBDB00FCF5BE /* deleteButtonPressed@2x.png */; };
</span><span class="lines">@@ -10237,6 +10238,7 @@
</span><span class="cx">                 9307F1D50AF2D59000DBA31A /* HitTestResult.cpp */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.cpp.cpp; path = HitTestResult.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 9307F1D60AF2D59000DBA31A /* HitTestResult.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestResult.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 930908900AF7EDE40081DF01 /* HitTestRequest.h */ = {isa = PBXFileReference; fileEncoding = 30; lastKnownFileType = sourcecode.c.h; path = HitTestRequest.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                930C90DC19CF965300D6C21A /* InlineIterator.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = InlineIterator.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 930FC6891072B9280045293E /* TextRenderingMode.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = TextRenderingMode.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93153BCC1417FBBF00FCF5BE /* deleteButton@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = &quot;deleteButton@2x.png&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 93153BCE1417FBDB00FCF5BE /* deleteButtonPressed@2x.png */ = {isa = PBXFileReference; lastKnownFileType = image.png; path = &quot;deleteButtonPressed@2x.png&quot;; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -22216,6 +22218,7 @@
</span><span class="cx">                                 A8CFF5DD0A155A05000A4234 /* InlineFlowBox.cpp */,
</span><span class="cx">                                 A8CFF5DC0A155A05000A4234 /* InlineFlowBox.h */,
</span><span class="cx">                                 BCE789151120D6080060ECE5 /* InlineIterator.h */,
</span><ins>+                                930C90DC19CF965300D6C21A /* InlineIterator.cpp */,
</ins><span class="cx">                                 BCEA481A097D93020094C9E4 /* InlineTextBox.cpp */,
</span><span class="cx">                                 BCEA481B097D93020094C9E4 /* InlineTextBox.h */,
</span><span class="cx">                                 A120ACA113F9984600FE4AC7 /* LayoutRepainter.cpp */,
</span><span class="lines">@@ -28276,6 +28279,7 @@
</span><span class="cx">                                 1AE2AEC70A1D297B00B42B25 /* JSHTMLQuoteElement.cpp in Sources */,
</span><span class="cx">                                 1AE2ABAC0A1CE90500B42B25 /* JSHTMLScriptElement.cpp in Sources */,
</span><span class="cx">                                 E1E6EEA40B628DA8005F2F70 /* JSHTMLSelectElement.cpp in Sources */,
</span><ins>+                                930C90DD19CF965300D6C21A /* InlineIterator.cpp in Sources */,
</ins><span class="cx">                                 BC17F9660B64EBB8004A65CB /* JSHTMLSelectElementCustom.cpp in Sources */,
</span><span class="cx">                                 E446143B0CD689CC00FADA75 /* JSHTMLSourceElement.cpp in Sources */,
</span><span class="cx">                                 9752D38D1413104B003305BD /* JSHTMLSpanElement.cpp in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingInlineIteratorcpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/rendering/InlineIterator.cpp (0 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineIterator.cpp                                (rev 0)
+++ trunk/Source/WebCore/rendering/InlineIterator.cpp        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -0,0 +1,52 @@
</span><ins>+/*
+
+Copyright (C) 2014 Apple Inc. All rights reserved.
+
+Redistribution and use in source and binary forms, with or without
+modification, are permitted provided that the following conditions
+are met:
+1.  Redistributions of source code must retain the above copyright
+    notice, this list of conditions and the following disclaimer.
+2.  Redistributions in binary form must reproduce the above copyright
+    notice, this list of conditions and the following disclaimer in the
+    documentation and/or other materials provided with the distribution.
+
+THIS SOFTWARE IS PROVIDED BY APPLE INC. AND ITS CONTRIBUTORS ``AS IS'' AND ANY
+EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
+WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
+DISCLAIMED. IN NO EVENT SHALL APPLE INC. OR ITS CONTRIBUTORS BE LIABLE FOR ANY
+DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
+(INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
+LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
+ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
+SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+
+*/
+
+#include &quot;config.h&quot;
+#include &quot;InlineIterator.h&quot;
+
+namespace WebCore {
+
+UCharDirection InlineIterator::surrogateTextDirection(UChar currentCodeUnit) const
+{
+    RenderText&amp; text = toRenderText(*m_renderer);
+    UChar lead;
+    UChar trail;
+    if (U16_IS_LEAD(currentCodeUnit)) {
+        lead = currentCodeUnit;
+        trail = text.characterAt(m_pos + 1);
+        if (!U16_IS_TRAIL(trail))
+            return U_OTHER_NEUTRAL;
+    } else {
+        ASSERT(U16_IS_TRAIL(currentCodeUnit));
+        lead = text.characterAt(m_pos - 1);
+        if (!U16_IS_LEAD(lead))
+            return U_OTHER_NEUTRAL;
+        trail = currentCodeUnit;
+    }
+    return u_charDirection(U16_GET_SUPPLEMENTARY(lead, trail));
+}
+
+}
</ins><span class="cx">Property changes on: trunk/Source/WebCore/rendering/InlineIterator.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCorerenderingInlineIteratorh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/InlineIterator.h (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/InlineIterator.h        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/Source/WebCore/rendering/InlineIterator.h        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -94,12 +94,15 @@
</span><span class="cx">         return (m_renderer &amp;&amp; m_renderer-&gt;isBR()) || atTextParagraphSeparator();
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    UChar characterAt(unsigned) const;
</del><span class="cx">     UChar current() const;
</span><span class="cx">     UChar previousInSameNode() const;
</span><span class="cx">     ALWAYS_INLINE UCharDirection direction() const;
</span><span class="cx"> 
</span><span class="cx"> private:
</span><ins>+    UChar characterAt(unsigned) const;
+
+    UCharDirection surrogateTextDirection(UChar currentCodeUnit) const;
+
</ins><span class="cx">     RenderElement* m_root;
</span><span class="cx">     RenderObject* m_renderer;
</span><span class="cx"> 
</span><span class="lines">@@ -419,18 +422,22 @@
</span><span class="cx"> 
</span><span class="cx"> inline UChar InlineIterator::previousInSameNode() const
</span><span class="cx"> {
</span><del>-    if (!m_pos)
-        return 0;
-
</del><span class="cx">     return characterAt(m_pos - 1);
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> ALWAYS_INLINE UCharDirection InlineIterator::direction() const
</span><span class="cx"> {
</span><del>-    if (UChar character = current())
-        return u_charDirection(character);
</del><ins>+    if (UNLIKELY(!m_renderer))
+        return U_OTHER_NEUTRAL;
</ins><span class="cx"> 
</span><del>-    if (m_renderer &amp;&amp; m_renderer-&gt;isListMarker())
</del><ins>+    if (LIKELY(m_renderer-&gt;isText())) {
+        UChar codeUnit = toRenderText(*m_renderer).characterAt(m_pos);
+        if (LIKELY(U16_IS_SINGLE(codeUnit)))
+            return u_charDirection(codeUnit);
+        return surrogateTextDirection(codeUnit);
+    }
+
+    if (m_renderer-&gt;isListMarker())
</ins><span class="cx">         return m_renderer-&gt;style().isLeftToRightDirection() ? U_LEFT_TO_RIGHT : U_RIGHT_TO_LEFT;
</span><span class="cx"> 
</span><span class="cx">     return U_OTHER_NEUTRAL;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderingAllInOnecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderingAllInOne.cpp (173942 => 173943)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderingAllInOne.cpp        2014-09-25 02:46:25 UTC (rev 173942)
+++ trunk/Source/WebCore/rendering/RenderingAllInOne.cpp        2014-09-25 02:53:48 UTC (rev 173943)
</span><span class="lines">@@ -25,7 +25,6 @@
</span><span class="cx"> 
</span><span class="cx"> // This all-in-one cpp file cuts down on template bloat to allow us to build our Windows release build.
</span><span class="cx"> 
</span><del>-
</del><span class="cx"> #include &quot;AutoTableLayout.cpp&quot;
</span><span class="cx"> #include &quot;BidiRun.cpp&quot;
</span><span class="cx"> #include &quot;BorderEdge.cpp&quot;
</span><span class="lines">@@ -40,6 +39,7 @@
</span><span class="cx"> #include &quot;InlineBox.cpp&quot;
</span><span class="cx"> #include &quot;InlineElementBox.cpp&quot;
</span><span class="cx"> #include &quot;InlineFlowBox.cpp&quot;
</span><ins>+#include &quot;InlineIterator.cpp&quot;
</ins><span class="cx"> #include &quot;InlineTextBox.cpp&quot;
</span><span class="cx"> #include &quot;LayoutRepainter.cpp&quot;
</span><span class="cx"> #include &quot;LayoutState.cpp&quot;
</span></span></pre>
</div>
</div>

</body>
</html>