<!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>[199098] 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/199098">199098</a></dd>
<dt>Author</dt> <dd>rego@igalia.com</dd>
<dt>Date</dt> <dd>2016-04-06 03:21:59 -0700 (Wed, 06 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] Fix positioned children in RTL
https://bugs.webkit.org/show_bug.cgi?id=156162

Reviewed by Sergio Villar Senin.

Source/WebCore:

This patch fixes a problem affecting the items without
a static inline position (i.e. &quot;left&quot; and/or &quot;right&quot; properties
are not &quot;auto&quot;). In this particular case we need to compute
the &quot;offset&quot; from the left, so we need a specific condition
and computation.

Let's use an example to understand what it's fixing:
&lt;div style=&quot;display: grid; grid-template-columns: 100px 50px; width: 300px;
            position: relative; direction: rtl;&quot;&gt;
    &lt;div style=&quot;position: absolute; left: 0; grid-column: 1 / 2;&quot;&gt;item&lt;/div&gt;
&lt;/div&gt;

In this case the item has to be placed in the first column
(the one on the right as we're in RTL).
For this we need to calculate the offset from the left, which is 200px:
150px (alignment offset) + 50px (offset from line 3 to 2).

Test: fast/css-grid-layout/grid-positioned-items-background-rtl.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::offsetAndBreadthForPositionedChild):

LayoutTests:

Added more RTL cases for the positioned tests.

