<!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>[200181] 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/200181">200181</a></dd>
<dt>Author</dt> <dd>rego@igalia.com</dd>
<dt>Date</dt> <dd>2016-04-28 01:54:33 -0700 (Thu, 28 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] Fix alignment with content distribution
https://bugs.webkit.org/show_bug.cgi?id=156623

Reviewed by Sergio Villar Senin.

Source/WebCore:

We were only subtracting the distribution offset for items spanning
several tracks, but not for items in a single cell.
We should actually subtract the offset in that situation too,
the same that we do for the grid gaps.

Test: fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html

* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::columnAxisOffsetForChild): Subtract distribution
offset like we do for gaps.
(WebCore::RenderGrid::rowAxisOffsetForChild): Ditto.

LayoutTests:

Created new test and renamed the old one as it was only testing
items spanning several cells.

* fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt:
* fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning-expected.txt:
Renamed from fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt.
* fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html:
Renamed from fast/css-grid-layout/grid-content-alignment-and-self-alignment.html.
* fast/css-grid-layout/grid-content-alignment-and-self-alignment.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmentexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmenthtml">trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmentspanningexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmentspanninghtml">trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (200180 => 200181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-28 08:03:24 UTC (rev 200180)
+++ trunk/LayoutTests/ChangeLog        2016-04-28 08:54:33 UTC (rev 200181)
</span><span class="lines">@@ -1,3 +1,20 @@
</span><ins>+2016-04-28  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix alignment with content distribution
+        https://bugs.webkit.org/show_bug.cgi?id=156623
+
+        Reviewed by Sergio Villar Senin.
+
+        Created new test and renamed the old one as it was only testing
+        items spanning several cells.
+
+        * fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt:
+        * fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning-expected.txt:
+        Renamed from fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt.
+        * fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html:
+        Renamed from fast/css-grid-layout/grid-content-alignment-and-self-alignment.html.
+        * fast/css-grid-layout/grid-content-alignment-and-self-alignment.html:
+
</ins><span class="cx"> 2016-04-28  Daniel Bates  &lt;dabates@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Skip test LayoutTests/media/video-with-file-url-allowed-by-csp-media-src-star-with-AllowContentSecurityPolicySourceStarToMatchAnyProtocol-enabled.html
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmentexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt (200180 => 200181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt        2016-04-28 08:03:24 UTC (rev 200180)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt        2016-04-28 08:54:33 UTC (rev 200181)
</span><span class="lines">@@ -1,50 +1,170 @@
</span><del>-This test checks that Content Distribution alignment works fine in combination with Self Alignmet and items span more than one track.
</del><ins>+This test checks that Content Distribution alignment works fine in combination with Self Alignmet and items in just one cell.
</ins><span class="cx"> 
</span><span class="cx"> direction: LTR | distribution: 'space-between' | self-alignment: center
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: LTR | distribution: 'space-between' | self-alignment: end
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: LTR | distribution: 'space-around' | self-alignment: center
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: LTR | distribution: 'space-around' | self-alignment: end
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: LTR | distribution: 'space-evenly' | self-alignment: center
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: LTR | distribution: 'space-evenly' | self-alignment: end
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><del>-direction: LTR | distribution: 'stretch' | self-alignment: center
</del><ins>+direction: LTR | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: center
</ins><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><del>-direction: LTR | distribution: 'stretch' | self-alignment: end
</del><ins>+direction: LTR | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: end
</ins><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><ins>+direction: LTR | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: center
+
+X
+X
+X
+X
+PASS
+direction: LTR | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: end
+
+X
+X
+X
+X
+PASS
+direction: LTR | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: center
+
+X
+X
+X
+X
+PASS
+direction: LTR | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: end
+
+X
+X
+X
+X
+PASS
</ins><span class="cx"> direction: RTL | distribution: 'space-between' | self-alignment: center
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: RTL | distribution: 'space-between' | self-alignment: end
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: RTL | distribution: 'space-around' | self-alignment: center
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: RTL | distribution: 'space-around' | self-alignment: end
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: RTL | distribution: 'space-evenly' | self-alignment: center
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><span class="cx"> direction: RTL | distribution: 'space-evenly' | self-alignment: end
</span><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><del>-direction: RTL | distribution: 'stretch' | self-alignment: center
</del><ins>+direction: RTL | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: center
</ins><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><del>-direction: RTL | distribution: 'stretch' | self-alignment: end
</del><ins>+direction: RTL | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: end
</ins><span class="cx"> 
</span><ins>+X
+X
+X
+X
</ins><span class="cx"> PASS
</span><ins>+direction: RTL | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: center
+
+X
+X
+X
+X
+PASS
+direction: RTL | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: end
+
+X
+X
+X
+X
+PASS
+direction: RTL | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: center
+
+X
+X
+X
+X
+PASS
+direction: RTL | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: end
+
+X
+X
+X
+X
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmentspanningexpectedtxtfromrev200180trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmentexpectedtxt"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning-expected.txt (from rev 200180, trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-expected.txt) (0 => 200181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning-expected.txt        2016-04-28 08:54:33 UTC (rev 200181)
</span><span class="lines">@@ -0,0 +1,50 @@
</span><ins>+This test checks that Content Distribution alignment works fine in combination with Self Alignmet and items span more than one track.
+
+direction: LTR | distribution: 'space-between' | self-alignment: center
+
+PASS
+direction: LTR | distribution: 'space-between' | self-alignment: end
+
+PASS
+direction: LTR | distribution: 'space-around' | self-alignment: center
+
+PASS
+direction: LTR | distribution: 'space-around' | self-alignment: end
+
+PASS
+direction: LTR | distribution: 'space-evenly' | self-alignment: center
+
+PASS
+direction: LTR | distribution: 'space-evenly' | self-alignment: end
+
+PASS
+direction: LTR | distribution: 'stretch' | self-alignment: center
+
+PASS
+direction: LTR | distribution: 'stretch' | self-alignment: end
+
+PASS
+direction: RTL | distribution: 'space-between' | self-alignment: center
+
+PASS
+direction: RTL | distribution: 'space-between' | self-alignment: end
+
+PASS
+direction: RTL | distribution: 'space-around' | self-alignment: center
+
+PASS
+direction: RTL | distribution: 'space-around' | self-alignment: end
+
+PASS
+direction: RTL | distribution: 'space-evenly' | self-alignment: center
+
+PASS
+direction: RTL | distribution: 'space-evenly' | self-alignment: end
+
+PASS
+direction: RTL | distribution: 'stretch' | self-alignment: center
+
+PASS
+direction: RTL | distribution: 'stretch' | self-alignment: end
+
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmentspanninghtmlfromrev200180trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmenthtml"></a>
<div class="copfile"><h4>Copied: trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html (from rev 200180, trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment.html) (0 => 200181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html        2016-04-28 08:54:33 UTC (rev 200181)
</span><span class="lines">@@ -0,0 +1,215 @@
</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;link href=&quot;resources/grid-alignment.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: 0px;
+}
+
+.grid {
+    -webkit-grid-auto-columns: 20px;
+    -webkit-grid-auto-rows: 40px;
+    -webkit-grid-template-areas: &quot;a a b&quot;
+                                 &quot;c d b&quot;;
+    position: relative;
+    width: 300px;
+    height: 200px;
+}
+.a {
+    -webkit-grid-area: a;
+    background-color: blue;
+}
+.b {
+    -webkit-grid-area: b;
+    background-color: lime;
+}
+.c {
+    -webkit-grid-area: c;
+    background-color: purple;
+}
+.d {
+    -webkit-grid-area: d;
+    background-color: orange;
+}
+.stretchedGrid {
+    -webkit-grid-auto-columns: minmax(20px, auto);
+    -webkit-grid-auto-rows: minmax(40px, auto);
+}
+
+
+.cell {
+    width: 20px;
+    height: 40px;
+}
+&lt;/style&gt;
+&lt;/head&gt;
+&lt;body onload=&quot;checkLayout('.grid')&quot;&gt;
+
+&lt;p&gt;This test checks that Content Distribution alignment works fine in combination with Self Alignmet and items span more than one track.&lt;/p&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: LTR | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceBetween&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;70&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;b cell alignSelfCenter&quot; data-offset-x=&quot;280&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;c&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: LTR | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceBetween&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&quot; data-offset-x=&quot;280&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;c&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: LTR | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceAround&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;90&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell alignSelfCenter&quot; data-offset-x=&quot;240&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;c&quot; data-offset-x=&quot;40&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&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;p&gt;direction: LTR | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceAround&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell alignSelfEnd&quot; data-offset-x=&quot;240&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;c&quot; data-offset-x=&quot;40&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&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;p&gt;direction: LTR | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceEvenly&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;100&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;b cell alignSelfCenter&quot; data-offset-x=&quot;220&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;c&quot; data-offset-x=&quot;60&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: LTR | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceEvenly&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&quot; data-offset-x=&quot;220&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;c&quot; data-offset-x=&quot;60&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: LTR | distribution: 'stretch' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid stretchedGrid contentStretch&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;90&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;240&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;c&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: LTR | distribution: 'stretch' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid stretchedGrid contentStretch&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd alignSelfEnd&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;60&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell justifySelfEnd alignSelfEnd&quot; data-offset-x=&quot;280&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;c&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;!-- RTL direction. --&gt;
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: RTL | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceBetween directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;210&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;b cell alignSelfCenter&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;c&quot; data-offset-x=&quot;280&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: RTL | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceBetween directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&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;c&quot; data-offset-x=&quot;280&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: RTL | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceAround directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;190&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell alignSelfCenter&quot; data-offset-x=&quot;40&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;c&quot; data-offset-x=&quot;240&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&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;p&gt;direction: RTL | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceAround directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell alignSelfEnd&quot; data-offset-x=&quot;40&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;c&quot; data-offset-x=&quot;240&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&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;p&gt;direction: RTL | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceEvenly directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;180&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;b cell alignSelfCenter&quot; data-offset-x=&quot;60&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;c&quot; data-offset-x=&quot;220&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: RTL | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid contentSpaceEvenly directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&quot; data-offset-x=&quot;60&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;c&quot; data-offset-x=&quot;220&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;d&quot; data-offset-x=&quot;140&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&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: RTL | distribution: 'stretch' | self-alignment: center&lt;/p&gt;
+    &lt;div class=&quot;grid stretchedGrid contentStretch directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;190&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;40&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;c&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div style=&quot;position: relative&quot;&gt;
+    &lt;p&gt;direction: RTL | distribution: 'stretch' | self-alignment: end&lt;/p&gt;
+    &lt;div class=&quot;grid stretchedGrid contentStretch directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
+        &lt;div class=&quot;a cell justifySelfEnd alignSelfEnd&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;60&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;b cell justifySelfEnd alignSelfEnd&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;c&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
+    &lt;/div&gt;
+&lt;/div&gt;
+
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridcontentalignmentandselfalignmenthtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment.html (200180 => 200181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment.html        2016-04-28 08:03:24 UTC (rev 200180)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-content-alignment-and-self-alignment.html        2016-04-28 08:54:33 UTC (rev 200181)
</span><span class="lines">@@ -1,215 +1,459 @@
</span><span class="cx"> &lt;!DOCTYPE html&gt;
</span><del>-&lt;html&gt;
-&lt;head&gt;
</del><span class="cx"> &lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
</span><span class="cx"> &lt;link href=&quot;resources/grid-alignment.css&quot; rel=&quot;stylesheet&quot;&gt;
</span><del>-&lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
</del><span class="cx"> &lt;style&gt;
</span><del>-body {
-    margin: 0px;
-}
</del><span class="cx"> 
</span><span class="cx"> .grid {
</span><del>-    -webkit-grid-auto-columns: 20px;
-    -webkit-grid-auto-rows: 40px;
-    -webkit-grid-template-areas: &quot;a a b&quot;
-                                 &quot;c d b&quot;;
</del><ins>+    -webkit-grid-template-columns: 200px 100px;
+    -webkit-grid-template-rows: 100px 50px;
+    width: 500px;
+    height: 350px;
</ins><span class="cx">     position: relative;
</span><del>-    width: 300px;
-    height: 200px;
</del><ins>+    font: 10px/1 Ahem;
</ins><span class="cx"> }
</span><del>-.a {
-    -webkit-grid-area: a;
-    background-color: blue;
</del><ins>+
+.gridGaps {
+    -webkit-grid-gap: 10px 20px;
</ins><span class="cx"> }
</span><del>-.b {
-    -webkit-grid-area: b;
-    background-color: lime;
-}
-.c {
-    -webkit-grid-area: c;
-    background-color: purple;
-}
-.d {
-    -webkit-grid-area: d;
-    background-color: orange;
-}
-.stretchedGrid {
-    -webkit-grid-auto-columns: minmax(20px, auto);
-    -webkit-grid-auto-rows: minmax(40px, auto);
-}
</del><span class="cx"> 
</span><del>-
-.cell {
-    width: 20px;
-    height: 40px;
-}
</del><span class="cx"> &lt;/style&gt;
</span><del>-&lt;/head&gt;
</del><ins>+&lt;script src=&quot;../../resources/check-layout.js&quot;&gt;&lt;/script&gt;
</ins><span class="cx"> &lt;body onload=&quot;checkLayout('.grid')&quot;&gt;
</span><span class="cx"> 
</span><del>-&lt;p&gt;This test checks that Content Distribution alignment works fine in combination with Self Alignmet and items span more than one track.&lt;/p&gt;
</del><ins>+&lt;p&gt;This test checks that Content Distribution alignment works fine in combination with Self Alignmet and items in just one cell.&lt;/p&gt;
</ins><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceBetween&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;70&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;b cell alignSelfCenter&quot; data-offset-x=&quot;280&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;c&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+&lt;p&gt;direction: LTR | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid contentSpaceBetween itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;95&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;445&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;95&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;445&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceBetween&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&quot; data-offset-x=&quot;280&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;c&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+&lt;p&gt;direction: LTR | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid contentSpaceBetween itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;190&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;490&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;190&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;490&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceAround&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;90&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell alignSelfCenter&quot; data-offset-x=&quot;240&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;c&quot; data-offset-x=&quot;40&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: LTR | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid contentSpaceAround itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;145&quot; data-offset-y=&quot;95&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;395&quot; data-offset-y=&quot;95&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;145&quot; data-offset-y=&quot;270&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;395&quot; data-offset-y=&quot;270&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceAround&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell alignSelfEnd&quot; data-offset-x=&quot;240&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;c&quot; data-offset-x=&quot;40&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: LTR | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid contentSpaceAround itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;240&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;440&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;240&quot; data-offset-y=&quot;290&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;440&quot; data-offset-y=&quot;290&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceEvenly&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;100&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;b cell alignSelfCenter&quot; data-offset-x=&quot;220&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;c&quot; data-offset-x=&quot;60&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+&lt;p&gt;direction: LTR | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid contentSpaceEvenly itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;162&quot; data-offset-y=&quot;112&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;378&quot; data-offset-y=&quot;112&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;162&quot; data-offset-y=&quot;253&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;378&quot; data-offset-y=&quot;253&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceEvenly&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&quot; data-offset-x=&quot;220&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;c&quot; data-offset-x=&quot;60&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+&lt;p&gt;direction: LTR | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid contentSpaceEvenly itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;257&quot; data-offset-y=&quot;157&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;423&quot; data-offset-y=&quot;157&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;257&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;423&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'stretch' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid stretchedGrid contentStretch&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;90&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;240&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;c&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: LTR | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid gridGaps contentSpaceBetween itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;95&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;445&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;95&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;445&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: LTR | distribution: 'stretch' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid stretchedGrid contentStretch&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd alignSelfEnd&quot; data-offset-x=&quot;180&quot; data-offset-y=&quot;60&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell justifySelfEnd alignSelfEnd&quot; data-offset-x=&quot;280&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;c&quot; data-offset-x=&quot;0&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: LTR | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid gridGaps contentSpaceBetween itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;190&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;490&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;190&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;490&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;p&gt;direction: LTR | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid gridGaps contentSpaceAround itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;140&quot; data-offset-y=&quot;93&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;400&quot; data-offset-y=&quot;93&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;140&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;400&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;p&gt;direction: LTR | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid gridGaps contentSpaceAround itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;235&quot; data-offset-y=&quot;138&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;445&quot; data-offset-y=&quot;138&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;235&quot; data-offset-y=&quot;293&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;445&quot; data-offset-y=&quot;293&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;p&gt;direction: LTR | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid gridGaps contentSpaceEvenly itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;155&quot; data-offset-y=&quot;108&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;385&quot; data-offset-y=&quot;108&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;155&quot; data-offset-y=&quot;257&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;385&quot; data-offset-y=&quot;257&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;p&gt;direction: LTR | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid gridGaps contentSpaceEvenly itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;250&quot; data-offset-y=&quot;153&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;430&quot; data-offset-y=&quot;153&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;250&quot; data-offset-y=&quot;277&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;430&quot; data-offset-y=&quot;277&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;!-- RTL direction. --&gt;
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceBetween directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;210&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;b cell alignSelfCenter&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;c&quot; data-offset-x=&quot;280&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+
+&lt;p&gt;direction: RTL | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL contentSpaceBetween itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;395&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;45&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;395&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;45&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceBetween directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&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;c&quot; data-offset-x=&quot;280&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+&lt;p&gt;direction: RTL | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL contentSpaceBetween itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;300&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;300&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceAround directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;190&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell alignSelfCenter&quot; data-offset-x=&quot;40&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;c&quot; data-offset-x=&quot;240&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: RTL | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL contentSpaceAround itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;345&quot; data-offset-y=&quot;95&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;95&quot; data-offset-y=&quot;95&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;345&quot; data-offset-y=&quot;270&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;95&quot; data-offset-y=&quot;270&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceAround directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell alignSelfEnd&quot; data-offset-x=&quot;40&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;c&quot; data-offset-x=&quot;240&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;140&quot; data-offset-y=&quot;130&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: RTL | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL contentSpaceAround itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;250&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;50&quot; data-offset-y=&quot;140&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;250&quot; data-offset-y=&quot;290&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;50&quot; data-offset-y=&quot;290&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceEvenly directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter&quot; data-offset-x=&quot;180&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;b cell alignSelfCenter&quot; data-offset-x=&quot;60&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;c&quot; data-offset-x=&quot;220&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+&lt;p&gt;direction: RTL | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL contentSpaceEvenly itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;328&quot; data-offset-y=&quot;112&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;112&quot; data-offset-y=&quot;112&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;328&quot; data-offset-y=&quot;253&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;112&quot; data-offset-y=&quot;253&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid contentSpaceEvenly directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd&quot; data-offset-x=&quot;140&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;b cell alignSelfEnd&quot; data-offset-x=&quot;60&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;c&quot; data-offset-x=&quot;220&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;d&quot; data-offset-x=&quot;140&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&gt;
</del><ins>+&lt;p&gt;direction: RTL | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL contentSpaceEvenly itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;233&quot; data-offset-y=&quot;157&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;67&quot; data-offset-y=&quot;157&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;233&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;67&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'stretch' | self-alignment: center&lt;/p&gt;
-    &lt;div class=&quot;grid stretchedGrid contentStretch directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;190&quot; data-offset-y=&quot;30&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell justifySelfCenter alignSelfCenter&quot; data-offset-x=&quot;40&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;c&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: RTL | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL gridGaps contentSpaceBetween itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;395&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;45&quot; data-offset-y=&quot;45&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;395&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;45&quot; data-offset-y=&quot;320&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><del>-&lt;div style=&quot;position: relative&quot;&gt;
-    &lt;p&gt;direction: RTL | distribution: 'stretch' | self-alignment: end&lt;/p&gt;
-    &lt;div class=&quot;grid stretchedGrid contentStretch directionRTL&quot; data-expected-width=&quot;300&quot; data-expected-height=&quot;200&quot;&gt;
-        &lt;div class=&quot;a cell justifySelfEnd alignSelfEnd&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;60&quot; data-expected-width=&quot;20&quot; data-expected-height=&quot;40&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;b cell justifySelfEnd alignSelfEnd&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;c&quot; data-offset-x=&quot;200&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-        &lt;div class=&quot;d&quot; data-offset-x=&quot;100&quot; data-offset-y=&quot;100&quot; data-expected-width=&quot;100&quot; data-expected-height=&quot;100&quot;&gt;&lt;/div&gt;
-    &lt;/div&gt;
</del><ins>+&lt;p&gt;direction: RTL | grid-gap: 10px 20px | distribution: 'space-between' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL gridGaps contentSpaceBetween itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;300&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;90&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;300&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;0&quot; data-offset-y=&quot;340&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
</ins><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;p&gt;direction: RTL | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL gridGaps contentSpaceAround itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;350&quot; data-offset-y=&quot;93&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;90&quot; data-offset-y=&quot;93&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;350&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;90&quot; data-offset-y=&quot;273&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;p&gt;direction: RTL | grid-gap: 10px 20px | distribution: 'space-around' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL gridGaps contentSpaceAround itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;255&quot; data-offset-y=&quot;138&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;45&quot; data-offset-y=&quot;138&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;255&quot; data-offset-y=&quot;293&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;45&quot; data-offset-y=&quot;293&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;p&gt;direction: RTL | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: center&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL gridGaps contentSpaceEvenly itemsCenter&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;335&quot; data-offset-y=&quot;108&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;105&quot; data-offset-y=&quot;108&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;335&quot; data-offset-y=&quot;257&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;105&quot; data-offset-y=&quot;257&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;p&gt;direction: RTL | grid-gap: 10px 20px | distribution: 'space-evenly' | self-alignment: end&lt;/p&gt;
+&lt;div class=&quot;grid directionRTL gridGaps contentSpaceEvenly itemsEnd&quot;&gt;
+    &lt;!-- Dummy DIVs to help checking the result visually. --&gt;
+    &lt;div class=&quot;firstRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn justifySelfStretch alignSelfStretch&quot;&gt;&lt;/div&gt;
+
+    &lt;div class=&quot;firstRowFirstColumn&quot;
+        data-offset-x=&quot;240&quot; data-offset-y=&quot;153&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;firstRowSecondColumn&quot;
+        data-offset-x=&quot;60&quot; data-offset-y=&quot;153&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowFirstColumn&quot;
+        data-offset-x=&quot;240&quot; data-offset-y=&quot;277&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+    &lt;div class=&quot;secondRowSecondColumn&quot;
+        data-offset-x=&quot;60&quot; data-offset-y=&quot;277&quot; data-expected-width=&quot;10&quot; data-expected-height=&quot;10&quot;&gt;X&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span><del>-&lt;/html&gt;
</del></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (200180 => 200181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-28 08:03:24 UTC (rev 200180)
+++ trunk/Source/WebCore/ChangeLog        2016-04-28 08:54:33 UTC (rev 200181)
</span><span class="lines">@@ -1,3 +1,22 @@
</span><ins>+2016-04-28  Manuel Rego Casasnovas  &lt;rego@igalia.com&gt;
+
+        [css-grid] Fix alignment with content distribution
+        https://bugs.webkit.org/show_bug.cgi?id=156623
+
+        Reviewed by Sergio Villar Senin.
+
+        We were only subtracting the distribution offset for items spanning
+        several tracks, but not for items in a single cell.
+        We should actually subtract the offset in that situation too,
+        the same that we do for the grid gaps.
+
+        Test: fast/css-grid-layout/grid-content-alignment-and-self-alignment-spanning.html
+
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::columnAxisOffsetForChild): Subtract distribution
+        offset like we do for gaps.
+        (WebCore::RenderGrid::rowAxisOffsetForChild): Ditto.
+
</ins><span class="cx"> 2016-04-27  Carlos Garcia Campos  &lt;cgarcia@igalia.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [GTK] Overlay scrollbars with steppers enabled render incorrectly
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (200180 => 200181)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-04-28 08:03:24 UTC (rev 200180)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-04-28 08:54:33 UTC (rev 200181)
</span><span class="lines">@@ -1936,14 +1936,12 @@
</span><span class="cx">     case GridAxisCenter: {
</span><span class="cx">         unsigned childEndLine = rowsSpan.endLine();
</span><span class="cx">         LayoutUnit endOfRow = m_rowPositions[childEndLine];
</span><del>-        // m_rowPositions include gutters so we need to substract them to get the actual end position for a given
-        // row (this does not have to be done for the last track as there are no more m_rowPositions after it)
</del><ins>+        // m_rowPositions include distribution offset (because of content alignment) and gutters
+        // so we need to subtract them to get the actual end position for a given row
+        // (this does not have to be done for the last track as there are no more m_rowPositions after it).
</ins><span class="cx">         if (childEndLine &lt; m_rowPositions.size() - 1)
</span><del>-            endOfRow -= guttersSize(ForRows, 2);
</del><ins>+            endOfRow -= guttersSize(ForRows, 2) + m_offsetBetweenRows;
</ins><span class="cx">         LayoutUnit childBreadth = child.logicalHeight() + child.marginLogicalHeight();
</span><del>-        // In order to properly adjust the Self Alignment values we need to consider the offset between tracks.
-        if (childEndLine - childStartLine &gt; 1 &amp;&amp; childEndLine &lt; m_rowPositions.size() - 1)
-            endOfRow -= m_offsetBetweenRows;
</del><span class="cx">         LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveAlignmentOverflow(style(), child.style()), endOfRow - startOfRow, childBreadth);
</span><span class="cx">         return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPosition : offsetFromStartPosition / 2);
</span><span class="cx">     }
</span><span class="lines">@@ -1970,14 +1968,12 @@
</span><span class="cx">     case GridAxisCenter: {
</span><span class="cx">         unsigned childEndLine = columnsSpan.endLine();
</span><span class="cx">         LayoutUnit endOfColumn = m_columnPositions[childEndLine];
</span><del>-        // m_columnPositions include gutters so we need to substract them to get the actual end position for a given
-        // column (this does not have to be done for the last track as there are no more m_columnPositions after it)
</del><ins>+        // m_columnPositions include distribution offset (because of content alignment) and gutters
+        // so we need to subtract them to get the actual end position for a given column
+        // (this does not have to be done for the last track as there are no more m_columnPositions after it).
</ins><span class="cx">         if (childEndLine &lt; m_columnPositions.size() - 1)
</span><del>-            endOfColumn -= guttersSize(ForColumns, 2);
</del><ins>+            endOfColumn -= guttersSize(ForColumns, 2) + m_offsetBetweenColumns;
</ins><span class="cx">         LayoutUnit childBreadth = child.logicalWidth() + child.marginLogicalWidth();
</span><del>-        // In order to properly adjust the Self Alignment values we need to consider the offset between tracks.
-        if (childEndLine - childStartLine &gt; 1 &amp;&amp; childEndLine &lt; m_columnPositions.size() - 1)
-            endOfColumn -= m_offsetBetweenColumns;
</del><span class="cx">         LayoutUnit offsetFromStartPosition = computeOverflowAlignmentOffset(RenderStyle::resolveJustificationOverflow(style(), child.style()), endOfColumn - startOfColumn, childBreadth);
</span><span class="cx">         return startPosition + (axisPosition == GridAxisEnd ? offsetFromStartPosition : offsetFromStartPosition / 2);
</span><span class="cx">     }
</span></span></pre>
</div>
</div>

</body>
</html>