<!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 <track-list> argument
https://bugs.webkit.org/show_bug.cgi?id=160162
Reviewed by Darin Adler.
Source/WebCore:
The repeat() notation used to allow just 1 <track-size> as second argument. Specs have been
recently modified so that a <track-list> 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 -> 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 ->
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 & 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 <svillar@igalia.com>
</span><span class="cx">
</span><ins>+ [css-grid] repeat() syntax should take a <track-list> 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 & 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 <svillar@igalia.com>
+
</ins><span class="cx"> [css-grid] grid-auto-flow|row should take a <track-size>+
</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"> <div class="item" style="grid-column: foo / bar 2" data-offset-x="40" data-offset-y="0" data-expected-width="180" data-expected-height="25"></div>
</span><span class="cx"> </div>
</span><span class="cx">
</span><ins>+<div class="grid gridMultipleTracks">
+ <div class="item" style="grid-column: a / 2 c" data-offset-x="20" data-offset-y="0" data-expected-width="84" data-expected-height="25"></div>
+ <div class="item" style="grid-column: 3 / e; grid-row: 2;" data-offset-x="52" data-offset-y="25" data-expected-width="72" data-expected-height="25"></div>
+</div>
+
+<div class="grid gridMultipleTracks gap">
+ <div class="item" style="grid-column: a / c" data-offset-x="40" data-offset-y="0" data-expected-width="32" data-expected-height="25"></div>
+ <div class="item" style="grid-column: 3 / last; grid-row: 2;" data-offset-x="92" data-offset-y="25" data-expected-width="115" data-expected-height="25"></div>
+</div>
+
</ins><span class="cx"> </body>
</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"> <div class="item" style="grid-row: foo / bar 2" data-offset-y="40" data-offset-x="0" data-expected-height="180" data-expected-width="25"></div>
</span><span class="cx"> </div>
</span><span class="cx">
</span><ins>+<div class="grid gridMultipleTracks">
+ <div class="item" style="grid-row: a / 2 c" data-offset-y="20" data-offset-x="0" data-expected-height="84" data-expected-width="25"></div>
+ <div class="item" style="grid-row: 3 / e; grid-column: 2;" data-offset-y="52" data-offset-x="25" data-expected-height="72" data-expected-width="25"></div>
+</div>
+
+<div class="grid gridMultipleTracks gap">
+ <div class="item" style="grid-row: a / c" data-offset-y="40" data-offset-x="0" data-expected-height="32" data-expected-width="25"></div>
+ <div class="item" style="grid-row: 3 / last; grid-column: 2;" data-offset-y="92" data-offset-x="25" data-expected-height="115" data-expected-width="25"></div>
+</div>
+
</ins><span class="cx"> </body>
</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"> <div class="item" style="grid-column: foo / bar 2" data-offset-x="40" data-offset-y="0" data-expected-width="180" data-expected-height="25"></div>
</span><span class="cx"> </div>
</span><span class="cx">
</span><ins>+<div class="grid gridMultipleTracks">
+ <div class="item" style="grid-column: e / last;" data-offset-x="52" data-offset-y="0" data-expected-width="148" data-expected-height="25"></div>
+ <div class="item" style="grid-column: start / b;" data-offset-x="0" data-offset-y="25" data-expected-width="52" data-expected-height="25"></div>
+</div>
+
+<div class="grid gridMultipleTracks gap">
+ <div class="item" style="grid-column: c / -1;" data-offset-x="40" data-offset-y="0" data-expected-width="160" data-expected-height="25"></div>
+</div>
+
</ins><span class="cx"> </body>
</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"> <div class="item" style="grid-row: foo / bar 2" data-offset-y="40" data-offset-x="0" data-expected-height="180" data-expected-width="25"></div>
</span><span class="cx"> </div>
</span><span class="cx">
</span><ins>+<div class="grid gridMultipleTracks">
+ <div class="item" style="grid-row: e / last;" data-offset-y="52" data-offset-x="0" data-expected-height="148" data-expected-width="25"></div>
+ <div class="item" style="grid-row: start / b;" data-offset-y="0" data-offset-x="0" data-expected-height="52" data-expected-width="25"></div>
+</div>
+
+<div class="grid gridMultipleTracks gap">
+ <div class="item" style="grid-row: c / -1;" data-offset-y="40" data-offset-x="0" data-expected-height="160" data-expected-width="25"></div>
+</div>
+
</ins><span class="cx"> </body>
</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 "repeat(auto-fit, [foo bar] 150px)"
</span><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "0px [foo bar] 0px [foo bar]"
</span><span class="cx"> PASS element.style.gridTemplateRows is "repeat(auto-fit, 24em [foo bar])"
</span><ins>+PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[start] 200px 100px [end start] 200px 100px [end]"
+PASS element.style.gridTemplateColumns is "repeat(auto-fill, [start] 200px 100px [end])"
+PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "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"
+PASS element.style.gridTemplateRows is "100px [foo] repeat(auto-fill, [a] 2em [b] 10% [c]) [bar] 3em"
</ins><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[foo bar] 0px [foo bar] 0px"
</span><span class="cx"> PASS element.style.gridTemplateColumns is "repeat(auto-fit, [foo bar] minmax(270px, 1fr))"
</span><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[foo] 0px [bar foo] 0px [bar foo] 0px [bar]"
</span><span class="lines">@@ -40,6 +44,10 @@
</span><span class="cx"> PASS element.style.gridTemplateColumns is "[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c] 20px [e]"
</span><span class="cx"> PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "[a b] 30px [c d] 20px [e z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y]"
</span><span class="cx"> PASS element.style.gridTemplateRows is "[a b] 30px [c d] 20px [e] repeat(auto-fit, [z] 100px [y])"
</span><ins>+PASS getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "[start] 0px 0px [end start] 0px 0px [end]"
+PASS element.style.gridTemplateColumns is "repeat(auto-fit, [start] 200px 100px [end])"
+PASS getComputedStyle(element, '').getPropertyValue('grid-template-rows') is "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"
+PASS element.style.gridTemplateRows is "100px [foo] repeat(auto-fit, [a] 2em [b] 10% [c]) [bar] 3em"
</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 "none"
</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("repeat(auto-fill, minmax(50px, 100px)) repeat(2, 250px)", "repeat(1, 450px) repeat(auto-fill, minmax(-webkit-max-content, 5em) [bar]) repeat(2, [foo] 1em)", "100px 100px 100px 250px 250px", "450px 50px [bar] 50px [bar foo] 10px [foo] 10px", "repeat(auto-fill, minmax(50px, 100px)) 250px 250px", "450px repeat(auto-fill, minmax(-webkit-max-content, 5em) [bar]) [foo] 1em [foo] 1em");
</span><span class="cx"> testGridTemplatesSetJSValues("[start] 10% repeat(auto-fill, [foo bar] 200px) [end]", "75px [prev] repeat(auto-fill, 20em [foo bar]) [next] 15em [last end]", "[start] 80px [foo bar] 200px [foo bar] 200px [foo bar] 200px [end]", "75px [prev] 200px [foo bar next] 150px [last end]");
</span><span class="cx"> testGridTemplatesSetJSValues("repeat(auto-fit, [foo bar] 150px)", "repeat(auto-fit, 24em [foo bar])", "[foo bar] 0px [foo bar] 0px [foo bar] 0px [foo bar] 0px [foo bar] 0px", "0px [foo bar] 0px [foo bar]");
</span><ins>+ testGridTemplatesSetJSValues("repeat(auto-fill, [start] 200px 100px [end])", "100px [foo] repeat(auto-fill, [a] 2em [b] 10% [c]) [bar] 3em", "[start] 200px 100px [end start] 200px 100px [end]", "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");
</ins><span class="cx"> testGridTemplatesSetJSValues("repeat(auto-fit, [foo bar] minmax(270px, 1fr))", "repeat(auto-fit, [foo] minmax(20em, -webkit-max-content) [bar])", "[foo bar] 0px [foo bar] 0px", "[foo] 0px [bar foo] 0px [bar foo] 0px [bar]");
</span><span class="cx"> testGridTemplatesSetJSValues("repeat(auto-fit, minmax(300px, -webkit-min-content)) repeat(2, 20px)", "repeat(1, 10%) repeat(auto-fit, minmax(30em, -webkit-max-content) [bar]) repeat(2, [foo] 1em)", "0px 0px 20px 20px", "60px 0px [bar foo] 10px [foo] 10px", "repeat(auto-fit, minmax(300px, -webkit-min-content)) 20px 20px", "10% repeat(auto-fit, minmax(30em, -webkit-max-content) [bar]) [foo] 1em [foo] 1em");
</span><span class="cx"> testGridTemplatesSetJSValues("[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c d] 20px [e]", "repeat(auto-fit, [z] 100px [y]) [a b] 30px [c d] 20px [e]", "[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]", "[z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y a b] 30px [c d] 20px [e]");
</span><span class="cx"> testGridTemplatesSetJSValues("[a] repeat(auto-fit, [z] 100px [y]) repeat(1, [b] 30px [c]) 20px [e]", "[a b] 30px [c d] 20px [e] repeat(auto-fit, [z] 100px [y])", "[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]", "[a b] 30px [c d] 20px [e z] 0px [y z] 0px [y z] 0px [y z] 0px [y z] 0px [y]", "[a] repeat(auto-fit, [z] 100px [y]) [b] 30px [c] 20px [e]");
</span><ins>+ testGridTemplatesSetJSValues("repeat(auto-fit, [start] 200px 100px [end])", "100px [foo] repeat(auto-fit, [a] 2em [b] 10% [c]) [bar] 3em", "[start] 0px 0px [end start] 0px 0px [end]", "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");
</ins><span class="cx">
</span><span class="cx"> debug("");
</span><span class="cx"> debug("Test invalid repeat syntax.");
</span><span class="lines">@@ -33,14 +35,14 @@
</span><span class="cx">
</span><span class="cx"> testInvalidSyntax("repeat(auto-fill, 1fr)");
</span><span class="cx"> testInvalidSyntax("repeat(auto-fill, [bar] auto)");
</span><del>- testInvalidSyntax("repeat(auto-fill, 20px 10px)");
- testInvalidSyntax("repeat(auto-fill, 20px [foo bar] 10px)");
</del><ins>+ testInvalidSyntax("repeat(auto-fill, 20px -webkit-min-content)");
+ testInvalidSyntax("repeat(auto-fill, auto [foo bar] 10px)");
</ins><span class="cx"> testInvalidSyntax("repeat(auto-fill,)");
</span><span class="cx"> testInvalidSyntax("repeat(auto-fill, [foo])");
</span><span class="cx"> testInvalidSyntax("repeat(auto-fit, 1fr)");
</span><span class="cx"> testInvalidSyntax("repeat(auto-fit, [bar] auto)");
</span><del>- testInvalidSyntax("repeat(auto-fit, 20px 10px)");
- testInvalidSyntax("repeat(auto-fit, 20px [foo bar] 10px)");
</del><ins>+ testInvalidSyntax("repeat(auto-fit, minmax(20px, 30px) auto)");
+ testInvalidSyntax("repeat(auto-fit, -webkit-max-content 2em)");
</ins><span class="cx"> testInvalidSyntax("repeat(auto-fit,)");
</span><span class="cx"> testInvalidSyntax("repeat(auto-fit, [foo])");
</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 "44px 10px 10px"
</span><span class="cx"> PASS window.getComputedStyle(mixNonRepeatAfterRepeat, '').getPropertyValue('grid-template-columns') is "250px 250px 120px [last]"
</span><span class="cx"> PASS window.getComputedStyle(mixNonRepeatAfterRepeat, '').getPropertyValue('grid-template-rows') is "10px 10px [end] 0px"
</span><ins>+PASS window.getComputedStyle(multipleTrackRepeat, '').getPropertyValue('grid-template-columns') is "[start] 20px [a] 20px 0px [b a] 20px 0px [b] 200px [c] 0px [end]"
+PASS window.getComputedStyle(multipleTrackRepeat, '').getPropertyValue('grid-template-rows') is "0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d e] 16px"
</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 "none"
</span><span class="lines">@@ -38,6 +40,8 @@
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
</span><span class="cx"> PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
</span><ins>+PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('grid-template-columns') is "none"
</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"> </style>
</span><span class="cx"> <script src="../../resources/js-test-pre.js"></script>
</span><span class="cx"> </head>
</span><span class="lines">@@ -94,6 +100,7 @@
</span><span class="cx"> <div class="gridItem"></div>
</span><span class="cx"> </div>
</span><span class="cx"> <div class="grid definite mixNonRepeatAfterRepeat alignContentStart" id="mixNonRepeatAfterRepeat"></div>
</span><ins>+<div class="grid multipleTrackRepeat" id="multipleTrackRepeat"></div>
</ins><span class="cx">
</span><span class="cx"> <script src="resources/grid-definitions-parsing-utils.js"></script>
</span><span class="cx"> <script>
</span><span class="lines">@@ -111,6 +118,7 @@
</span><span class="cx"> testGridTemplatesValues(document.getElementById("leadingNamedGridLineRepeat"), "[start] 250px 250px", "[start] 10px 10px");
</span><span class="cx"> testGridTemplatesValues(document.getElementById("mixRepeatAfterNonRepeat"), "[start] 140px 250px 250px", "44px 10px 10px");
</span><span class="cx"> testGridTemplatesValues(document.getElementById("mixNonRepeatAfterRepeat"), "250px 250px 120px [last]", "10px 10px [end] 0px");
</span><ins>+ testGridTemplatesValues(document.getElementById("multipleTrackRepeat"), "[start] 20px [a] 20px 0px [b a] 20px 0px [b] 200px [c] 0px [end]", "0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d] 0px [a] 0px [b c] 20px [d e] 16px");
</ins><span class="cx">
</span><span class="cx"> debug("");
</span><span class="cx"> debug("Test invalid repeat syntax.");
</span><span class="lines">@@ -130,8 +138,10 @@
</span><span class="cx"> testInvalidSyntax("repeat(1, [foo])");
</span><span class="cx"> testInvalidSyntax("repeat(1, )");
</span><span class="cx"> testInvalidSyntax("repeat(1)");
</span><ins>+ testInvalidSyntax("repeat(3, [a] [a] 100px 200px)");
</ins><span class="cx"> // Nesting is no allowed.
</span><span class="cx"> testInvalidSyntax("repeat(2, repeat(1, auto))");
</span><ins>+ testInvalidSyntax("repeat(2, [a] 100px 200px repeat(2, 20px))");
</ins><span class="cx"> </script>
</span><span class="cx"> <script src="../../resources/js-test-post.js"></script>
</span><span class="cx"> </body>
</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 <svillar@igalia.com>
</span><span class="cx">
</span><ins>+ [css-grid] repeat() syntax should take a <track-list> argument
+ https://bugs.webkit.org/show_bug.cgi?id=160162
+
+ Reviewed by Darin Adler.
+
+ The repeat() notation used to allow just 1 <track-size> as second argument. Specs have been
+ recently modified so that a <track-list> 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 -> 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 ->
+ 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 <svillar@igalia.com>
+
</ins><span class="cx"> [css-grid] grid-auto-flow|row should take a <track-size>+
</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& style, bool isRowAxis, unsigned repetitions)
</del><ins>+ OrderedNamedLinesCollector(const RenderStyle& 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& m_orderedNamedGridLines;
</span><span class="cx"> const OrderedNamedGridLinesMap& 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& 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 > m_insertionPoint + m_repetitions) {
- appendLines(lineNamesValue, i - (m_repetitions - 1), NamedLines);
</del><ins>+ ASSERT(m_autoRepeatTotalTracks);
+
+ if (i > 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 && i > 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& collector, unsigned i, CSSValueList& 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<RenderGrid>(renderer)->autoRepeatCountForDirection(direction) : 0;
- OrderedNamedLinesCollector collector(style, isRowAxis, repetitions);
</del><ins>+ unsigned autoRepeatTotalTracks = isRenderGrid ? downcast<RenderGrid>(renderer)->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->current()) {
</span><del>- if (isAutoRepeat && numberOfTracks)
- return false;
-
</del><span class="cx"> RefPtr<CSSValue> 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& autoRepeatTrackStyles = isRowAxis ? style().gridAutoRepeatColumns() : style().gridAutoRepeatRows();
</span><span class="cx"> auto& 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 >= explicitTracksCount)
</span><span class="cx"> return autoTrackStyles[(untranslatedIndex - explicitTracksCount) % autoTrackStylesSize];
</span><span class="cx">
</span><del>- if (!repetitions || untranslatedIndex < insertionPoint)
</del><ins>+ if (!autoRepeatTracksCount || untranslatedIndex < insertionPoint)
</ins><span class="cx"> return trackStyles[untranslatedIndex];
</span><span class="cx">
</span><del>- if (untranslatedIndex < (insertionPoint + repetitions))
- return autoRepeatTrackStyles[0];
</del><ins>+ if (untranslatedIndex < (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& 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<LayoutUnit> 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& 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() && !autoTrackSize.maxTrackBreadth().isContentSized();
- const Length trackLength = hasDefiniteMaxTrackSizingFunction ? autoTrackSize.maxTrackBreadth().length() : autoTrackSize.minTrackBreadth().length();
</del><ins>+ LayoutUnit autoRepeatTracksSize;
+ for (auto& autoTrackSize : autoRepeatTracks) {
+ ASSERT(autoTrackSize.minTrackBreadth().isLength());
+ ASSERT(!autoTrackSize.minTrackBreadth().isFlex());
+ bool hasDefiniteMaxTrackSizingFunction = autoTrackSize.maxTrackBreadth().isLength() && !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<LayoutUnit>(LayoutUnit(1), valueForLength(trackLength, availableSize.value()));
</del><ins>+ autoRepeatTracksSize = std::max<LayoutUnit>(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& trackSizes = isRowAxis ? style().gridColumns() : style().gridRows();
</span><span class="cx">
</span><span class="cx"> for (const auto& 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 <= 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<OrderedTrackIndexSet> 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<OrderedTrackIndexSet>();
</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& gridContainerStyle, const String& 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& gridLineNames = isRowAxis ? gridContainerStyle.namedGridColumnLines() : gridContainerStyle.namedGridRowLines();
</span><span class="lines">@@ -84,6 +84,8 @@
</span><span class="cx"> m_autoRepeatNamedLinesIndexes = autoRepeatLinesIterator == autoRepeatGridLineNames.end() ? nullptr : &autoRepeatLinesIterator->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& namedLine, const RenderStyle& gridContainerStyle, GridPositionSide side)
</span><span class="lines">@@ -112,22 +114,24 @@
</span><span class="cx"> if (!m_autoRepeatNamedLinesIndexes || line < m_insertionPoint)
</span><span class="cx"> return m_namedLinesIndexes ? m_namedLinesIndexes->find(line) : notFound;
</span><span class="cx">
</span><del>- if (line <= (m_insertionPoint + m_repetitions)) {
</del><ins>+ if (line <= (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->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->find(1u);
</del><ins>+ // repetition (if any). Same for the line names defined in the first line.
+ if (localIndex == m_autoRepeatTotalTracks)
+ return m_autoRepeatNamedLinesIndexes->find(m_autoRepeatTrackListLength);
</ins><span class="cx"> size_t position = m_autoRepeatNamedLinesIndexes->find(0u);
</span><span class="cx"> if (position != notFound)
</span><span class="cx"> return position;
</span><del>- return localIndex ? m_autoRepeatNamedLinesIndexes->find(1u) : notFound;
</del><ins>+ return localIndex ? m_autoRepeatNamedLinesIndexes->find(m_autoRepeatTrackListLength) : notFound;
</ins><span class="cx"> }
</span><span class="cx">
</span><del>- return m_namedLinesIndexes ? m_namedLinesIndexes->find(line - (m_repetitions - 1)) : notFound;
</del><ins>+ return m_namedLinesIndexes ? m_namedLinesIndexes->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 < m_namedLinesIndexes->at(firstLine))
</span><del>- return m_namedLinesIndexes->at(firstLine) + (m_repetitions ? m_repetitions - 1 : 0);
</del><ins>+ return m_namedLinesIndexes->at(firstLine) + (m_autoRepeatTotalTracks ? m_autoRepeatTotalTracks - 1 : 0);
</ins><span class="cx"> return m_namedLinesIndexes->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->at(firstLine) + m_insertionPoint;
</span><span class="cx">
</span><span class="cx"> if (!m_insertionPoint)
</span><del>- return m_autoRepeatNamedLinesIndexes->at(firstLine);
</del><ins>+ return std::min(m_namedLinesIndexes->at(firstLine) + m_autoRepeatTotalTracks, m_autoRepeatNamedLinesIndexes->at(firstLine));
</ins><span class="cx">
</span><span class="cx"> return std::min(m_namedLinesIndexes->at(firstLine), m_autoRepeatNamedLinesIndexes->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>