<!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>[203717] 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/203717">203717</a></dd>
<dt>Author</dt> <dd>svillar@igalia.com</dd>
<dt>Date</dt> <dd>2016-07-26 04:08:28 -0700 (Tue, 26 Jul 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] repeat() syntax should take a &lt;track-list&gt; argument
https://bugs.webkit.org/show_bug.cgi?id=160162

Reviewed by Darin Adler.

Source/WebCore:

The repeat() notation used to allow just 1 &lt;track-size&gt; as second argument. Specs have been
recently modified so that a &lt;track-list&gt; is now supported, meaning that we can pass an
arbitrary number of track sizes and line numbers.

It has been working for some time for repeat() if the first argument was a positive integer,
but it requires some changes for the auto repeat cases (auto-fill and auto-fit).

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector): Store the total number of
auto repeat tracks and the length of a single repetition instead of the number of
repetitions.
(WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex): Do not assume that there is
only 1 repeat track.
(WebCore::valueForGridTrackList):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseGridTrackRepeatFunction): Allow multiple tracks in repeat().
* rendering/RenderGrid.cpp:
(WebCore::RenderGrid::rawGridTrackSize): Renamed repetitions -&gt; autoRepeatTracksCount.
(WebCore::RenderGrid::computeAutoRepeatTracksCount): Use all the repeat tracks to compute
the total track size of a single repetition.
(WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
* rendering/style/GridPositionsResolver.cpp:
(WebCore::NamedLineCollection::NamedLineCollection): Renamed m_repetitions -&gt;
m_autoRepeatTotalTracks. Added m_autoRepeatTrackListLength (it was always 1 before).
(WebCore::NamedLineCollection::find): Resolve lines inside multiple repeat tracks.
(WebCore::NamedLineCollection::firstPosition): Ditto.
* rendering/style/GridPositionsResolver.h:

LayoutTests:

Added new test cases with multiple tracks inside repeat() notation, both for fixed an
automatic (auto-fill &amp; auto-fit) repetitions.

* fast/css-grid-layout/grid-auto-fill-columns-expected.txt:
* fast/css-grid-layout/grid-auto-fill-columns.html:
* fast/css-grid-layout/grid-auto-fill-rows-expected.txt:
* fast/css-grid-layout/grid-auto-fill-rows.html:
* fast/css-grid-layout/grid-auto-fit-columns-expected.txt:
* fast/css-grid-layout/grid-auto-fit-columns.html:
* fast/css-grid-layout/grid-auto-fit-rows-expected.txt:
* fast/css-grid-layout/grid-auto-fit-rows.html:
* fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt:
* fast/css-grid-layout/grid-element-auto-repeat-get-set.html:
* fast/css-grid-layout/grid-element-repeat-get-set-expected.txt:
* fast/css-grid-layout/grid-element-repeat-get-set.html:</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofillcolumnsexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofillcolumnshtml">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofillrowsexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofillrowshtml">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofitcolumnsexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofitcolumnshtml">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofitrowsexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridautofitrowshtml">trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridelementautorepeatgetsetexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridelementautorepeatgetsethtml">trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridelementrepeatgetsetexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridelementrepeatgetsethtml">trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set.html</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCorecssCSSComputedStyleDeclarationcpp">trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingRenderGridcpp">trunk/Source/WebCore/rendering/RenderGrid.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleGridPositionsResolvercpp">trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp</a></li>
<li><a href="#trunkSourceWebCorerenderingstyleGridPositionsResolverh">trunk/Source/WebCore/rendering/style/GridPositionsResolver.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/ChangeLog        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -1,5 +1,28 @@
</span><span class="cx"> 2016-07-25  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [css-grid] repeat() syntax should take a &lt;track-list&gt; argument
+        https://bugs.webkit.org/show_bug.cgi?id=160162
+
+        Reviewed by Darin Adler.
+
+        Added new test cases with multiple tracks inside repeat() notation, both for fixed an
+        automatic (auto-fill &amp; auto-fit) repetitions.
+
+        * fast/css-grid-layout/grid-auto-fill-columns-expected.txt:
+        * fast/css-grid-layout/grid-auto-fill-columns.html:
+        * fast/css-grid-layout/grid-auto-fill-rows-expected.txt:
+        * fast/css-grid-layout/grid-auto-fill-rows.html:
+        * fast/css-grid-layout/grid-auto-fit-columns-expected.txt:
+        * fast/css-grid-layout/grid-auto-fit-columns.html:
+        * fast/css-grid-layout/grid-auto-fit-rows-expected.txt:
+        * fast/css-grid-layout/grid-auto-fit-rows.html:
+        * fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt:
+        * fast/css-grid-layout/grid-element-auto-repeat-get-set.html:
+        * fast/css-grid-layout/grid-element-repeat-get-set-expected.txt:
+        * fast/css-grid-layout/grid-element-repeat-get-set.html:
+
+2016-07-25  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
+
</ins><span class="cx">         [css-grid] grid-auto-flow|row should take a &lt;track-size&gt;+
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160158
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofillcolumnsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns-expected.txt (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns-expected.txt        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns-expected.txt        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -27,3 +27,5 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofillcolumnshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns.html (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns.html        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-columns.html        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -17,6 +17,7 @@
</span><span class="cx"> .gridAutoRepeatAndFixedAfter { grid-template-columns: repeat(auto-fill, [first] 30px [last]) [foo] minmax(60px, 80px) [bar] minmax(45px, -webkit-max-content); }
</span><span class="cx"> .gridAutoRepeatAndFixed { grid-template-columns: [start] repeat(2, 50px [a]) [middle] repeat(auto-fill, [autofoo] 15px [autobar]) minmax(5%, 10%) [end]; }
</span><span class="cx"> .gridMultipleNames { grid-template-columns: [start] 20px [foo] 50% repeat(auto-fill, [bar] 20px [start foo]) [foo] 10% [end bar]; }
</span><ins>+.gridMultipleTracks { grid-template-columns: [start] 20px repeat(auto-fill, [a] 2em [b c] 10% [d]) [e] minmax(75px, 1fr) [last]; }
</ins><span class="cx"> 
</span><span class="cx"> .item { background-color: cyan; }
</span><span class="cx"> 
</span><span class="lines">@@ -138,4 +139,14 @@
</span><span class="cx">     &lt;div class=&quot;item&quot; style=&quot;grid-column: foo / bar 2&quot;  data-offset-x=&quot;40&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;180&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;grid gridMultipleTracks&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-column: a / 2 c&quot;  data-offset-x=&quot;20&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;84&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-column: 3 / e; grid-row: 2;&quot;  data-offset-x=&quot;52&quot; data-offset-y=&quot;25&quot; data-expected-width=&quot;72&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid gridMultipleTracks gap&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-column: a / c&quot;  data-offset-x=&quot;40&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;32&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-column: 3 / last; grid-row: 2;&quot;  data-offset-x=&quot;92&quot; data-offset-y=&quot;25&quot; data-expected-width=&quot;115&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofillrowsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows-expected.txt (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows-expected.txt        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows-expected.txt        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -27,3 +27,5 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofillrowshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows.html (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows.html        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fill-rows.html        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -21,6 +21,7 @@
</span><span class="cx"> .gridAutoRepeatAndFixedAfter { grid-template-rows: repeat(auto-fill, [first] 30px [last]) [foo] minmax(60px, 80px) [bar] minmax(45px, -webkit-max-content); }
</span><span class="cx"> .gridAutoRepeatAndFixed { grid-template-rows: [start] repeat(2, 50px [a]) [middle] repeat(auto-fill, [autofoo] 15px [autobar]) minmax(5%, 10%) [end]; }
</span><span class="cx"> .gridMultipleNames { grid-template-rows: [start] 20px [foo] 50% repeat(auto-fill, [bar] 20px [start foo]) [foo] 10% [end bar]; }
</span><ins>+.gridMultipleTracks { grid-template-rows: [start] 20px repeat(auto-fill, [a] 2em [b c] 10% [d]) [e] minmax(75px, 1fr) [last]; }
</ins><span class="cx"> 
</span><span class="cx"> .item { background-color: cyan; }
</span><span class="cx"> 
</span><span class="lines">@@ -142,4 +143,14 @@
</span><span class="cx">     &lt;div class=&quot;item&quot; style=&quot;grid-row: foo / bar 2&quot;  data-offset-y=&quot;40&quot; data-offset-x=&quot;0&quot; data-expected-height=&quot;180&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;grid gridMultipleTracks&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-row: a / 2 c&quot;  data-offset-y=&quot;20&quot; data-offset-x=&quot;0&quot; data-expected-height=&quot;84&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-row: 3 / e; grid-column: 2;&quot;  data-offset-y=&quot;52&quot; data-offset-x=&quot;25&quot; data-expected-height=&quot;72&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid gridMultipleTracks gap&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-row: a / c&quot;  data-offset-y=&quot;40&quot; data-offset-x=&quot;0&quot; data-expected-height=&quot;32&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-row: 3 / last; grid-column: 2;&quot;  data-offset-y=&quot;92&quot; data-offset-x=&quot;25&quot; data-expected-height=&quot;115&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofitcolumnsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns-expected.txt (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns-expected.txt        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns-expected.txt        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -27,3 +27,5 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofitcolumnshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns.html (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns.html        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-columns.html        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -17,8 +17,10 @@
</span><span class="cx"> .gridAutoRepeatAndFixedAfter { grid-template-columns: repeat(auto-fit, [first] 30px [last]) [foo] minmax(60px, 80px) [bar] minmax(45px, -webkit-max-content); }
</span><span class="cx"> .gridAutoRepeatAndFixed { grid-template-columns: [start] repeat(2, 50px [a]) [middle] repeat(auto-fit, [autofoo] 15px [autobar]) minmax(5%, 10%) [end]; }
</span><span class="cx"> .gridMultipleNames { grid-template-columns: [start] 20px [foo] 50% repeat(auto-fit, [bar] 20px [start foo]) [foo] 10% [end bar]; }
</span><ins>+.gridMultipleTracks { grid-template-columns: [start] 20px repeat(auto-fit, [a] 2em [b c] 10% [d]) [e] minmax(75px, 1fr) [last]; }
</ins><span class="cx"> 
</span><span class="cx"> .item { background-color: cyan; }
</span><ins>+.item:nth-child(2n) { background-color: green; }
</ins><span class="cx"> 
</span><span class="cx"> .gap { grid-column-gap: 20px; }
</span><span class="cx"> 
</span><span class="lines">@@ -139,4 +141,13 @@
</span><span class="cx">     &lt;div class=&quot;item&quot; style=&quot;grid-column: foo / bar 2&quot;  data-offset-x=&quot;40&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;180&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;grid gridMultipleTracks&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-column: e / last;&quot;  data-offset-x=&quot;52&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;148&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-column: start / b;&quot;  data-offset-x=&quot;0&quot; data-offset-y=&quot;25&quot; data-expected-width=&quot;52&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid gridMultipleTracks gap&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-column: c / -1;&quot;  data-offset-x=&quot;40&quot; data-offset-y=&quot;0&quot; data-expected-width=&quot;160&quot; data-expected-height=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofitrowsexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows-expected.txt (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows-expected.txt        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows-expected.txt        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -27,3 +27,5 @@
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><span class="cx"> PASS
</span><ins>+PASS
+PASS
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridautofitrowshtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows.html (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows.html        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-auto-fit-rows.html        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -21,8 +21,10 @@
</span><span class="cx"> .gridAutoRepeatAndFixedAfter { grid-template-rows: repeat(auto-fit, [first] 30px [last]) [foo] minmax(60px, 80px) [bar] minmax(45px, -webkit-max-content); }
</span><span class="cx"> .gridAutoRepeatAndFixed { grid-template-rows: [start] repeat(2, 50px [a]) [middle] repeat(auto-fit, [autofoo] 15px [autobar]) minmax(5%, 10%) [end]; }
</span><span class="cx"> .gridMultipleNames { grid-template-rows: [start] 20px [foo] 50% repeat(auto-fit, [bar] 20px [start foo]) [foo] 10% [end bar]; }
</span><ins>+.gridMultipleTracks { grid-template-rows: [start] 20px repeat(auto-fit, [a] 2em [b c] 10% [d]) [e] minmax(75px, 1fr) [last]; }
</ins><span class="cx"> 
</span><span class="cx"> .item { background-color: cyan; }
</span><ins>+.item:nth-child(2n) { background-color: green; }
</ins><span class="cx"> 
</span><span class="cx"> .gap { grid-row-gap: 20px; }
</span><span class="cx"> 
</span><span class="lines">@@ -143,4 +145,13 @@
</span><span class="cx">     &lt;div class=&quot;item&quot; style=&quot;grid-row: foo / bar 2&quot;  data-offset-y=&quot;40&quot; data-offset-x=&quot;0&quot; data-expected-height=&quot;180&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> 
</span><ins>+&lt;div class=&quot;grid gridMultipleTracks&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-row: e / last;&quot;  data-offset-y=&quot;52&quot; data-offset-x=&quot;0&quot; data-expected-height=&quot;148&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-row: start / b;&quot;  data-offset-y=&quot;0&quot; data-offset-x=&quot;0&quot; data-expected-height=&quot;52&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
+&lt;div class=&quot;grid gridMultipleTracks gap&quot;&gt;
+    &lt;div class=&quot;item&quot; style=&quot;grid-row: c / -1;&quot;  data-offset-y=&quot;40&quot; data-offset-x=&quot;0&quot; data-expected-height=&quot;160&quot; data-expected-width=&quot;25&quot;&gt;&lt;/div&gt;
+&lt;/div&gt;
+
</ins><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementautorepeatgetsetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -24,6 +24,10 @@
</span><span class="cx"> PASS element.style.gridTemplateColumns is &quot;repeat(auto-fit, [foo bar] 150px)&quot;
</span><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is &quot;0px [foo bar] 0px [foo bar]&quot;
</span><span class="cx"> PASS element.style.gridTemplateRows is &quot;repeat(auto-fit, 24em [foo bar])&quot;
</span><ins>+PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;[start] 200px 100px [end start] 200px 100px [end]&quot;
+PASS element.style.gridTemplateColumns is &quot;repeat(auto-fill, [start] 200px 100px [end])&quot;
+PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is &quot;100px [foo a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c bar] 30px&quot;
+PASS element.style.gridTemplateRows is &quot;100px [foo] repeat(auto-fill, [a] 2em [b] 10% [c]) [bar] 3em&quot;
</ins><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;[foo bar] 0px [foo bar] 0px&quot;
</span><span class="cx"> PASS element.style.gridTemplateColumns is &quot;repeat(auto-fit, [foo bar] minmax(270px, 1fr))&quot;
</span><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is &quot;[foo] 0px [bar foo] 0px [bar foo] 0px [bar]&quot;
</span><span class="lines">@@ -40,6 +44,10 @@
</span><span class="cx"> PASS element.style.gridTemplateColumns is &quot;[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c] 20px [e]&quot;
</span><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is &quot;[a b] 30px [c d] 20px [e z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y]&quot;
</span><span class="cx"> PASS element.style.gridTemplateRows is &quot;[a b] 30px [c d] 20px [e] repeat(auto-fit, [z] 100px [y])&quot;
</span><ins>+PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;[start] 0px 0px [end start] 0px 0px [end]&quot;
+PASS element.style.gridTemplateColumns is &quot;repeat(auto-fit, [start] 200px 100px [end])&quot;
+PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is &quot;100px [foo a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c bar] 30px&quot;
+PASS element.style.gridTemplateRows is &quot;100px [foo] repeat(auto-fit, [a] 2em [b] 10% [c]) [bar] 3em&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test invalid repeat syntax.
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;none&quot;
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementautorepeatgetsethtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -16,10 +16,12 @@
</span><span class="cx">     testGridTemplatesSetJSValues(&quot;repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)&quot;, &quot;repeat(1, 450px) repeat(auto-fill, minmax(-webkit-max-content, 5em) [bar]) repeat(2, [foo] 1em)&quot;, &quot;100px 100px 100px 250px 250px&quot;, &quot;450px 50px [bar] 50px [bar foo] 10px [foo] 10px&quot;, &quot;repeat(auto-fill, minmax(50px, 100px)) 250px 250px&quot;, &quot;450px repeat(auto-fill, minmax(-webkit-max-content, 5em) [bar]) [foo] 1em [foo] 1em&quot;);
</span><span class="cx">     testGridTemplatesSetJSValues(&quot;[start] 10% repeat(auto-fill, [foo bar] 200px) [end]&quot;, &quot;75px [prev] repeat(auto-fill, 20em [foo bar]) [next] 15em [last end]&quot;, &quot;[start] 80px [foo bar] 200px [foo bar] 200px [foo bar] 200px [end]&quot;, &quot;75px [prev] 200px [foo bar next] 150px [last end]&quot;);
</span><span class="cx">     testGridTemplatesSetJSValues(&quot;repeat(auto-fit, [foo bar] 150px)&quot;, &quot;repeat(auto-fit, 24em [foo bar])&quot;, &quot;[foo bar] 0px [foo bar] 0px [foo bar] 0px [foo bar] 0px [foo bar] 0px&quot;, &quot;0px [foo bar] 0px [foo bar]&quot;);
</span><ins>+    testGridTemplatesSetJSValues(&quot;repeat(auto-fill, [start] 200px 100px [end])&quot;, &quot;100px [foo] repeat(auto-fill, [a] 2em [b] 10% [c]) [bar] 3em&quot;, &quot;[start] 200px 100px [end start] 200px 100px [end]&quot;, &quot;100px [foo a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c a] 20px [b] 60px [c bar] 30px&quot;);
</ins><span class="cx">     testGridTemplatesSetJSValues(&quot;repeat(auto-fit, [foo bar] minmax(270px, 1fr))&quot;, &quot;repeat(auto-fit, [foo] minmax(20em, -webkit-max-content) [bar])&quot;, &quot;[foo bar] 0px [foo bar] 0px&quot;, &quot;[foo] 0px [bar foo] 0px [bar foo] 0px [bar]&quot;);
</span><span class="cx">     testGridTemplatesSetJSValues(&quot;repeat(auto-fit, minmax(300px, -webkit-min-content)) repeat(2, 20px)&quot;, &quot;repeat(1, 10%) repeat(auto-fit, minmax(30em, -webkit-max-content) [bar]) repeat(2, [foo] 1em)&quot;, &quot;0px 0px 20px 20px&quot;, &quot;60px 0px [bar foo] 10px [foo] 10px&quot;, &quot;repeat(auto-fit, minmax(300px, -webkit-min-content)) 20px 20px&quot;, &quot;10% repeat(auto-fit, minmax(30em, -webkit-max-content) [bar]) [foo] 1em [foo] 1em&quot;);
</span><span class="cx">     testGridTemplatesSetJSValues(&quot;[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c d] 20px [e]&quot;, &quot;repeat(auto-fit, [z] 100px [y]) [a b] 30px [c d] 20px [e]&quot;, &quot;[a z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y b] 30px [c d] 20px [e]&quot;, &quot;[z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y a b] 30px [c d] 20px [e]&quot;);
</span><span class="cx">     testGridTemplatesSetJSValues(&quot;[a] repeat(auto-fit, [z] 100px [y]) repeat(1, [b] 30px [c]) 20px [e]&quot;, &quot;[a b] 30px [c d] 20px [e] repeat(auto-fit, [z] 100px [y])&quot;, &quot;[a z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y b] 30px [c] 20px [e]&quot;, &quot;[a b] 30px [c d] 20px [e z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y]&quot;, &quot;[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c] 20px [e]&quot;);
</span><ins>+    testGridTemplatesSetJSValues(&quot;repeat(auto-fit, [start] 200px 100px [end])&quot;, &quot;100px [foo] repeat(auto-fit, [a] 2em [b] 10% [c]) [bar] 3em&quot;, &quot;[start] 0px 0px [end start] 0px 0px [end]&quot;, &quot;100px [foo a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c a] 0px [b] 0px [c bar] 30px&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;&quot;);
</span><span class="cx">     debug(&quot;Test invalid repeat syntax.&quot;);
</span><span class="lines">@@ -33,14 +35,14 @@
</span><span class="cx"> 
</span><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fill, 1fr)&quot;);
</span><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fill, [bar] auto)&quot;);
</span><del>-    testInvalidSyntax(&quot;repeat(auto-fill, 20px 10px)&quot;);
-    testInvalidSyntax(&quot;repeat(auto-fill, 20px [foo bar] 10px)&quot;);
</del><ins>+    testInvalidSyntax(&quot;repeat(auto-fill, 20px -webkit-min-content)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, auto [foo bar] 10px)&quot;);
</ins><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fill,)&quot;);
</span><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fill, [foo])&quot;);
</span><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fit, 1fr)&quot;);
</span><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fit, [bar] auto)&quot;);
</span><del>-    testInvalidSyntax(&quot;repeat(auto-fit, 20px 10px)&quot;);
-    testInvalidSyntax(&quot;repeat(auto-fit, 20px [foo bar] 10px)&quot;);
</del><ins>+    testInvalidSyntax(&quot;repeat(auto-fit, minmax(20px, 30px) auto)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, -webkit-max-content 2em)&quot;);
</ins><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fit,)&quot;);
</span><span class="cx">     testInvalidSyntax(&quot;repeat(auto-fit, [foo])&quot;);
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementrepeatgetsetexpectedtxt"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set-expected.txt (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set-expected.txt        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set-expected.txt        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -26,6 +26,8 @@
</span><span class="cx"> PASS window.getComputedStyle(mixRepeatAfterNonRepeat, '').getPropertyValue('grid-template-rows') is &quot;44px 10px 10px&quot;
</span><span class="cx"> PASS window.getComputedStyle(mixNonRepeatAfterRepeat, '').getPropertyValue('grid-template-columns') is &quot;250px 250px 120px [last]&quot;
</span><span class="cx"> PASS window.getComputedStyle(mixNonRepeatAfterRepeat, '').getPropertyValue('grid-template-rows') is &quot;10px 10px [end] 0px&quot;
</span><ins>+PASS window.getComputedStyle(multipleTrackRepeat, '').getPropertyValue('grid-template-columns') is &quot;[start] 20px [a] 20px 0px [b a] 20px 0px [b] 200px [c] 0px [end]&quot;
+PASS window.getComputedStyle(multipleTrackRepeat, '').getPropertyValue('grid-template-rows') is &quot;0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d e] 16px&quot;
</ins><span class="cx"> 
</span><span class="cx"> Test invalid repeat syntax.
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;none&quot;
</span><span class="lines">@@ -38,6 +40,8 @@
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;none&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;none&quot;
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;none&quot;
</span><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is &quot;none&quot;
</ins><span class="cx"> PASS successfullyParsed is true
</span><span class="cx"> 
</span><span class="cx"> TEST COMPLETE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementrepeatgetsethtml"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set.html (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set.html        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-repeat-get-set.html        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -68,6 +68,12 @@
</span><span class="cx">     grid-template-rows: repeat(2, 10px) [end] auto;
</span><span class="cx">     grid-template-columns: repeat(2, 250px) 15% [last];
</span><span class="cx"> }
</span><ins>+
+.multipleTrackRepeat {
+    grid-template-rows: repeat(3, -webkit-min-content [a] -webkit-max-content [b c] 20px [d]) [e] 1em;
+    grid-template-columns: [start] 20px repeat(2, [a] minmax(20px, -webkit-min-content) -webkit-max-content [b]) 200px [c] -webkit-min-content [end];
+}
+
</ins><span class="cx"> &lt;/style&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-pre.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/head&gt;
</span><span class="lines">@@ -94,6 +100,7 @@
</span><span class="cx">     &lt;div class=&quot;gridItem&quot;&gt;&lt;/div&gt;
</span><span class="cx"> &lt;/div&gt;
</span><span class="cx"> &lt;div class=&quot;grid definite mixNonRepeatAfterRepeat alignContentStart&quot; id=&quot;mixNonRepeatAfterRepeat&quot;&gt;&lt;/div&gt;
</span><ins>+&lt;div class=&quot;grid multipleTrackRepeat&quot; id=&quot;multipleTrackRepeat&quot;&gt;&lt;/div&gt;
</ins><span class="cx"> 
</span><span class="cx"> &lt;script src=&quot;resources/grid-definitions-parsing-utils.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;script&gt;
</span><span class="lines">@@ -111,6 +118,7 @@
</span><span class="cx">     testGridTemplatesValues(document.getElementById(&quot;leadingNamedGridLineRepeat&quot;), &quot;[start] 250px 250px&quot;, &quot;[start] 10px 10px&quot;);
</span><span class="cx">     testGridTemplatesValues(document.getElementById(&quot;mixRepeatAfterNonRepeat&quot;), &quot;[start] 140px 250px 250px&quot;, &quot;44px 10px 10px&quot;);
</span><span class="cx">     testGridTemplatesValues(document.getElementById(&quot;mixNonRepeatAfterRepeat&quot;), &quot;250px 250px 120px [last]&quot;, &quot;10px 10px [end] 0px&quot;);
</span><ins>+ testGridTemplatesValues(document.getElementById(&quot;multipleTrackRepeat&quot;), &quot;[start] 20px [a] 20px 0px [b a] 20px 0px [b] 200px [c] 0px [end]&quot;, &quot;0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d e] 16px&quot;);
</ins><span class="cx"> 
</span><span class="cx">     debug(&quot;&quot;);
</span><span class="cx">     debug(&quot;Test invalid repeat syntax.&quot;);
</span><span class="lines">@@ -130,8 +138,10 @@
</span><span class="cx">     testInvalidSyntax(&quot;repeat(1, [foo])&quot;);
</span><span class="cx">     testInvalidSyntax(&quot;repeat(1, )&quot;);
</span><span class="cx">     testInvalidSyntax(&quot;repeat(1)&quot;);
</span><ins>+    testInvalidSyntax(&quot;repeat(3, [a] [a] 100px 200px)&quot;);
</ins><span class="cx">     // Nesting is no allowed.
</span><span class="cx">     testInvalidSyntax(&quot;repeat(2, repeat(1, auto))&quot;);
</span><ins>+    testInvalidSyntax(&quot;repeat(2, [a] 100px 200px repeat(2, 20px))&quot;);
</ins><span class="cx"> &lt;/script&gt;
</span><span class="cx"> &lt;script src=&quot;../../resources/js-test-post.js&quot;&gt;&lt;/script&gt;
</span><span class="cx"> &lt;/body&gt;
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/Source/WebCore/ChangeLog        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -1,5 +1,40 @@
</span><span class="cx"> 2016-07-25  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
</span><span class="cx"> 
</span><ins>+        [css-grid] repeat() syntax should take a &lt;track-list&gt; argument
+        https://bugs.webkit.org/show_bug.cgi?id=160162
+
+        Reviewed by Darin Adler.
+
+        The repeat() notation used to allow just 1 &lt;track-size&gt; as second argument. Specs have been
+        recently modified so that a &lt;track-list&gt; is now supported, meaning that we can pass an
+        arbitrary number of track sizes and line numbers.
+
+        It has been working for some time for repeat() if the first argument was a positive integer,
+        but it requires some changes for the auto repeat cases (auto-fill and auto-fit).
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::OrderedNamedLinesCollector::OrderedNamedLinesCollector): Store the total number of
+        auto repeat tracks and the length of a single repetition instead of the number of
+        repetitions.
+        (WebCore::OrderedNamedLinesCollector::collectLineNamesForIndex): Do not assume that there is
+        only 1 repeat track.
+        (WebCore::valueForGridTrackList):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseGridTrackRepeatFunction): Allow multiple tracks in repeat().
+        * rendering/RenderGrid.cpp:
+        (WebCore::RenderGrid::rawGridTrackSize): Renamed repetitions -&gt; autoRepeatTracksCount.
+        (WebCore::RenderGrid::computeAutoRepeatTracksCount): Use all the repeat tracks to compute
+        the total track size of a single repetition.
+        (WebCore::RenderGrid::computeEmptyTracksForAutoRepeat):
+        * rendering/style/GridPositionsResolver.cpp:
+        (WebCore::NamedLineCollection::NamedLineCollection): Renamed m_repetitions -&gt;
+        m_autoRepeatTotalTracks. Added m_autoRepeatTrackListLength (it was always 1 before).
+        (WebCore::NamedLineCollection::find): Resolve lines inside multiple repeat tracks.
+        (WebCore::NamedLineCollection::firstPosition): Ditto.
+        * rendering/style/GridPositionsResolver.h:
+
+2016-07-25  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
+
</ins><span class="cx">         [css-grid] grid-auto-flow|row should take a &lt;track-size&gt;+
</span><span class="cx">         https://bugs.webkit.org/show_bug.cgi?id=160158
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -1036,11 +1036,12 @@
</span><span class="cx"> class OrderedNamedLinesCollector {
</span><span class="cx">     WTF_MAKE_NONCOPYABLE(OrderedNamedLinesCollector);
</span><span class="cx"> public:
</span><del>-    OrderedNamedLinesCollector(const RenderStyle&amp; style, bool isRowAxis, unsigned repetitions)
</del><ins>+    OrderedNamedLinesCollector(const RenderStyle&amp; style, bool isRowAxis, unsigned autoRepeatTracksCount)
</ins><span class="cx">         : m_orderedNamedGridLines(isRowAxis ? style.orderedNamedGridColumnLines() : style.orderedNamedGridRowLines())
</span><span class="cx">         , m_orderedNamedAutoRepeatGridLines(isRowAxis ? style.autoRepeatOrderedNamedGridColumnLines() : style.autoRepeatOrderedNamedGridRowLines())
</span><span class="cx">         , m_insertionPoint(isRowAxis ? style.gridAutoRepeatColumnsInsertionPoint() : style.gridAutoRepeatRowsInsertionPoint())
</span><del>-        , m_repetitions(repetitions)
</del><ins>+        , m_autoRepeatTotalTracks(autoRepeatTracksCount)
+        , m_autoRepeatTrackListLength(isRowAxis ? style.gridAutoRepeatColumns().size() : style.gridAutoRepeatRows().size())
</ins><span class="cx">     {
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1055,7 +1056,8 @@
</span><span class="cx">     const OrderedNamedGridLinesMap&amp; m_orderedNamedGridLines;
</span><span class="cx">     const OrderedNamedGridLinesMap&amp; m_orderedNamedAutoRepeatGridLines;
</span><span class="cx">     unsigned m_insertionPoint;
</span><del>-    unsigned m_repetitions;
</del><ins>+    unsigned m_autoRepeatTotalTracks;
+    unsigned m_autoRepeatTrackListLength;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> void OrderedNamedLinesCollector::appendLines(CSSGridLineNamesValue&amp; lineNamesValue, unsigned index, NamedLinesType type) const
</span><span class="lines">@@ -1078,9 +1080,10 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    ASSERT(m_repetitions);
-    if (i &gt; m_insertionPoint + m_repetitions) {
-        appendLines(lineNamesValue, i - (m_repetitions - 1), NamedLines);
</del><ins>+    ASSERT(m_autoRepeatTotalTracks);
+
+    if (i &gt; m_insertionPoint + m_autoRepeatTotalTracks) {
+        appendLines(lineNamesValue, i - (m_autoRepeatTotalTracks - 1), NamedLines);
</ins><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -1090,14 +1093,16 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    if (i == m_insertionPoint + m_repetitions) {
-        appendLines(lineNamesValue, 1, AutoRepeatNamedLines);
</del><ins>+    if (i == m_insertionPoint + m_autoRepeatTotalTracks) {
+        appendLines(lineNamesValue, m_autoRepeatTrackListLength, AutoRepeatNamedLines);
</ins><span class="cx">         appendLines(lineNamesValue, m_insertionPoint + 1, NamedLines);
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    appendLines(lineNamesValue, 1, AutoRepeatNamedLines);
-    appendLines(lineNamesValue, 0, AutoRepeatNamedLines);
</del><ins>+    unsigned autoRepeatIndexInFirstRepetition = (i - m_insertionPoint) % m_autoRepeatTrackListLength;
+    if (!autoRepeatIndexInFirstRepetition &amp;&amp; i &gt; m_insertionPoint)
+        appendLines(lineNamesValue, m_autoRepeatTrackListLength, AutoRepeatNamedLines);
+    appendLines(lineNamesValue, autoRepeatIndexInFirstRepetition, AutoRepeatNamedLines);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> static void addValuesForNamedGridLinesAtIndex(OrderedNamedLinesCollector&amp; collector, unsigned i, CSSValueList&amp; list)
</span><span class="lines">@@ -1141,8 +1146,8 @@
</span><span class="cx">     if (trackListIsEmpty)
</span><span class="cx">         return CSSValuePool::singleton().createIdentifierValue(CSSValueNone);
</span><span class="cx"> 
</span><del>-    unsigned repetitions = isRenderGrid ? downcast&lt;RenderGrid&gt;(renderer)-&gt;autoRepeatCountForDirection(direction) : 0;
-    OrderedNamedLinesCollector collector(style, isRowAxis, repetitions);
</del><ins>+    unsigned autoRepeatTotalTracks = isRenderGrid ? downcast&lt;RenderGrid&gt;(renderer)-&gt;autoRepeatCountForDirection(direction) : 0;
+    OrderedNamedLinesCollector collector(style, isRowAxis, autoRepeatTotalTracks);
</ins><span class="cx">     auto list = CSSValueList::createSpaceSeparated();
</span><span class="cx">     unsigned insertionIndex;
</span><span class="cx">     if (isRenderGrid) {
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -6022,9 +6022,6 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned numberOfTracks = 0;
</span><span class="cx">     while (arguments-&gt;current()) {
</span><del>-        if (isAutoRepeat &amp;&amp; numberOfTracks)
-            return false;
-
</del><span class="cx">         RefPtr&lt;CSSValue&gt; trackSize = parseGridTrackSize(*arguments);
</span><span class="cx">         if (!trackSize)
</span><span class="cx">             return false;
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingRenderGridcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/RenderGrid.cpp (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/Source/WebCore/rendering/RenderGrid.cpp        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -877,12 +877,12 @@
</span><span class="cx">     auto&amp; autoRepeatTrackStyles = isRowAxis ? style().gridAutoRepeatColumns() : style().gridAutoRepeatRows();
</span><span class="cx">     auto&amp; autoTrackStyles = isRowAxis ? style().gridAutoColumns() : style().gridAutoRows();
</span><span class="cx">     unsigned insertionPoint = isRowAxis ? style().gridAutoRepeatColumnsInsertionPoint() : style().gridAutoRepeatRowsInsertionPoint();
</span><del>-    unsigned repetitions = autoRepeatCountForDirection(direction);
</del><ins>+    unsigned autoRepeatTracksCount = autoRepeatCountForDirection(direction);
</ins><span class="cx"> 
</span><span class="cx">     // We should not use GridPositionsResolver::explicitGridXXXCount() for this because the
</span><span class="cx">     // explicit grid might be larger than the number of tracks in grid-template-rows|columns (if
</span><span class="cx">     // grid-template-areas is specified for example).
</span><del>-    unsigned explicitTracksCount = trackStyles.size() + repetitions;
</del><ins>+    unsigned explicitTracksCount = trackStyles.size() + autoRepeatTracksCount;
</ins><span class="cx"> 
</span><span class="cx">     int untranslatedIndexAsInt = translatedIndex + (isRowAxis ? m_smallestColumnStart : m_smallestRowStart);
</span><span class="cx">     unsigned autoTrackStylesSize = autoTrackStyles.size();
</span><span class="lines">@@ -897,13 +897,15 @@
</span><span class="cx">     if (untranslatedIndex &gt;= explicitTracksCount)
</span><span class="cx">         return autoTrackStyles[(untranslatedIndex - explicitTracksCount) % autoTrackStylesSize];
</span><span class="cx"> 
</span><del>-    if (!repetitions || untranslatedIndex &lt; insertionPoint)
</del><ins>+    if (!autoRepeatTracksCount || untranslatedIndex &lt; insertionPoint)
</ins><span class="cx">         return trackStyles[untranslatedIndex];
</span><span class="cx"> 
</span><del>-    if (untranslatedIndex &lt; (insertionPoint + repetitions))
-        return autoRepeatTrackStyles[0];
</del><ins>+    if (untranslatedIndex &lt; (insertionPoint + autoRepeatTracksCount)) {
+        unsigned autoRepeatLocalIndex = untranslatedIndexAsInt - insertionPoint;
+        return autoRepeatTrackStyles[autoRepeatLocalIndex % autoRepeatTrackStyles.size()];
+    }
</ins><span class="cx"> 
</span><del>-    return trackStyles[untranslatedIndex - repetitions];
</del><ins>+    return trackStyles[untranslatedIndex - autoRepeatTracksCount];
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> GridTrackSize RenderGrid::gridTrackSize(GridTrackSizingDirection direction, unsigned translatedIndex, SizingOperation sizingOperation) const
</span><span class="lines">@@ -1418,15 +1420,11 @@
</span><span class="cx"> {
</span><span class="cx">     bool isRowAxis = direction == ForColumns;
</span><span class="cx">     const auto&amp; autoRepeatTracks = isRowAxis ? style().gridAutoRepeatColumns() : style().gridAutoRepeatRows();
</span><ins>+    unsigned autoRepeatTrackListLength = autoRepeatTracks.size();
</ins><span class="cx"> 
</span><del>-    if (!autoRepeatTracks.size())
</del><ins>+    if (!autoRepeatTrackListLength)
</ins><span class="cx">         return 0;
</span><span class="cx"> 
</span><del>-    ASSERT(autoRepeatTracks.size() == 1);
-    auto autoTrackSize = autoRepeatTracks.at(0);
-    ASSERT(autoTrackSize.minTrackBreadth().isLength());
-    ASSERT(!autoTrackSize.minTrackBreadth().isFlex());
-
</del><span class="cx">     Optional&lt;LayoutUnit&gt; availableSize = isRowAxis ? availableLogicalWidth() : computeContentLogicalHeight(MainOrPreferredSize, style().logicalHeight(), Nullopt);
</span><span class="cx">     if (!isRowAxis || containingBlock()) {
</span><span class="cx">         if (!availableSize) {
</span><span class="lines">@@ -1447,7 +1445,7 @@
</span><span class="cx">     if (!availableSize) {
</span><span class="cx">         const Length&amp; minSize = isRowAxis ? style().logicalMinWidth() : style().logicalMinHeight();
</span><span class="cx">         if (!minSize.isSpecified())
</span><del>-            return 1;
</del><ins>+            return autoRepeatTrackListLength;
</ins><span class="cx"> 
</span><span class="cx">         LayoutUnit containingBlockAvailableSize = isRowAxis ? containingBlockLogicalWidthForContent() : containingBlockLogicalHeightForContent(ExcludeMarginBorderPadding);
</span><span class="cx">         availableSize = valueForLength(minSize, containingBlockAvailableSize);
</span><span class="lines">@@ -1454,14 +1452,20 @@
</span><span class="cx">         needsToFulfillMinimumSize = true;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    bool hasDefiniteMaxTrackSizingFunction = autoTrackSize.maxTrackBreadth().isLength() &amp;&amp; !autoTrackSize.maxTrackBreadth().isContentSized();
-    const Length trackLength = hasDefiniteMaxTrackSizingFunction ? autoTrackSize.maxTrackBreadth().length() : autoTrackSize.minTrackBreadth().length();
</del><ins>+    LayoutUnit autoRepeatTracksSize;
+    for (auto&amp; autoTrackSize : autoRepeatTracks) {
+        ASSERT(autoTrackSize.minTrackBreadth().isLength());
+        ASSERT(!autoTrackSize.minTrackBreadth().isFlex());
+        bool hasDefiniteMaxTrackSizingFunction = autoTrackSize.maxTrackBreadth().isLength() &amp;&amp; !autoTrackSize.maxTrackBreadth().isContentSized();
+        auto trackLength = hasDefiniteMaxTrackSizingFunction ? autoTrackSize.maxTrackBreadth().length() : autoTrackSize.minTrackBreadth().length();
+        autoRepeatTracksSize += valueForLength(trackLength, availableSize.value());
+    }
</ins><span class="cx">     // For the purpose of finding the number of auto-repeated tracks, the UA must floor the track size to a UA-specified
</span><span class="cx">     // value to avoid division by zero. It is suggested that this floor be 1px.
</span><del>-    LayoutUnit autoRepeatTrackSize = std::max&lt;LayoutUnit&gt;(LayoutUnit(1), valueForLength(trackLength, availableSize.value()));
</del><ins>+    autoRepeatTracksSize = std::max&lt;LayoutUnit&gt;(LayoutUnit(1), autoRepeatTracksSize);
</ins><span class="cx"> 
</span><span class="cx">     // There will be always at least 1 auto-repeat track, so take it already into account when computing the total track size.
</span><del>-    LayoutUnit tracksSize = autoRepeatTrackSize;
</del><ins>+    LayoutUnit tracksSize = autoRepeatTracksSize;
</ins><span class="cx">     auto&amp; trackSizes = isRowAxis ? style().gridColumns() : style().gridRows();
</span><span class="cx"> 
</span><span class="cx">     for (const auto&amp; track : trackSizes) {
</span><span class="lines">@@ -1477,9 +1481,9 @@
</span><span class="cx"> 
</span><span class="cx">     LayoutUnit freeSpace = availableSize.value() - tracksSize;
</span><span class="cx">     if (freeSpace &lt;= 0)
</span><del>-        return 1;
</del><ins>+        return autoRepeatTrackListLength;
</ins><span class="cx"> 
</span><del>-    unsigned repetitions = 1 + (freeSpace / (autoRepeatTrackSize + gapSize)).toInt();
</del><ins>+    unsigned repetitions = 1 + (freeSpace / (autoRepeatTracksSize + gapSize)).toInt();
</ins><span class="cx"> 
</span><span class="cx">     // Provided the grid container does not have a definite size or max-size in the relevant axis,
</span><span class="cx">     // if the min size is definite then the number of repetitions is the largest possible positive
</span><span class="lines">@@ -1487,7 +1491,7 @@
</span><span class="cx">     if (needsToFulfillMinimumSize)
</span><span class="cx">         ++repetitions;
</span><span class="cx"> 
</span><del>-    return repetitions;
</del><ins>+    return repetitions * autoRepeatTrackListLength;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> 
</span><span class="lines">@@ -1499,10 +1503,9 @@
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><span class="cx">     std::unique_ptr&lt;OrderedTrackIndexSet&gt; emptyTrackIndexes;
</span><del>-    size_t insertionPoint = isRowAxis ? style().gridAutoRepeatColumnsInsertionPoint() : style().gridAutoRepeatRowsInsertionPoint();
-    size_t repetitions = autoRepeatCountForDirection(direction);
-    size_t firstAutoRepeatTrack = insertionPoint + std::abs(isRowAxis ? m_smallestColumnStart : m_smallestRowStart);
-    size_t lastAutoRepeatTrack = firstAutoRepeatTrack + repetitions;
</del><ins>+    unsigned insertionPoint = isRowAxis ? style().gridAutoRepeatColumnsInsertionPoint() : style().gridAutoRepeatRowsInsertionPoint();
+    unsigned firstAutoRepeatTrack = insertionPoint + std::abs(isRowAxis ? m_smallestColumnStart : m_smallestRowStart);
+    unsigned lastAutoRepeatTrack = firstAutoRepeatTrack + autoRepeatCountForDirection(direction);
</ins><span class="cx"> 
</span><span class="cx">     if (m_gridItemArea.isEmpty()) {
</span><span class="cx">         emptyTrackIndexes = std::make_unique&lt;OrderedTrackIndexSet&gt;();
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleGridPositionsResolvercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/Source/WebCore/rendering/style/GridPositionsResolver.cpp        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -71,7 +71,7 @@
</span><span class="cx"> 
</span><span class="cx"> NamedLineCollection::NamedLineCollection(const RenderStyle&amp; gridContainerStyle, const String&amp; namedLine, GridTrackSizingDirection direction, unsigned lastLine, unsigned autoRepeatTracksCount)
</span><span class="cx">     : m_lastLine(lastLine)
</span><del>-    , m_repetitions(autoRepeatTracksCount)
</del><ins>+    , m_autoRepeatTotalTracks(autoRepeatTracksCount)
</ins><span class="cx"> {
</span><span class="cx">     bool isRowAxis = direction == ForColumns;
</span><span class="cx">     const NamedGridLinesMap&amp; gridLineNames = isRowAxis ? gridContainerStyle.namedGridColumnLines() : gridContainerStyle.namedGridRowLines();
</span><span class="lines">@@ -84,6 +84,8 @@
</span><span class="cx">     m_autoRepeatNamedLinesIndexes = autoRepeatLinesIterator == autoRepeatGridLineNames.end() ? nullptr : &amp;autoRepeatLinesIterator-&gt;value;
</span><span class="cx"> 
</span><span class="cx">     m_insertionPoint = isRowAxis ? gridContainerStyle.gridAutoRepeatColumnsInsertionPoint() : gridContainerStyle.gridAutoRepeatRowsInsertionPoint();
</span><ins>+
+    m_autoRepeatTrackListLength = isRowAxis ? gridContainerStyle.gridAutoRepeatColumns().size() : gridContainerStyle.gridAutoRepeatRows().size();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool NamedLineCollection::isValidNamedLineOrArea(const String&amp; namedLine, const RenderStyle&amp; gridContainerStyle, GridPositionSide side)
</span><span class="lines">@@ -112,22 +114,24 @@
</span><span class="cx">     if (!m_autoRepeatNamedLinesIndexes || line &lt; m_insertionPoint)
</span><span class="cx">         return m_namedLinesIndexes ? m_namedLinesIndexes-&gt;find(line) : notFound;
</span><span class="cx"> 
</span><del>-    if (line &lt;= (m_insertionPoint + m_repetitions)) {
</del><ins>+    if (line &lt;= (m_insertionPoint + m_autoRepeatTotalTracks)) {
</ins><span class="cx">         size_t localIndex = line - m_insertionPoint;
</span><span class="cx"> 
</span><ins>+        size_t indexInFirstRepetition = localIndex % m_autoRepeatTrackListLength;
+        if (indexInFirstRepetition)
+            return m_autoRepeatNamedLinesIndexes-&gt;find(indexInFirstRepetition);
+
</ins><span class="cx">         // The line names defined in the last line are also present in the first line of the next
</span><del>-        // repetition (if any). Same for the line names defined in the first line. Note that there
-        // is only one auto-repeated track allowed by the syntax, that's why it's enough to store
-        // indexes 0 and 1 (before and after the track size).
-        if (localIndex == m_repetitions)
-            return m_autoRepeatNamedLinesIndexes-&gt;find(1u);
</del><ins>+        // repetition (if any). Same for the line names defined in the first line.
+        if (localIndex == m_autoRepeatTotalTracks)
+            return m_autoRepeatNamedLinesIndexes-&gt;find(m_autoRepeatTrackListLength);
</ins><span class="cx">         size_t position = m_autoRepeatNamedLinesIndexes-&gt;find(0u);
</span><span class="cx">         if (position != notFound)
</span><span class="cx">             return position;
</span><del>-        return localIndex ? m_autoRepeatNamedLinesIndexes-&gt;find(1u) : notFound;
</del><ins>+        return localIndex ? m_autoRepeatNamedLinesIndexes-&gt;find(m_autoRepeatTrackListLength) : notFound;
</ins><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return m_namedLinesIndexes ? m_namedLinesIndexes-&gt;find(line - (m_repetitions - 1)) : notFound;
</del><ins>+    return m_namedLinesIndexes ? m_namedLinesIndexes-&gt;find(line - (m_autoRepeatTotalTracks - 1)) : notFound;
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool NamedLineCollection::contains(unsigned line) const
</span><span class="lines">@@ -143,7 +147,7 @@
</span><span class="cx"> 
</span><span class="cx">     if (!m_autoRepeatNamedLinesIndexes) {
</span><span class="cx">         if (!m_insertionPoint || m_insertionPoint &lt; m_namedLinesIndexes-&gt;at(firstLine))
</span><del>-            return m_namedLinesIndexes-&gt;at(firstLine) + (m_repetitions ? m_repetitions - 1 : 0);
</del><ins>+            return m_namedLinesIndexes-&gt;at(firstLine) + (m_autoRepeatTotalTracks ? m_autoRepeatTotalTracks - 1 : 0);
</ins><span class="cx">         return m_namedLinesIndexes-&gt;at(firstLine);
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="lines">@@ -151,7 +155,7 @@
</span><span class="cx">         return m_autoRepeatNamedLinesIndexes-&gt;at(firstLine) + m_insertionPoint;
</span><span class="cx"> 
</span><span class="cx">     if (!m_insertionPoint)
</span><del>-        return m_autoRepeatNamedLinesIndexes-&gt;at(firstLine);
</del><ins>+        return std::min(m_namedLinesIndexes-&gt;at(firstLine) + m_autoRepeatTotalTracks, m_autoRepeatNamedLinesIndexes-&gt;at(firstLine));
</ins><span class="cx"> 
</span><span class="cx">     return std::min(m_namedLinesIndexes-&gt;at(firstLine), m_autoRepeatNamedLinesIndexes-&gt;at(firstLine) + m_insertionPoint);
</span><span class="cx"> }
</span></span></pre></div>
<a id="trunkSourceWebCorerenderingstyleGridPositionsResolverh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/rendering/style/GridPositionsResolver.h (203716 => 203717)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/rendering/style/GridPositionsResolver.h        2016-07-26 09:37:41 UTC (rev 203716)
+++ trunk/Source/WebCore/rendering/style/GridPositionsResolver.h        2016-07-26 11:08:28 UTC (rev 203717)
</span><span class="lines">@@ -66,7 +66,8 @@
</span><span class="cx"> 
</span><span class="cx">     unsigned m_insertionPoint;
</span><span class="cx">     unsigned m_lastLine;
</span><del>-    unsigned m_repetitions;
</del><ins>+    unsigned m_autoRepeatTotalTracks;
+    unsigned m_autoRepeatTrackListLength;
</ins><span class="cx"> };
</span><span class="cx"> 
</span><span class="cx"> // Class with all the code related to grid items positions resolution.
</span></span></pre>
</div>
</div>

</body>
</html>