<!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>[164867] 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/164867">164867</a></dd>
<dt>Author</dt> <dd>mario.prada@samsung.com</dd>
<dt>Date</dt> <dd>2014-02-28 10:12:52 -0800 (Fri, 28 Feb 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>paragraphs with different directionality in textarea with unicode-bidi: plaintext are aligned the same
https://bugs.webkit.org/show_bug.cgi?id=71194

Reviewed by David Hyatt.

Merged from Blink <a href="http://trac.webkit.org/projects/webkit/changeset/157263">r157263</a> by &lt;igor.o@sisa.samsung.com&gt;
&lt;https://src.chromium.org/viewvc/blink?revision=157263&amp;view=revision&gt;

Source/WebCore:

In the css3-text spec (http://www.w3.org/TR/css3-text/#bidi-linebox):

The start and end edges of a line box are determined by the inline
base direction of the line box. In most cases, this is given by
its containing block's computed ‘direction’. However if its
containing block has ‘unicode-bidi: plaintext’, the inline base
direction the line box must be determined by the base direction of
the bidi paragraph to which it belongs: that is, the bidi
paragraph for which the line box holds content.

This patch just implements the behavior described above modifying
updateLogicalWidthForAlignment and setting the bidi level of the
RootInlineBox.

* rendering/RenderBlockFlow.h:
* rendering/RenderBlockLineLayout.cpp:
(WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
(WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
(WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns):
(WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
(WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
(WebCore::RenderBlockFlow::checkLinesForTextOverflow):
(WebCore::RenderBlockFlow::startAlignedOffsetForLine):

LayoutTests:

Modified expectations for two layout tests to make them conforming to the spec.

* fast/text/international/unicode-bidi-plaintext-expected.html:
* platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:
* platform/mac-mountainlion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfasttextinternationalunicodebidiplaintextexpectedhtml">trunk/LayoutTests/fast/text/international/unicode-bidi-plaintext-expected.html</a></li>
<li><a href="#trunkLayoutTestsplatformgtkfasttextinternationalunicodebidiplaintextintextareaexpectedtxt">trunk/LayoutTests/platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt</a></li>
<li><a href="#trunkLayoutTestsplatformmacmountainlionfasttextinternationalunicodebidiplaintextintextareaexpectedtxt">trunk/LayoutTests/platform/mac-mountainlion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockFlowh">trunk/Source/WebCore/rendering/RenderBlockFlow.h</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBlockLineLayoutcpp">trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (164866 => 164867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-02-28 18:09:24 UTC (rev 164866)
+++ trunk/LayoutTests/ChangeLog        2014-02-28 18:12:52 UTC (rev 164867)
</span><span class="lines">@@ -1,3 +1,19 @@
</span><ins>+2014-02-28  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
+
+        paragraphs with different directionality in textarea with unicode-bidi: plaintext are aligned the same
+        https://bugs.webkit.org/show_bug.cgi?id=71194
+
+        Reviewed by David Hyatt.
+
+        Merged from Blink r157263 by &lt;igor.o@sisa.samsung.com&gt;
+        &lt;https://src.chromium.org/viewvc/blink?revision=157263&amp;view=revision&gt;
+
+        Modified expectations for two layout tests to make them conforming to the spec.
+
+        * fast/text/international/unicode-bidi-plaintext-expected.html:
+        * platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:
+        * platform/mac-mountainlion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt:
+
</ins><span class="cx"> 2014-02-28  Jochen Eisinger  &lt;jochen@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Update meta-referrer behavior for invalid policies
</span></span></pre></div>
<a id="trunkLayoutTestsfasttextinternationalunicodebidiplaintextexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/text/international/unicode-bidi-plaintext-expected.html (164866 => 164867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/text/international/unicode-bidi-plaintext-expected.html        2014-02-28 18:09:24 UTC (rev 164866)
+++ trunk/LayoutTests/fast/text/international/unicode-bidi-plaintext-expected.html        2014-02-28 18:12:52 UTC (rev 164867)
</span><span class="lines">@@ -2,24 +2,34 @@
</span><span class="cx"> &lt;html&gt;
</span><span class="cx"> &lt;head&gt;
</span><span class="cx"> &lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html; charset=utf-8&quot;&gt;
</span><ins>+&lt;style&gt;
+.rightAligned {
+  display: block;
+  text-align: right;
+}
+&lt;/style&gt;
</ins><span class="cx"> &lt;/head&gt;
</span><span class="cx"> &lt;body&gt;
</span><span class="cx"> &lt;div&gt;This tests proper handling of unicode-bidi: plaintext. You should not see any red.&lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div dir=ltr&gt;
</span><span class="cx"> !hello.&lt;br&gt;
</span><del>-&lt;span dir=rtl&gt;
</del><ins>+&lt;span class=&quot;rightAligned&quot; dir=rtl&gt;
</ins><span class="cx"> !שלום.
</span><del>-&lt;/span&gt;&lt;br&gt;
</del><ins>+&lt;/span&gt;
</ins><span class="cx"> &lt;span dir=ltr&gt;
</span><span class="cx"> hello, לוי!
</span><span class="cx"> &lt;/span&gt;&lt;br&gt;
</span><del>-&lt;span dir=rtl&gt;
-שלום, WebKit!&lt;/span&gt;&lt;br&gt;
-&lt;pre&gt;
</del><ins>+&lt;span class=&quot;rightAligned&quot; dir=rtl&gt;
+שלום, WebKit!&lt;/span&gt;
+&lt;pre style=&quot;margin-bottom: 0px&quot;&gt;
</ins><span class="cx"> a
</span><span class="cx"> (
</span><del>-!WebKit ,שלום
</del><ins>+&lt;/pre&gt;
+&lt;pre dir=&quot;rtl&quot; style=&quot;margin: 0px&quot;&gt;
+שלום, WebKit!
+&lt;/pre&gt;
+&lt;pre style=&quot;margin-top: 0px&quot;&gt;
</ins><span class="cx"> hello, לוי!
</span><span class="cx"> )
</span><span class="cx"> &lt;/pre&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsplatformgtkfasttextinternationalunicodebidiplaintextintextareaexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt (164866 => 164867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt        2014-02-28 18:09:24 UTC (rev 164866)
+++ trunk/LayoutTests/platform/gtk/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt        2014-02-28 18:12:52 UTC (rev 164867)
</span><span class="lines">@@ -16,36 +16,36 @@
</span><span class="cx"> layer at (10,44) size 471x74 clip at (11,45) size 469x72
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,2) size 471x74 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 465x51
</span><del>-      RenderText {#text} at (424,0) size 41x34
</del><ins>+      RenderText {#text} at (424,0) size 465x34
</ins><span class="cx">         text run at (424,0) width 0 RTL: &quot; &quot;
</span><span class="cx">         text run at (424,0) width 41 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</span><del>-        text run at (426,17) width 39: &quot;hello!&quot;
-        text run at (465,17) width 0: &quot; &quot;
</del><ins>+        text run at (0,17) width 39: &quot;hello!&quot;
+        text run at (39,17) width 0: &quot; &quot;
</ins><span class="cx">       RenderBR {BR} at (465,34) size 0x17
</span><span class="cx"> layer at (10,125) size 471x74 clip at (11,126) size 469x72
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,83) size 471x74 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 465x51
</span><del>-      RenderText {#text} at (0,0) size 41x34
-        text run at (0,0) width 0 RTL: &quot; &quot;
-        text run at (0,0) width 41 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</del><ins>+      RenderText {#text} at (424,0) size 465x34
+        text run at (424,0) width 0 RTL: &quot; &quot;
+        text run at (424,0) width 41 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</ins><span class="cx">         text run at (0,17) width 39: &quot;hello!&quot;
</span><span class="cx">         text run at (39,17) width 0: &quot; &quot;
</span><span class="cx">       RenderBR {BR} at (0,34) size 0x17
</span><span class="cx"> layer at (10,206) size 471x74 clip at (11,207) size 469x72
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,164) size 471x74 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 465x51
</span><del>-      RenderText {#text} at (0,0) size 41x34
-        text run at (0,0) width 0 RTL: &quot; &quot;
-        text run at (0,0) width 41 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</del><ins>+      RenderText {#text} at (424,0) size 465x34
+        text run at (424,0) width 0 RTL: &quot; &quot;
+        text run at (424,0) width 41 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</ins><span class="cx">         text run at (0,17) width 39: &quot;hello!&quot;
</span><span class="cx">         text run at (39,17) width 0: &quot; &quot;
</span><span class="cx">       RenderBR {BR} at (0,34) size 0x17
</span><span class="cx"> layer at (10,287) size 471x74 clip at (11,288) size 469x72
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,245) size 471x74 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 465x51
</span><del>-      RenderText {#text} at (424,0) size 41x34
</del><ins>+      RenderText {#text} at (424,0) size 465x34
</ins><span class="cx">         text run at (424,0) width 0 RTL: &quot; &quot;
</span><span class="cx">         text run at (424,0) width 41 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</span><del>-        text run at (426,17) width 39: &quot;hello!&quot;
-        text run at (465,17) width 0: &quot; &quot;
</del><ins>+        text run at (0,17) width 39: &quot;hello!&quot;
+        text run at (39,17) width 0: &quot; &quot;
</ins><span class="cx">       RenderBR {BR} at (465,34) size 0x17
</span></span></pre></div>
<a id="trunkLayoutTestsplatformmacmountainlionfasttextinternationalunicodebidiplaintextintextareaexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/platform/mac-mountainlion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt (164866 => 164867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/platform/mac-mountainlion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt        2014-02-28 18:09:24 UTC (rev 164866)
+++ trunk/LayoutTests/platform/mac-mountainlion/fast/text/international/unicode-bidi-plaintext-in-textarea-expected.txt        2014-02-28 18:12:52 UTC (rev 164867)
</span><span class="lines">@@ -16,36 +16,36 @@
</span><span class="cx"> layer at (10,46) size 371x58 clip at (11,47) size 369x56
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,2) size 371x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 365x39
</span><del>-      RenderText {#text} at (336,0) size 30x26
</del><ins>+      RenderText {#text} at (336,0) size 365x26
</ins><span class="cx">         text run at (336,0) width 1 RTL: &quot; &quot;
</span><span class="cx">         text run at (336,0) width 29 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</span><del>-        text run at (335,13) width 30: &quot;hello!&quot;
-        text run at (365,13) width 0: &quot; &quot;
</del><ins>+        text run at (0,13) width 30: &quot;hello!&quot;
+        text run at (29,13) width 1: &quot; &quot;
</ins><span class="cx">       RenderBR {BR} at (365,26) size 0x13
</span><span class="cx"> layer at (10,112) size 371x58 clip at (11,113) size 369x56
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,68) size 371x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 365x39
</span><del>-      RenderText {#text} at (0,0) size 30x26
-        text run at (0,0) width 0 RTL: &quot; &quot;
-        text run at (0,0) width 29 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</del><ins>+      RenderText {#text} at (336,0) size 365x26
+        text run at (336,0) width 1 RTL: &quot; &quot;
+        text run at (336,0) width 29 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</ins><span class="cx">         text run at (0,13) width 30: &quot;hello!&quot;
</span><span class="cx">         text run at (29,13) width 1: &quot; &quot;
</span><span class="cx">       RenderBR {BR} at (0,26) size 0x13
</span><span class="cx"> layer at (10,178) size 371x58 clip at (11,179) size 369x56
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,134) size 371x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 365x39
</span><del>-      RenderText {#text} at (0,0) size 30x26
-        text run at (0,0) width 0 RTL: &quot; &quot;
-        text run at (0,0) width 29 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</del><ins>+      RenderText {#text} at (336,0) size 365x26
+        text run at (336,0) width 1 RTL: &quot; &quot;
+        text run at (336,0) width 29 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</ins><span class="cx">         text run at (0,13) width 30: &quot;hello!&quot;
</span><span class="cx">         text run at (29,13) width 1: &quot; &quot;
</span><span class="cx">       RenderBR {BR} at (0,26) size 0x13
</span><span class="cx"> layer at (10,244) size 371x58 clip at (11,245) size 369x56
</span><span class="cx">   RenderTextControl {TEXTAREA} at (2,200) size 371x58 [bgcolor=#FFFFFF] [border: (1px solid #000000)]
</span><span class="cx">     RenderBlock {DIV} at (3,3) size 365x39
</span><del>-      RenderText {#text} at (336,0) size 30x26
</del><ins>+      RenderText {#text} at (336,0) size 365x26
</ins><span class="cx">         text run at (336,0) width 1 RTL: &quot; &quot;
</span><span class="cx">         text run at (336,0) width 29 RTL: &quot;\x{5E9}\x{5DC}\x{5D5}\x{5DD}!&quot;
</span><del>-        text run at (335,13) width 30: &quot;hello!&quot;
-        text run at (365,13) width 0: &quot; &quot;
</del><ins>+        text run at (0,13) width 30: &quot;hello!&quot;
+        text run at (29,13) width 1: &quot; &quot;
</ins><span class="cx">       RenderBR {BR} at (365,26) size 0x13
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (164866 => 164867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-02-28 18:09:24 UTC (rev 164866)
+++ trunk/Source/WebCore/ChangeLog        2014-02-28 18:12:52 UTC (rev 164867)
</span><span class="lines">@@ -1,3 +1,37 @@
</span><ins>+2014-02-28  Mario Sanchez Prada  &lt;mario.prada@samsung.com&gt;
+
+        paragraphs with different directionality in textarea with unicode-bidi: plaintext are aligned the same
+        https://bugs.webkit.org/show_bug.cgi?id=71194
+
+        Reviewed by David Hyatt.
+
+        Merged from Blink r157263 by &lt;igor.o@sisa.samsung.com&gt;
+        &lt;https://src.chromium.org/viewvc/blink?revision=157263&amp;view=revision&gt;
+
+        In the css3-text spec (http://www.w3.org/TR/css3-text/#bidi-linebox):
+
+        The start and end edges of a line box are determined by the inline
+        base direction of the line box. In most cases, this is given by
+        its containing block's computed ‘direction’. However if its
+        containing block has ‘unicode-bidi: plaintext’, the inline base
+        direction the line box must be determined by the base direction of
+        the bidi paragraph to which it belongs: that is, the bidi
+        paragraph for which the line box holds content.
+
+        This patch just implements the behavior described above modifying
+        updateLogicalWidthForAlignment and setting the bidi level of the
+        RootInlineBox.
+
+        * rendering/RenderBlockFlow.h:
+        * rendering/RenderBlockLineLayout.cpp:
+        (WebCore::RenderBlockFlow::updateLogicalWidthForAlignment):
+        (WebCore::RenderBlockFlow::computeInlineDirectionPositionsForSegment):
+        (WebCore::RenderBlockFlow::createLineBoxesFromBidiRuns):
+        (WebCore::RenderBlockFlow::layoutRunsAndFloatsInRange):
+        (WebCore::RenderBlockFlow::deleteEllipsisLineBoxes):
+        (WebCore::RenderBlockFlow::checkLinesForTextOverflow):
+        (WebCore::RenderBlockFlow::startAlignedOffsetForLine):
+
</ins><span class="cx"> 2014-02-28  Jochen Eisinger  &lt;jochen@chromium.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Update meta-referrer behavior for invalid policies
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockFlowh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockFlow.h (164866 => 164867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockFlow.h        2014-02-28 18:09:24 UTC (rev 164866)
+++ trunk/Source/WebCore/rendering/RenderBlockFlow.h        2014-02-28 18:12:52 UTC (rev 164867)
</span><span class="lines">@@ -535,7 +535,7 @@
</span><span class="cx">     BidiRun* handleTrailingSpaces(BidiRunList&lt;BidiRun&gt;&amp;, BidiContext*);
</span><span class="cx">     void appendFloatingObjectToLastLine(FloatingObject*);
</span><span class="cx">     // Helper function for layoutInlineChildren()
</span><del>-    RootInlineBox* createLineBoxesFromBidiRuns(BidiRunList&lt;BidiRun&gt;&amp;, const InlineIterator&amp; end, LineInfo&amp;, VerticalPositionCache&amp;, BidiRun* trailingSpaceRun, WordMeasurements&amp;);
</del><ins>+    RootInlineBox* createLineBoxesFromBidiRuns(unsigned bidiLevel, BidiRunList&lt;BidiRun&gt;&amp;, const InlineIterator&amp; end, LineInfo&amp;, VerticalPositionCache&amp;, BidiRun* trailingSpaceRun, WordMeasurements&amp;);
</ins><span class="cx">     void layoutRunsAndFloats(LineLayoutState&amp;, bool hasInlineChild);
</span><span class="cx">     const InlineIterator&amp; restartLayoutRunsAndFloatsInRange(LayoutUnit oldLogicalHeight, LayoutUnit newLogicalHeight,  FloatingObject* lastFloatFromPreviousLine, InlineBidiResolver&amp;,  const InlineIterator&amp;);
</span><span class="cx">     void layoutRunsAndFloatsInRange(LineLayoutState&amp;, InlineBidiResolver&amp;, const InlineIterator&amp; cleanLineStart, const BidiStatus&amp; cleanLineBidiStatus, unsigned consecutiveHyphenatedLines);
</span><span class="lines">@@ -560,7 +560,7 @@
</span><span class="cx">     // region/page/column that has a different available line width than the old one. Used to know when you have to dirty a
</span><span class="cx">     // line, i.e., that it can't be re-used.
</span><span class="cx">     bool lineWidthForPaginatedLineChanged(RootInlineBox*, LayoutUnit lineDelta, RenderFlowThread*) const;
</span><del>-    void updateLogicalWidthForAlignment(const ETextAlign&amp;, BidiRun* trailingSpaceRun, float&amp; logicalLeft, float&amp; totalLogicalWidth, float&amp; availableLogicalWidth, int expansionOpportunityCount);
</del><ins>+    void updateLogicalWidthForAlignment(const ETextAlign&amp;, const RootInlineBox*, BidiRun* trailingSpaceRun, float&amp; logicalLeft, float&amp; totalLogicalWidth, float&amp; availableLogicalWidth, int expansionOpportunityCount);
</ins><span class="cx"> 
</span><span class="cx"> // END METHODS DEFINED IN RenderBlockLineLayout
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBlockLineLayoutcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp (164866 => 164867)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-02-28 18:09:24 UTC (rev 164866)
+++ trunk/Source/WebCore/rendering/RenderBlockLineLayout.cpp        2014-02-28 18:12:52 UTC (rev 164867)
</span><span class="lines">@@ -571,8 +571,14 @@
</span><span class="cx">     }
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void RenderBlockFlow::updateLogicalWidthForAlignment(const ETextAlign&amp; textAlign, BidiRun* trailingSpaceRun, float&amp; logicalLeft, float&amp; totalLogicalWidth, float&amp; availableLogicalWidth, int expansionOpportunityCount)
</del><ins>+void RenderBlockFlow::updateLogicalWidthForAlignment(const ETextAlign&amp; textAlign, const RootInlineBox* rootInlineBox, BidiRun* trailingSpaceRun, float&amp; logicalLeft, float&amp; totalLogicalWidth, float&amp; availableLogicalWidth, int expansionOpportunityCount)
</ins><span class="cx"> {
</span><ins>+    TextDirection direction;
+    if (rootInlineBox &amp;&amp; style().unicodeBidi() == Plaintext)
+        direction = rootInlineBox-&gt;direction();
+    else
+        direction = style().direction();
+
</ins><span class="cx">     // Armed with the total width of the line (without justification),
</span><span class="cx">     // we now examine our text-align property in order to determine where to position the
</span><span class="cx">     // objects horizontally. The total width of the line can be increased if we end up
</span><span class="lines">@@ -601,13 +607,13 @@
</span><span class="cx">         }
</span><span class="cx">         FALLTHROUGH;
</span><span class="cx">     case TASTART:
</span><del>-        if (style().isLeftToRightDirection())
</del><ins>+        if (direction == LTR)
</ins><span class="cx">             updateLogicalWidthForLeftAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
</span><span class="cx">         else
</span><span class="cx">             updateLogicalWidthForRightAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
</span><span class="cx">         break;
</span><span class="cx">     case TAEND:
</span><del>-        if (style().isLeftToRightDirection())
</del><ins>+        if (direction == LTR)
</ins><span class="cx">             updateLogicalWidthForRightAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
</span><span class="cx">         else
</span><span class="cx">             updateLogicalWidthForLeftAlignedBlock(style().isLeftToRightDirection(), trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth);
</span><span class="lines">@@ -747,7 +753,7 @@
</span><span class="cx">         expansionOpportunityCount--;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    updateLogicalWidthForAlignment(textAlign, trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth, expansionOpportunityCount);
</del><ins>+    updateLogicalWidthForAlignment(textAlign, lineBox, trailingSpaceRun, logicalLeft, totalLogicalWidth, availableLogicalWidth, expansionOpportunityCount);
</ins><span class="cx"> 
</span><span class="cx">     computeExpansionForJustifiedText(firstRun, trailingSpaceRun, expansionOpportunities, expansionOpportunityCount, totalLogicalWidth, availableLogicalWidth);
</span><span class="cx"> 
</span><span class="lines">@@ -978,7 +984,7 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> // This function constructs line boxes for all of the text runs in the resolver and computes their position.
</span><del>-RootInlineBox* RenderBlockFlow::createLineBoxesFromBidiRuns(BidiRunList&lt;BidiRun&gt;&amp; bidiRuns, const InlineIterator&amp; end, LineInfo&amp; lineInfo, VerticalPositionCache&amp; verticalPositionCache, BidiRun* trailingSpaceRun, WordMeasurements&amp; wordMeasurements)
</del><ins>+RootInlineBox* RenderBlockFlow::createLineBoxesFromBidiRuns(unsigned bidiLevel, BidiRunList&lt;BidiRun&gt;&amp; bidiRuns, const InlineIterator&amp; end, LineInfo&amp; lineInfo, VerticalPositionCache&amp; verticalPositionCache, BidiRun* trailingSpaceRun, WordMeasurements&amp; wordMeasurements)
</ins><span class="cx"> {
</span><span class="cx">     if (!bidiRuns.runCount())
</span><span class="cx">         return 0;
</span><span class="lines">@@ -990,6 +996,7 @@
</span><span class="cx">     if (!lineBox)
</span><span class="cx">         return 0;
</span><span class="cx"> 
</span><ins>+    lineBox-&gt;setBidiLevel(bidiLevel);
</ins><span class="cx">     lineBox-&gt;setEndsWithBreak(lineInfo.previousLineBrokeCleanly());
</span><span class="cx">     
</span><span class="cx">     bool isSVGRootInlineBox = lineBox-&gt;isSVGRootInlineBox();
</span><span class="lines">@@ -1381,7 +1388,7 @@
</span><span class="cx">             // inline flow boxes.
</span><span class="cx"> 
</span><span class="cx">             LayoutUnit oldLogicalHeight = logicalHeight();
</span><del>-            RootInlineBox* lineBox = createLineBoxesFromBidiRuns(bidiRuns, end, layoutState.lineInfo(), verticalPositionCache, trailingSpaceRun, wordMeasurements);
</del><ins>+            RootInlineBox* lineBox = createLineBoxesFromBidiRuns(resolver.status().context-&gt;level(), bidiRuns, end, layoutState.lineInfo(), verticalPositionCache, trailingSpaceRun, wordMeasurements);
</ins><span class="cx"> 
</span><span class="cx">             bidiRuns.deleteRuns();
</span><span class="cx">             resolver.markCurrentRunEmpty(); // FIXME: This can probably be replaced by an ASSERT (or just removed).
</span><span class="lines">@@ -2036,7 +2043,7 @@
</span><span class="cx">             float logicalLeft = pixelSnappedLogicalLeftOffsetForLine(curr-&gt;lineTop(), firstLine);
</span><span class="cx">             float availableLogicalWidth = logicalRightOffsetForLine(curr-&gt;lineTop(), false) - logicalLeft;
</span><span class="cx">             float totalLogicalWidth = curr-&gt;logicalWidth();
</span><del>-            updateLogicalWidthForAlignment(textAlign, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
</del><ins>+            updateLogicalWidthForAlignment(textAlign, curr, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
</ins><span class="cx"> 
</span><span class="cx">             if (ltr)
</span><span class="cx">                 curr-&gt;adjustLogicalPosition((logicalLeft - curr-&gt;logicalLeft()), 0);
</span><span class="lines">@@ -2083,7 +2090,7 @@
</span><span class="cx"> 
</span><span class="cx">                 float logicalLeft = 0; // We are only interested in the delta from the base position.
</span><span class="cx">                 float truncatedWidth = pixelSnappedLogicalRightOffsetForLine(curr-&gt;lineTop(), firstLine);
</span><del>-                updateLogicalWidthForAlignment(textAlign, 0, logicalLeft, totalLogicalWidth, truncatedWidth, 0);
</del><ins>+                updateLogicalWidthForAlignment(textAlign, curr, 0, logicalLeft, totalLogicalWidth, truncatedWidth, 0);
</ins><span class="cx">                 if (ltr)
</span><span class="cx">                     curr-&gt;adjustLogicalPosition(logicalLeft, 0);
</span><span class="cx">                 else
</span><span class="lines">@@ -2165,8 +2172,10 @@
</span><span class="cx">     float totalLogicalWidth = 0;
</span><span class="cx">     float logicalLeft = logicalLeftOffsetForLine(logicalHeight(), false);
</span><span class="cx">     float availableLogicalWidth = logicalRightOffsetForLine(logicalHeight(), false) - logicalLeft;
</span><del>-    updateLogicalWidthForAlignment(textAlign, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
</del><span class="cx"> 
</span><ins>+    // FIXME: Bug 129311: We need to pass a valid RootInlineBox here, considering the bidi level used to construct the line.
+    updateLogicalWidthForAlignment(textAlign, 0, 0, logicalLeft, totalLogicalWidth, availableLogicalWidth, 0);
+
</ins><span class="cx">     if (!style().isLeftToRightDirection())
</span><span class="cx">         return logicalWidth() - logicalLeft;
</span><span class="cx">     return logicalLeft;
</span></span></pre>
</div>
</div>

</body>
</html>