<!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>[183370] 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/183370">183370</a></dd>
<dt>Author</dt> <dd>jfernandez@igalia.com</dd>
<dt>Date</dt> <dd>2015-04-26 15:44:11 -0700 (Sun, 26 Apr 2015)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Grid Layout] Support for align-self and align-items in grid layout
https://bugs.webkit.org/show_bug.cgi?id=133225

Reviewed by Darin Adler.

Source/WebCore:

Implementation of align-self and align-items properties for grid. It supports
different writing-modes and direction. Margins, borders and paddings are also
considered when computing the final position and stretched size.

Overflow handling is still missing and will be added when implemented row-axis
alignment support.

Test: fast/css-grid-layout/grid-align.html

* rendering/RenderBox.cpp:
(WebCore::RenderBox::computeLogicalHeight):
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::logicalContentHeightForChild):
(WebCore::RenderGrid::layoutGridItems):
(WebCore::computeOverflowAlignmentOffset):
(WebCore::RenderGrid::endOfRowForChild):
(WebCore::RenderGrid::startOfRowForChild):
(WebCore::RenderGrid::centeredRowPositionForChild):
(WebCore::marginWidthForChild):
(WebCore::marginHeightForChild):
(WebCore::RenderGrid::allowedToStretchLogicalHeightForChild):
(WebCore::RenderGrid::needToStretchChildLogicalHeight):
(WebCore::RenderGrid::marginLogicalHeightForChild):
(WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
(WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
(WebCore::RenderGrid::rowPositionForChild):
(WebCore::RenderGrid::findChildLogicalPosition):
(WebCore::RenderGrid::populateGridPositions): Deleted.
* rendering/RenderGrid.h:

LayoutTests:

Implementation of align-self and align-items properties ifor grid.

Several layout tests were touched for adapting them to the new grid item's
column-axis position when using RTL direction.

* fast/css-grid-layout/grid-align-expected.txt: Added.
* fast/css-grid-layout/grid-align.html: Added.
* fast/css-grid-layout/grid-element-border-grid-item.html:
* fast/css-grid-layout/grid-element-border-padding-grid-item.html:
* fast/css-grid-layout/grid-element-padding-grid-item.html:
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl-expected.html:
* fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl-expected.html:
* fast/css-grid-layout/grid-item-margin-resolution.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridelementbordergriditemhtml">trunk/LayoutTests/fast/css-grid-layout/grid-element-border-grid-item.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridelementborderpaddinggriditemhtml">trunk/LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridelementpaddinggriditemhtml">trunk/LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgriditemmarginautocolumnsrowshorizontalrtlexpectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgriditemmarginautocolumnsrowsverticalrtlexpectedhtml">trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl-expected.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgriditemmarginresolutionhtml">trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-resolution.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderBoxcpp">trunk/Source/WebCore/rendering/RenderBox.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridh">trunk/Source/WebCore/rendering/RenderGrid.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridalignexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-align-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridalignhtml">trunk/LayoutTests/fast/css-grid-layout/grid-align.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/LayoutTests/ChangeLog        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -1,3 +1,24 @@
</span><ins>+2015-04-26  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Grid Layout] Support for align-self and align-items in grid layout
+        https://bugs.webkit.org/show_bug.cgi?id=133225
+
+        Reviewed by Darin Adler.
+
+        Implementation of align-self and align-items properties ifor grid.
+
+        Several layout tests were touched for adapting them to the new grid item's
+        column-axis position when using RTL direction.
+
+        * fast/css-grid-layout/grid-align-expected.txt: Added.
+        * fast/css-grid-layout/grid-align.html: Added.
+        * fast/css-grid-layout/grid-element-border-grid-item.html:
+        * fast/css-grid-layout/grid-element-border-padding-grid-item.html:
+        * fast/css-grid-layout/grid-element-padding-grid-item.html:
+        * fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl-expected.html:
+        * fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl-expected.html:
+        * fast/css-grid-layout/grid-item-margin-resolution.html:
+
</ins><span class="cx"> 2015-04-26  Doug Russell  &lt;d_russell@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: richer text change notifications (142719)
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridalignexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-align-expected.txt (0 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-align-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-align-expected.txt        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -0,0 +1,18 @@
</span><ins>+This test checks that the align-self property is applied correctly.
+
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridalignhtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-align.html (0 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-align.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-align.html        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -0,0 +1,287 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
+&lt;style&gt;
+body {
+    margin: 0;
+}
+
+.grid {
+    -webkit-grid-template-columns: 100px 100px;
+    -webkit-grid-template-rows: 200px 200px;
+    width: -webkit-fit-content;
+    margin-bottom: 20px;
+}
+
+.cell {
+    width: 20px;
+    height: 40px;
+}
+
+.item {
+    width: 8px;
+    height: 16px;
+    background: black;
+}
+
+.alignSelfAuto {
+    align-self: auto;
+}
+
+.alignSelfStretch {
+    align-self: stretch;
+}
+
+.alignSelfStart {
+    align-self: start;
+}
+
+.alignSelfEnd {
+    align-self: end;
+}
+
+.alignSelfCenter {
+    align-self: center;
+}
+
+.alignSelfRight {
+    align-self: right;
+}
+
+.alignSelfLeft {
+    align-self: left;
+}
+
+.alignSelfFlexStart {
+    align-self: flex-start;
+}
+
+.alignSelfFlexEnd {
+    align-self: flex-end;
+}
+
+.alignSelfSelfStart {
+    align-self: self-start;
+}
+
+.alignSelfSelfEnd {
+    align-self: self-end;
+}
+
+.alignItemsCenter {
+    align-items: center;
+}
+
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;checkLayout('.grid')&quot;&gt;
+
+&lt;p&gt;This test checks that the align-self property is applied correctly.&lt;/p&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+        &lt;div class=&quot;alignSelfStretch firstRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfStart firstRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfEnd firstRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;160&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfCenter secondRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;280&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfRight secondRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfLeft secondRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+        &lt;div class=&quot;cell alignSelfFlexEnd firstRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;160&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfFlexStart firstRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;360&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Default alignment and initial values. --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid alignItemsCenter&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+        &lt;div class=&quot;cell alignSelfAuto firstRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;80&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell firstRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;80&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;360&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+        &lt;div class=&quot;alignSelfAuto firstRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell firstRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfStart secondRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfEnd secondRowSecondColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;360&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- RTL direction (it should not affect the block-flow direction). --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+     &lt;div class=&quot;grid directionRTL&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+         &lt;div class=&quot;alignSelfStretch firstRowFirstColumn&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfStart firstRowSecondColumn&quot; data-offset-x=&quot;80&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfEnd firstRowSecondColumn&quot; data-offset-x=&quot;80&quot; data-offset-y=&quot;160&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfCenter secondRowFirstColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;280&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfRight secondRowSecondColumn&quot; data-offset-x=&quot;80&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfLeft secondRowSecondColumn&quot; data-offset-x=&quot;80&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+     &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+     &lt;div class=&quot;grid directionRTL&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+         &lt;div class=&quot;cell alignSelfFlexEnd firstRowFirstColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;160&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfFlexStart firstRowSecondColumn&quot; data-offset-x=&quot;80&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn&quot; data-offset-x=&quot;80&quot; data-offset-y=&quot;360&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+     &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- RTL direction (it should not affect the block-flow) with opposite directions grid container vs grid item. --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+     &lt;div class=&quot;grid&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+         &lt;div class=&quot;alignSelfStretch firstRowFirstColumn directionRTL&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;200&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfStart firstRowSecondColumn directionRTL&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfEnd firstRowSecondColumn directionRTL&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;160&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfCenter secondRowFirstColumn directionRTL&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;280&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfRight secondRowSecondColumn directionRTL&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfLeft secondRowSecondColumn directionRTL&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+     &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+     &lt;div class=&quot;grid&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;400&quot;&gt;
+         &lt;div class=&quot;cell alignSelfFlexEnd firstRowFirstColumn directionRTL&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;160&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfFlexStart firstRowSecondColumn directionRTL&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn directionRTL&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;200&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+         &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn directionRTL&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;360&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+     &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Vertical RL writing mode. --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalRL&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;alignSelfStretch firstRowFirstColumn&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfStart firstRowSecondColumn&quot; data-offset-x=&quot;380&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfEnd firstRowSecondColumn&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfCenter secondRowFirstColumn&quot; data-offset-x=&quot;90&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfRight secondRowSecondColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfLeft secondRowSecondColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalRL&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;cell alignSelfFlexEnd firstRowFirstColumn&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfFlexStart firstRowSecondColumn&quot; data-offset-x=&quot;380&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Vertical LR writing mode. --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalLR&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;alignSelfStretch firstRowFirstColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfStart firstRowSecondColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfEnd firstRowSecondColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfCenter secondRowFirstColumn&quot; data-offset-x=&quot;290&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfRight secondRowSecondColumn&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfLeft secondRowSecondColumn&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalLR&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;cell alignSelfFlexEnd firstRowFirstColumn&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfFlexStart firstRowSecondColumn&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn&quot; data-offset-x=&quot;380&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Vertical RL writing mode with opposite block-flow directions grid container vs grid item. --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalRL&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;alignSelfStretch firstRowFirstColumn verticalLR&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;100&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfStart firstRowSecondColumn verticalLR&quot; data-offset-x=&quot;380&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfEnd firstRowSecondColumn verticalLR&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfCenter secondRowFirstColumn verticalLR&quot; data-offset-x=&quot;90&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfRight secondRowSecondColumn verticalLR&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfLeft secondRowSecondColumn verticalLR&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalRL&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;cell alignSelfFlexEnd firstRowFirstColumn verticalLR&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfFlexStart firstRowSecondColumn verticalLR&quot; data-offset-x=&quot;380&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn verticalLR&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn verticalLR&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- Vertical LR writing mode with opposite block-flow directions grid container vs grid item. --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalLR&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;alignSelfStretch firstRowFirstColumn verticalRL&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;100&quot;&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfStart firstRowSecondColumn verticalRL&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfEnd firstRowSecondColumn verticalRL&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfCenter secondRowFirstColumn verticalRL&quot; data-offset-x=&quot;290&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfRight secondRowSecondColumn verticalRL&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfLeft secondRowSecondColumn verticalRL&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;div class=&quot;grid verticalLR&quot; data-expected-width=&quot;400&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;cell alignSelfFlexEnd firstRowFirstColumn verticalRL&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfFlexStart firstRowSecondColumn verticalRL&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfStart secondRowFirstColumn verticalRL&quot; data-offset-x=&quot;380&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+        &lt;div class=&quot;cell alignSelfSelfEnd secondRowSecondColumn verticalRL&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;
+            &lt;div class=&quot;item&quot;&gt;&lt;/div&gt;
+        &lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementbordergriditemhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-border-grid-item.html (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-border-grid-item.html        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-border-grid-item.html        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -20,74 +20,74 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalRL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalLR&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid horizontalBT&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;!-- rtl direciton --&gt;
</del><ins>+&lt;!-- rtl direction --&gt;
</ins><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalRL directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalLR directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid horizontalBT directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementborderpaddinggriditemhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item.html (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item.html        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-border-padding-grid-item.html        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -21,74 +21,74 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalRL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalLR&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid horizontalBT&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;!-- rtl direciton --&gt;
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalRL directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalLR directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid horizontalBT directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementpaddinggriditemhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item.html (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item.html        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-padding-grid-item.html        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -17,74 +17,74 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalRL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalLR&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid horizontalBT&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;!-- rtl direciton --&gt;
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalRL directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalLR directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid horizontalBT directionRTL&quot; data-expected-width=&quot;280&quot; data-expected-height=&quot;260&quot;&gt;
</span><del>-        &lt;div class=&quot;sizedToGridArea firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;sizedToGridArea secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgriditemmarginautocolumnsrowshorizontalrtlexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl-expected.html (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl-expected.html        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-horizontal-rtl-expected.html        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -53,37 +53,37 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridLong&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 20px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 20px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;top: 60px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px; top: 60px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 20px; top: 20px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 0px&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px; top: 60px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 0px; top: 60px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridShort&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 20px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 20px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;top: 60px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px; top: 60px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 20px; top: 20px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 0px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px; top: 60px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 0px; top: 60px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridLong&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 80px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 20px; top: 80px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 0px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px; top: 20px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 20px; top: 80px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 0px; top: 80px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 0px; top: 20px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridShort&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 60px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 20px; top: 40px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 0px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 20px; top: 60px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 0px; top: 40px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 0px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgriditemmarginautocolumnsrowsverticalrtlexpectedhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl-expected.html (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl-expected.html        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-auto-columns-rows-vertical-rtl-expected.html        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -53,36 +53,36 @@
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridLong&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 180px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 180px; top: 60px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 160px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 160px; top: 80px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 180px; top: 80px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 180px; top: 20px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 160px; top: 80px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 160px; top: 0px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridShort&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 180px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 180px; top: 60px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 160px; top: 20px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 160px; top: 60px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;left: 180px; top: 60px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;left: 180px; top: 0px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 160px; top: 40px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 160px; top: 0px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridLong&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 0px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;top: 60px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px; top: 80px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 80px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;top: 20px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px; top: 80px&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px; top: 0px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div class=&quot;testContainer&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid gridShort&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 0px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;top: 60px;&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px; top: 20px;&quot; &gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px; top: 60px;&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot;   style=&quot;top: 60px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot;  style=&quot;top: 0px;&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot;  style=&quot;left: 20px; top: 40px;&quot; &gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; style=&quot;left: 20px; top: 0px;&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgriditemmarginresolutionhtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-resolution.html (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-resolution.html        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-item-margin-resolution.html        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -60,37 +60,37 @@
</span><span class="cx"> &lt;!-- rtl direction --&gt;
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid directionRTL&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;200&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalRL directionRTL&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;200&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid verticalLR directionRTL&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;200&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;40&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><span class="cx"> &lt;div style=&quot;position: relative&quot;&gt;
</span><span class="cx">     &lt;div class=&quot;grid horizontalBT directionRTL&quot; data-expected-width=&quot;200&quot; data-expected-height=&quot;200&quot;&gt;
</span><del>-        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;30&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;130&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</del><ins>+        &lt;div class=&quot;gridItem firstRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem firstRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;120&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowFirstColumn&quot; data-offset-x=&quot;150&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;gridItem secondRowSecondColumn&quot; data-offset-x=&quot;50&quot; data-offset-y=&quot;20&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
</ins><span class="cx">     &lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/Source/WebCore/ChangeLog        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -1,3 +1,40 @@
</span><ins>+2015-04-26  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Grid Layout] Support for align-self and align-items in grid layout
+        https://bugs.webkit.org/show_bug.cgi?id=133225
+
+        Reviewed by Darin Adler.
+
+        Implementation of align-self and align-items properties for grid. It supports
+        different writing-modes and direction. Margins, borders and paddings are also
+        considered when computing the final position and stretched size.
+
+        Overflow handling is still missing and will be added when implemented row-axis
+        alignment support.
+
+        Test: fast/css-grid-layout/grid-align.html
+
+        * rendering/RenderBox.cpp:
+        (WebCore::RenderBox::computeLogicalHeight):
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::logicalContentHeightForChild):
+        (WebCore::RenderGrid::layoutGridItems):
+        (WebCore::computeOverflowAlignmentOffset):
+        (WebCore::RenderGrid::endOfRowForChild):
+        (WebCore::RenderGrid::startOfRowForChild):
+        (WebCore::RenderGrid::centeredRowPositionForChild):
+        (WebCore::marginWidthForChild):
+        (WebCore::marginHeightForChild):
+        (WebCore::RenderGrid::allowedToStretchLogicalHeightForChild):
+        (WebCore::RenderGrid::needToStretchChildLogicalHeight):
+        (WebCore::RenderGrid::marginLogicalHeightForChild):
+        (WebCore::RenderGrid::availableAlignmentSpaceForChildBeforeStretching):
+        (WebCore::RenderGrid::applyStretchAlignmentToChildIfNeeded):
+        (WebCore::RenderGrid::rowPositionForChild):
+        (WebCore::RenderGrid::findChildLogicalPosition):
+        (WebCore::RenderGrid::populateGridPositions): Deleted.
+        * rendering/RenderGrid.h:
+
</ins><span class="cx"> 2015-04-26  Doug Russell  &lt;d_russell@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         AX: richer text change notifications (142719)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderBoxcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderBox.cpp (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderBox.cpp        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/Source/WebCore/rendering/RenderBox.cpp        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -2712,7 +2712,7 @@
</span><span class="cx">         // grab our cached flexible height.
</span><span class="cx">         // FIXME: Account for block-flow in flexible boxes.
</span><span class="cx">         // https://bugs.webkit.org/show_bug.cgi?id=46418
</span><del>-        if (hasOverrideLogicalContentHeight() &amp;&amp; parent()-&gt;isFlexibleBoxIncludingDeprecated())
</del><ins>+        if (hasOverrideLogicalContentHeight() &amp;&amp; (parent()-&gt;isFlexibleBoxIncludingDeprecated() || parent()-&gt;isRenderGrid()))
</ins><span class="cx">             h = Length(overrideLogicalContentHeight(), Fixed);
</span><span class="cx">         else if (treatAsReplaced)
</span><span class="cx">             h = Length(computeReplacedLogicalHeight(), Fixed);
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -40,6 +40,8 @@
</span><span class="cx"> 
</span><span class="cx"> static const int infinity = -1;
</span><span class="cx"> 
</span><ins>+enum GridAxisPosition {GridAxisStart, GridAxisEnd, GridAxisCenter};
+
</ins><span class="cx"> class GridTrack {
</span><span class="cx"> public:
</span><span class="cx">     GridTrack() {}
</span><span class="lines">@@ -548,8 +550,11 @@
</span><span class="cx"> {
</span><span class="cx">     LayoutUnit oldOverrideContainingBlockContentLogicalWidth = child.hasOverrideContainingBlockLogicalWidth() ? child.overrideContainingBlockContentLogicalWidth() : LayoutUnit();
</span><span class="cx">     LayoutUnit overrideContainingBlockContentLogicalWidth = gridAreaBreadthForChild(child, ForColumns, columnTracks);
</span><del>-    if (child.hasRelativeLogicalHeight() || oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth)
</del><ins>+    if (child.hasRelativeLogicalHeight() || oldOverrideContainingBlockContentLogicalWidth != overrideContainingBlockContentLogicalWidth) {
</ins><span class="cx">         child.setNeedsLayout(MarkOnlyThis);
</span><ins>+        // We need to clear the stretched height to properly compute logical height during layout.
+        child.clearOverrideLogicalContentHeight();
+    }
</ins><span class="cx"> 
</span><span class="cx">     child.setOverrideContainingBlockContentLogicalWidth(overrideContainingBlockContentLogicalWidth);
</span><span class="cx">     // If |child| has a relative logical height, we shouldn't let it override its intrinsic height, which is
</span><span class="lines">@@ -1174,9 +1179,11 @@
</span><span class="cx"> 
</span><span class="cx">         LayoutRect oldChildRect = child-&gt;frameRect();
</span><span class="cx"> 
</span><del>-        // FIXME: Grid items should stretch to fill their cells. Once we
-        // implement grid-{column,row}-align, we can also shrink to fit. For
-        // now, just size as if we were a regular child.
</del><ins>+        // Stretching logic might force a child layout, so we need to run it before the layoutIfNeeded
+        // call to avoid unnecessary relayouts. This might imply that child margins, needed to correctly
+        // determine the available space before stretching, are not set yet.
+        applyStretchAlignmentToChildIfNeeded(*child, overrideContainingBlockContentLogicalHeight);
+
</ins><span class="cx">         child-&gt;layoutIfNeeded();
</span><span class="cx"> 
</span><span class="cx">         child-&gt;setLogicalLocation(findChildLogicalPosition(*child, sizingData));
</span><span class="lines">@@ -1233,14 +1240,171 @@
</span><span class="cx">         m_rowPositions[i + 1] = m_rowPositions[i] + sizingData.rowTracks[i].baseSize();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-LayoutPoint RenderGrid::findChildLogicalPosition(RenderBox&amp; child, const GridSizingData&amp; sizingData)
</del><ins>+LayoutUnit RenderGrid::endOfRowForChild(const RenderBox&amp; child) const
</ins><span class="cx"> {
</span><span class="cx">     const GridCoordinate&amp; coordinate = cachedGridCoordinate(child);
</span><ins>+
+    LayoutUnit startOfRow = m_rowPositions[coordinate.rows.resolvedInitialPosition.toInt()];
+    // The grid items should be inside the grid container's border box, that's why they need to be shifted.
+    LayoutUnit rowPosition = startOfRow + marginBeforeForChild(child);
+
+    LayoutUnit endOfRow = m_rowPositions[coordinate.rows.resolvedFinalPosition.next().toInt()];
+    // FIXME: This should account for the grid item's &lt;overflow-position&gt;.
+    return rowPosition + std::max&lt;LayoutUnit&gt;(0, endOfRow - startOfRow - child.logicalHeight());
+}
+
+LayoutUnit RenderGrid::startOfRowForChild(const RenderBox&amp; child) const
+{
+    const GridCoordinate&amp; coordinate = cachedGridCoordinate(child);
+
+    LayoutUnit startOfRow = m_rowPositions[coordinate.rows.resolvedInitialPosition.toInt()];
+    // The grid items should be inside the grid container's border box, that's why they need to be shifted.
+    // FIXME: This should account for the grid item's &lt;overflow-position&gt;.
+    LayoutUnit rowPosition = startOfRow + marginBeforeForChild(child);
+
+    return rowPosition;
+}
+
+LayoutUnit RenderGrid::centeredRowPositionForChild(const RenderBox&amp; child) const
+{
+    const GridCoordinate&amp; coordinate = cachedGridCoordinate(child);
+
+    // The grid items should be inside the grid container's border box, that's why they need to be shifted.
+    LayoutUnit startOfRow = m_rowPositions[coordinate.rows.resolvedInitialPosition.toInt()];
+    LayoutUnit endOfRow = m_rowPositions[coordinate.rows.resolvedFinalPosition.next().toInt()];
+    // FIXME: This should account for the grid item's &lt;overflow-position&gt;.
+    return startOfRow + std::max&lt;LayoutUnit&gt;(0, endOfRow - startOfRow - child.logicalHeight()) / 2;
+}
+
+bool RenderGrid::allowedToStretchLogicalHeightForChild(const RenderBox&amp; child) const
+{
+    return child.style().logicalHeight().isAuto() &amp;&amp; !child.style().marginBeforeUsing(&amp;style()).isAuto() &amp;&amp; !child.style().marginAfterUsing(&amp;style()).isAuto();
+}
+
+// FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox.
+bool RenderGrid::needToStretchChildLogicalHeight(const RenderBox&amp; child) const
+{
+    if (RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch) != ItemPositionStretch)
+        return false;
+
+    return isHorizontalWritingMode() &amp;&amp; child.style().height().isAuto();
+}
+
+// FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox.
+LayoutUnit RenderGrid::marginLogicalHeightForChild(const RenderBox&amp; child) const
+{
+    return isHorizontalWritingMode() ? child.verticalMarginExtent() : child.horizontalMarginExtent();
+}
+
+LayoutUnit RenderGrid::availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAreaBreadthForChild, const RenderBox&amp; child) const
+{
+    return gridAreaBreadthForChild - marginLogicalHeightForChild(child);
+}
+
+// FIXME: This logic is shared by RenderFlexibleBox, so it should be moved to RenderBox.
+void RenderGrid::applyStretchAlignmentToChildIfNeeded(RenderBox&amp; child, LayoutUnit gridAreaBreadthForChild)
+{
+    if (RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch) != ItemPositionStretch)
+        return;
+
+    bool hasOrthogonalWritingMode = child.isHorizontalWritingMode() != isHorizontalWritingMode();
+    if (allowedToStretchLogicalHeightForChild(child)) {
+        // FIXME: If the child has orthogonal flow, then it already has an override height set, so use it.
+        // FIXME: grid track sizing and positioning do not support orthogonal modes yet.
+        if (!hasOrthogonalWritingMode) {
+            LayoutUnit stretchedLogicalHeight = availableAlignmentSpaceForChildBeforeStretching(gridAreaBreadthForChild, child);
+            LayoutUnit desiredLogicalHeight = child.constrainLogicalHeightByMinMax(stretchedLogicalHeight);
+
+            // FIXME: Can avoid laying out here in some cases. See https://webkit.org/b/87905.
+            bool childNeedsRelayout = desiredLogicalHeight != child.logicalHeight();
+            if (childNeedsRelayout || !child.hasOverrideLogicalContentHeight())
+                child.setOverrideLogicalContentHeight(desiredLogicalHeight - child.borderAndPaddingLogicalHeight());
+            if (childNeedsRelayout) {
+                child.setLogicalHeight(0);
+                child.setNeedsLayout();
+            }
+        }
+    }
+}
+
+static GridAxisPosition columnAxisPosition(ItemPosition position, bool hasOrthogonalWritingMode, bool hasSameWritingMode)
+{
+    switch (position) {
+    case ItemPositionSelfStart:
+        // If orthogonal writing-modes, this computes to 'start'.
+        // FIXME: grid track sizing and positioning do not support orthogonal modes yet.
+        // self-start is based on the child's block axis direction. That's why we need to check against the grid container's block flow.
+        return (hasOrthogonalWritingMode || hasSameWritingMode) ? GridAxisStart : GridAxisEnd;
+    case ItemPositionSelfEnd:
+        // If orthogonal writing-modes, this computes to 'end'.
+        // FIXME: grid track sizing and positioning do not support orthogonal modes yet.
+        // self-end is based on the child's block axis direction. That's why we need to check against the grid container's block flow.
+        return (hasOrthogonalWritingMode || hasSameWritingMode) ? GridAxisEnd : GridAxisStart;
+    case ItemPositionLeft:
+        // The alignment axis (column axis) and the inline axis are parallell in
+        // orthogonal writing mode. Otherwise this this is equivalent to 'start'.
+        // FIXME: grid track sizing and positioning do not support orthogonal modes yet.
+        return GridAxisStart;
+    case ItemPositionRight:
+        // The alignment axis (column axis) and the inline axis are parallell in
+        // orthogonal writing mode. Otherwise this this is equivalent to 'start'.
+        // FIXME: grid track sizing and positioning do not support orthogonal modes yet.
+        return hasOrthogonalWritingMode ? GridAxisEnd : GridAxisStart;
+    case ItemPositionCenter:
+        return GridAxisCenter;
+    case ItemPositionFlexStart: // Only used in flex layout, otherwise equivalent to 'start'.
+    case ItemPositionStart:
+        return GridAxisStart;
+    case ItemPositionFlexEnd: // Only used in flex layout, otherwise equivalent to 'end'.
+    case ItemPositionEnd:
+        return GridAxisEnd;
+    case ItemPositionStretch:
+        return GridAxisStart;
+    case ItemPositionBaseline:
+    case ItemPositionLastBaseline:
+        // FIXME: Implement the ItemPositionBaseline value. For now, we always 'start' align the child.
+        return GridAxisStart;
+    case ItemPositionAuto:
+        break;
+    }
+
+    ASSERT_NOT_REACHED();
+    return GridAxisStart;
+}
+
+LayoutUnit RenderGrid::rowPositionForChild(const RenderBox&amp; child) const
+{
+    bool hasOrthogonalWritingMode = child.isHorizontalWritingMode() != isHorizontalWritingMode();
+    bool hasSameWritingMode = child.style().writingMode() == style().writingMode();
+    ItemPosition position = RenderStyle::resolveAlignment(style(), child.style(), ItemPositionStretch);
+
+    switch (columnAxisPosition(position, hasOrthogonalWritingMode, hasSameWritingMode)) {
+    case GridAxisStart:
+        return startOfRowForChild(child);
+    case GridAxisEnd:
+        return endOfRowForChild(child);
+    case GridAxisCenter:
+        return centeredRowPositionForChild(child);
+    }
+
+    ASSERT_NOT_REACHED();
+    return 0;
+}
+
+LayoutPoint RenderGrid::findChildLogicalPosition(const RenderBox&amp; child, const GridSizingData&amp; sizingData) const
+{
+    const GridCoordinate&amp; coordinate = cachedGridCoordinate(child);
</ins><span class="cx">     ASSERT_UNUSED(sizingData, coordinate.columns.resolvedInitialPosition.toInt() &lt; sizingData.columnTracks.size());
</span><span class="cx">     ASSERT_UNUSED(sizingData, coordinate.rows.resolvedInitialPosition.toInt() &lt; sizingData.rowTracks.size());
</span><span class="cx"> 
</span><ins>+    LayoutUnit columnPosition = m_columnPositions[coordinate.columns.resolvedInitialPosition.toInt()] + marginStartForChild(child);
+    // We stored m_columnPositions's data ignoring the direction, hence we might need now
+    // to translate positions from RTL to LTR, as it's more convenient for painting.
+    if (!style().isLeftToRightDirection())
+        columnPosition = (m_columnPositions[m_columnPositions.size() - 1] + borderAndPaddingLogicalLeft()) - columnPosition  - child.logicalWidth();
+
</ins><span class="cx">     // The grid items should be inside the grid container's border box, that's why they need to be shifted.
</span><del>-    return LayoutPoint(m_columnPositions[coordinate.columns.resolvedInitialPosition.toInt()] + marginStartForChild(child), m_rowPositions[coordinate.rows.resolvedInitialPosition.toInt()] + marginBeforeForChild(child));
</del><ins>+    return LayoutPoint(columnPosition, rowPositionForChild(child));
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> void RenderGrid::paintChildren(PaintInfo&amp; paintInfo, const LayoutPoint&amp; paintOffset, PaintInfo&amp; forChild, bool usePrintRect)
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.h (183369 => 183370)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.h        2015-04-26 22:31:12 UTC (rev 183369)
+++ trunk/Source/WebCore/rendering/RenderGrid.h        2015-04-26 22:44:11 UTC (rev 183370)
</span><span class="lines">@@ -117,12 +117,22 @@
</span><span class="cx">     LayoutUnit logicalContentHeightForChild(RenderBox&amp;, Vector&lt;GridTrack&gt;&amp;);
</span><span class="cx">     LayoutUnit minContentForChild(RenderBox&amp;, GridTrackSizingDirection, Vector&lt;GridTrack&gt;&amp; columnTracks);
</span><span class="cx">     LayoutUnit maxContentForChild(RenderBox&amp;, GridTrackSizingDirection, Vector&lt;GridTrack&gt;&amp; columnTracks);
</span><del>-    LayoutPoint findChildLogicalPosition(RenderBox&amp;, const GridSizingData&amp;);
</del><ins>+    LayoutUnit startOfRowForChild(const RenderBox&amp;) const;
+    LayoutUnit endOfRowForChild(const RenderBox&amp;) const;
+    LayoutUnit centeredRowPositionForChild(const RenderBox&amp;) const;
+    LayoutUnit rowPositionForChild(const RenderBox&amp;) const;
+    LayoutPoint findChildLogicalPosition(const RenderBox&amp;, const GridSizingData&amp;) const;
</ins><span class="cx">     GridCoordinate cachedGridCoordinate(const RenderBox&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit gridAreaBreadthForChild(const RenderBox&amp; child, GridTrackSizingDirection, const Vector&lt;GridTrack&gt;&amp;) const;
</span><span class="cx"> 
</span><span class="cx">     virtual void paintChildren(PaintInfo&amp; forSelf, const LayoutPoint&amp; paintOffset, PaintInfo&amp; forChild, bool usePrintRect) override;
</span><ins>+    bool allowedToStretchLogicalHeightForChild(const RenderBox&amp;) const;
+    bool needToStretchChildLogicalHeight(const RenderBox&amp;) const;
+    LayoutUnit marginLogicalHeightForChild(const RenderBox&amp;) const;
+    LayoutUnit computeMarginLogicalHeightForChild(const RenderBox&amp;) const;
+    LayoutUnit availableAlignmentSpaceForChildBeforeStretching(LayoutUnit gridAreaBreadthForChild, const RenderBox&amp;) const;
+    void applyStretchAlignmentToChildIfNeeded(RenderBox&amp;, LayoutUnit gridAreaBreadthForChild);
</ins><span class="cx"> 
</span><span class="cx"> #ifndef NDEBUG
</span><span class="cx">     bool tracksAreWiderThanMinTrackBreadth(GridTrackSizingDirection, const Vector&lt;GridTrack&gt;&amp;);
</span></span></pre>
</div>
</div>

</body>
</html>