* fast/css-grid-layout/absolute-positioning-grid-container-containing-block-expected.txt:
* fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html:
* fast/css-grid-layout/grid-positioned-items-background-rtl-expected.html: Added.
* fast/css-grid-layout/grid-positioned-items-background-rtl.html: Added.
* fast/css-grid-layout/grid-positioned-items-padding-expected.txt:
* fast/css-grid-layout/grid-positioned-items-padding.html:
* fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt:
* fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html:
* fast/css-grid-layout/grid-sizing-positioned-items-expected.txt:
* fast/css-grid-layout/grid-sizing-positioned-items.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutabsolutepositioninggridcontainercontainingblockexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutabsolutepositioninggridcontainercontainingblockhtml">trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioneditemspaddingexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioneditemspaddinghtml">trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioneditemswithingridimplicittrackexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioneditemswithingridimplicittrackhtml">trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridsizingpositioneditemsexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridsizingpositioneditemshtml">trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioneditemsbackgroundrtlexpectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridpositioneditemsbackgroundrtlhtml">trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/ChangeLog        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -1,3 +1,23 @@
</span><ins>+2016-04-06  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix positioned children in RTL
+        https://bugs.webkit.org/show_bug.cgi?id=156162
+
+        Reviewed by Sergio Villar Senin.
+
+        Added more RTL cases for the positioned tests.
+
+        * fast/css-grid-layout/absolute-positioning-grid-container-containing-block-expected.txt:
+        * fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html:
+        * fast/css-grid-layout/grid-positioned-items-background-rtl-expected.html: Added.
+        * fast/css-grid-layout/grid-positioned-items-background-rtl.html: Added.
+        * fast/css-grid-layout/grid-positioned-items-padding-expected.txt:
+        * fast/css-grid-layout/grid-positioned-items-padding.html:
+        * fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt:
+        * fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html:
+        * fast/css-grid-layout/grid-sizing-positioned-items-expected.txt:
+        * fast/css-grid-layout/grid-sizing-positioned-items.html:
+
</ins><span class="cx"> 2016-04-06  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ComposedTreeIterator may crash when first child of shadow root is a comment node
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutabsolutepositioninggridcontainercontainingblockexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block-expected.txt (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block-expected.txt        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block-expected.txt        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -8,3 +8,5 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutabsolutepositioninggridcontainercontainingblockhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-grid-container-containing-block.html        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -293,5 +293,55 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sizedToGridArea absolute autoRowAutoColumn offsetLeft25 offsetTop75&quot;
+        data-offset-x=&quot;25&quot; data-offset-y=&quot;75&quot; data-expected-width=&quot;530&quot; data-expected-height=&quot;530&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;sizedToGridArea absolute firstRowFirstColumn offsetRightMinus40 offsetBottomMinus80&quot;
+        data-offset-x=&quot;40&quot; data-offset-y=&quot;95&quot; data-expected-width=&quot;515&quot; data-expected-height=&quot;515&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;sizedToGridArea absolute secondRowFirstColumn offsetRight50 offsetBottom100&quot;
+        data-offset-x=&quot;-50&quot; data-offset-y=&quot;-35&quot; data-expected-width=&quot;515&quot; data-expected-height=&quot;465&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;sizedToGridArea absolute firstRowSecondColumn offsetLeftMinus20 offsetTopMinus60&quot;
+        data-offset-x=&quot;-20&quot; data-offset-y=&quot;-45&quot; data-expected-width=&quot;465&quot; data-expected-height=&quot;515&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;sizedToGridArea absolute secondRowSecondColumn offsetRight50 offsetTop75&quot;
+        data-offset-x=&quot;-50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;465&quot; data-expected-height=&quot;465&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;sizedToGridArea absolute thirdRowThirdColumnSpanning2Rows offsetLeft25 offsetBottom100&quot;
+        data-offset-x=&quot;25&quot; data-offset-y=&quot;65&quot; data-expected-width=&quot;365&quot; data-expected-height=&quot;350&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;sizedToGridArea absolute thirdRowThirdColumnSpanning2Rows2Columns offsetLeftMinus20 offsetRight50 offsetTopMinus60 offsetBottom100&quot;
+        data-offset-x=&quot;-35&quot; data-offset-y=&quot;105&quot; data-expected-width=&quot;350&quot; data-expected-height=&quot;350&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div&gt;
+        &lt;div class=&quot;sizedToGridArea absolute autoRowAutoColumn offsetLeft25 offsetTop75&quot;
+            data-offset-x=&quot;25&quot; data-offset-y=&quot;75&quot; data-expected-width=&quot;530&quot; data-expected-height=&quot;530&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea absolute firstRowFirstColumn offsetRightMinus40 offsetBottomMinus80&quot;
+            data-offset-x=&quot;40&quot; data-offset-y=&quot;95&quot; data-expected-width=&quot;515&quot; data-expected-height=&quot;515&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea absolute secondRowFirstColumn offsetRight50 offsetBottom100&quot;
+            data-offset-x=&quot;-50&quot; data-offset-y=&quot;-35&quot; data-expected-width=&quot;515&quot; data-expected-height=&quot;465&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea absolute firstRowSecondColumn offsetLeftMinus20 offsetTopMinus60&quot;
+            data-offset-x=&quot;-20&quot; data-offset-y=&quot;-45&quot; data-expected-width=&quot;465&quot; data-expected-height=&quot;515&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea absolute secondRowSecondColumn offsetRight50 offsetTop75&quot;
+            data-offset-x=&quot;-50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;465&quot; data-expected-height=&quot;465&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea absolute thirdRowThirdColumnSpanning2Rows offsetLeft25 offsetBottom100&quot;
+            data-offset-x=&quot;25&quot; data-offset-y=&quot;65&quot; data-expected-width=&quot;365&quot; data-expected-height=&quot;350&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;sizedToGridArea absolute thirdRowThirdColumnSpanning2Rows2Columns offsetLeftMinus20 offsetRight50 offsetTopMinus60 offsetBottom100&quot;
+            data-offset-x=&quot;-35&quot; data-offset-y=&quot;105&quot; data-expected-width=&quot;350&quot; data-expected-height=&quot;350&quot;&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span><span class="cx"> &lt;/html&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioneditemsbackgroundrtlexpectedhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl-expected.html (0 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl-expected.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl-expected.html        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -0,0 +1,35 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;style&gt;
+.grid {
+    width: 500px;
+    height: 300px;
+    border: 5px solid black;
+    margin: 30px;
+    padding: 15px;
+}
+
+.container {
+    position: relative;
+    float: left;
+}
+
+.absolute {
+    position: absolute;
+}
+
+.green {
+    background-color: green;
+}
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that the background of positioned items is painted in the right position using RTL direction.&lt;/p&gt;
+
+&lt;p&gt;The test passes if you see 4 green boxes and no red.&lt;/p&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;grid&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;absolute green&quot; style=&quot;left: 455px; top: 50px; width: 100px; height: 50px&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;absolute green&quot; style=&quot;left: 390px; top: 50px; width: 50px; height: 20px&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;absolute green&quot; style=&quot;left: 500px; top: 115px; width: 50px; height: 30px&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;absolute green&quot; style=&quot;left: 275px; top: 135px; width: 145px; height: 75px&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioneditemsbackgroundrtlhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl.html (0 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-background-rtl.html        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -0,0 +1,74 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+
+.grid {
+    -webkit-grid-template-columns: 100px 200px;
+    -webkit-grid-template-rows: 50px 150px;
+    width: 500px;
+    height: 300px;
+    border: 5px solid black;
+    margin: 30px;
+    padding: 15px;
+    /* Ensures that the grid container is the containing block of the absolutely positioned grid children. */
+    position: relative;
+    background-color: transparent;
+}
+
+.container {
+    position: relative;
+    float: left;
+}
+
+.absolute {
+    position: absolute;
+}
+
+.grid &gt; div {
+    background-color: green;
+}
+
+.lengthSize {
+    width: 50px;
+    height: 20px;
+}
+
+.percentageSize {
+    width: 50%;
+    height: 20%;
+}
+
+.offsetsSize {
+    left: 25px;
+    right: 30px;
+    top: 35px;
+    bottom: 40px;
+}
+
+.red {
+    background-color: red;
+}
+&lt;/style&gt;
+
+&lt;p&gt;This test checks that the background of positioned items is painted in the right position using RTL direction.&lt;/p&gt;
+
+&lt;p&gt;The test passes if you see 4 green boxes and no red.&lt;/p&gt;
+
+&lt;div class=&quot;container&quot;&gt;
+    &lt;div class=&quot;absolute red&quot; style=&quot;left: 455px; top: 50px; width: 100px; height: 50px&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;absolute red&quot; style=&quot;left: 390px; top: 50px; width: 50px; height: 20px&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;absolute red&quot; style=&quot;left: 500px; top: 115px; width: 50px; height: 30px&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;absolute red&quot; style=&quot;left: 275px; top: 135px; width: 145px; height: 75px&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;grid directionRTL&quot;&gt;
+        &lt;div class=&quot;absolute onlyFirstRowOnlyFirstColumn sizedToGridArea&quot;
+            style=&quot;left: 5px;&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;absolute onlyFirstRowOnlySecondColumn lengthSize&quot;
+            style=&quot;right: 10px;&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;absolute onlySecondRowOnlyFirstColumn percentageSize&quot;
+            style=&quot;top: 15px;&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;absolute onlySecondRowOnlySecondColumn offsetsSize&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioneditemspaddingexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding-expected.txt (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding-expected.txt        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding-expected.txt        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -4,3 +4,7 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioneditemspaddinghtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding.html (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding.html        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-padding.html        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -113,4 +113,88 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: auto / 1; -webkit-grid-row: auto / 1;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 1 / 2; -webkit-grid-row: auto / 1;&quot;
+        data-offset-x=&quot;415&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: auto / 1; -webkit-grid-row: 1 / 2;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;50&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / auto; -webkit-grid-row: 3 / auto;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 2 / 3; -webkit-grid-row: 3 / auto;&quot;
+        data-offset-x=&quot;215&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / auto; -webkit-grid-row: 2 / 3;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;65&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;150&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: -5 / 1; -webkit-grid-row: -5 / 1;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 1 / 2; -webkit-grid-row: -5 / 1;&quot;
+        data-offset-x=&quot;415&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: -5 / 1; -webkit-grid-row: 1 / 2;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;50&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / 5; -webkit-grid-row: 3 / 5;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 2 / 3; -webkit-grid-row: 3 / 5;&quot;
+        data-offset-x=&quot;215&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / 5; -webkit-grid-row: 2 / 3;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;65&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;150&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: span 2 / 1; -webkit-grid-row: span 2 / 1;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 1 / 2; -webkit-grid-row: span 2 / 1;&quot;
+        data-offset-x=&quot;415&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: span 2 / 1; -webkit-grid-row: 1 / 2;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;50&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / span 2; -webkit-grid-row: 3 / span 2;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 2 / 3; -webkit-grid-row: 3 / span 2;&quot;
+        data-offset-x=&quot;215&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / span 2; -webkit-grid-row: 2 / 3;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;65&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;150&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: foo / 1; -webkit-grid-row: foo / 1;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 1 / 2; -webkit-grid-row: foo / 1;&quot;
+        data-offset-x=&quot;415&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;15&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: foo / 1; -webkit-grid-row: 1 / 2;&quot;
+        data-offset-x=&quot;515&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;15&quot; data-expected-height=&quot;50&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / foo; -webkit-grid-row: 3 / foo;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 2 / 3; -webkit-grid-row: 3 / foo;&quot;
+        data-offset-x=&quot;215&quot; data-offset-y=&quot;215&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / foo; -webkit-grid-row: 2 / 3;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;65&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;150&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioneditemswithingridimplicittrackexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track-expected.txt        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -8,3 +8,11 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridpositioneditemswithingridimplicittrackhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-positioned-items-within-grid-implicit-track.html        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -109,4 +109,76 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: auto / 1; -webkit-grid-row: auto / 1;&quot;
+        data-offset-x=&quot;615&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: auto / 2; -webkit-grid-row: auto / 2;&quot;
+        data-offset-x=&quot;415&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;415&quot; data-expected-height=&quot;265&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / auto; -webkit-grid-row: 3 / auto;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;515&quot; data-expected-width=&quot;115&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 2 / auto; -webkit-grid-row: 2 / auto;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;265&quot; data-expected-width=&quot;415&quot; data-expected-height=&quot;365&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: -4 / 1; -webkit-grid-row: -4 / 1;&quot;
+        data-offset-x=&quot;615&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;215&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: -4 / 2; -webkit-grid-row: -4 / 2;&quot;
+        data-offset-x=&quot;415&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;415&quot; data-expected-height=&quot;265&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 3 / 4; -webkit-grid-row: 3 / 4;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;515&quot; data-expected-width=&quot;115&quot; data-expected-height=&quot;115&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid directionRTL&quot;&gt;
+    &lt;div class=&quot;sixRowsAndSixColumns&quot;
+        data-offset-x=&quot;-85&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;600&quot;&gt;
+    &lt;/div&gt;
+    &lt;div class=&quot;absolute&quot; style=&quot;-webkit-grid-column: 2 / 4; -webkit-grid-row: 2 / 4;&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;265&quot; data-expected-width=&quot;415&quot; data-expected-height=&quot;365&quot;&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridsizingpositioneditemsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items-expected.txt (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items-expected.txt        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items-expected.txt        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -7,3 +7,4 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridsizingpositioneditemshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items.html (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items.html        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-sizing-positioned-items.html        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -161,4 +161,21 @@
</span><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;unconstrainedContainer&quot;&gt;
+    &lt;div class=&quot;grid directionRTL&quot;&gt;
+        &lt;div class=&quot;absolute autoRowAutoColumn offsets&quot;
+            data-offset-x=&quot;5&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;1015&quot; data-expected-height=&quot;995&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;absolute secondRowSecondColumn offsets&quot;
+            data-offset-x=&quot;5&quot; data-offset-y=&quot;80&quot; data-expected-width=&quot;900&quot; data-expected-height=&quot;930&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;absolute onlyFirstRowOnlyFirstColumn offsets&quot;
+            data-offset-x=&quot;920&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;85&quot; data-expected-height=&quot;15&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;absolute endSecondRowEndSecondColumn offsets&quot;
+            data-offset-x=&quot;720&quot; data-offset-y=&quot;15&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;180&quot;&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/Source/WebCore/ChangeLog        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -1,3 +1,32 @@
</span><ins>+2016-04-06  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix positioned children in RTL
+        https://bugs.webkit.org/show_bug.cgi?id=156162
+
+        Reviewed by Sergio Villar Senin.
+
+        This patch fixes a problem affecting the items without
+        a static inline position (i.e. &quot;left&quot; and/or &quot;right&quot; properties
+        are not &quot;auto&quot;). In this particular case we need to compute
+        the &quot;offset&quot; from the left, so we need a specific condition
+        and computation.
+
+        Let's use an example to understand what it's fixing:
+        &lt;div style=&quot;display: grid; grid-template-columns: 100px 50px; width: 300px;
+                    position: relative; direction: rtl;&quot;&gt;
+            &lt;div style=&quot;position: absolute; left: 0; grid-column: 1 / 2;&quot;&gt;item&lt;/div&gt;
+        &lt;/div&gt;
+
+        In this case the item has to be placed in the first column
+        (the one on the right as we're in RTL).
+        For this we need to calculate the offset from the left, which is 200px:
+        150px (alignment offset) + 50px (offset from line 3 to 2).
+
+        Test: fast/css-grid-layout/grid-positioned-items-background-rtl.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::offsetAndBreadthForPositionedChild):
+
</ins><span class="cx"> 2016-04-06  Antti Koivisto  &lt;antti@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         ComposedTreeIterator may crash when first child of shadow root is a comment node
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (199097 => 199098)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-04-06 09:27:22 UTC (rev 199097)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-04-06 10:21:59 UTC (rev 199098)
</span><span class="lines">@@ -1537,6 +1537,18 @@
</span><span class="cx">     breadth = end - start;
</span><span class="cx">     offset = start;
</span><span class="cx"> 
</span><ins>+    if (isRowAxis &amp;&amp; !style().isLeftToRightDirection() &amp;&amp; !child.style().hasStaticInlinePosition(child.isHorizontalWritingMode())) {
+        // If the child doesn't have a static inline position (i.e. &quot;left&quot; and/or &quot;right&quot; aren't &quot;auto&quot;,
+        // we need to calculate the offset from the left (even if we're in RTL).
+        if (endIsAuto)
+            offset = LayoutUnit();
+        else {
+            LayoutUnit alignmentOffset =  m_columnPositions[0] - borderAndPaddingStart();
+            LayoutUnit offsetFromLastLine = m_columnPositions[m_columnPositions.size() - 1] - m_columnPositions[endLine];
+            offset = paddingLeft() +  alignmentOffset + offsetFromLastLine;
+        }
+    }
+
</ins><span class="cx">     if (child.parent() == this &amp;&amp; !startIsAuto) {
</span><span class="cx">         // If column/row start is &quot;auto&quot; the static position has been already set in prepareChildForPositionedLayout().
</span><span class="cx">         RenderLayer* childLayer = child.layer();
</span></span></pre>
</div>
</div>

</body>
</html>