<!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>[199343] 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/199343">199343</a></dd>
<dt>Author</dt> <dd>svillar@igalia.com</dd>
<dt>Date</dt> <dd>2016-04-12 05:21:57 -0700 (Tue, 12 Apr 2016)</dd>
</dl>

<h3>Log Message</h3>
<pre>[css-grid] Add parsing support for &lt;auto-repeat&gt; syntax
https://bugs.webkit.org/show_bug.cgi?id=155583

Reviewed by Antti Koivisto.

Source/WebCore:

The repeat() notation allows now to specify auto-fill or auto-fit instead of
a fixed number of repetitions meaning that it will be automatically computed
depending on the available space.

This patch just adds the parsing support, the expansion of the repeat notation
will be implemented in a follow up patch because it cannot be done at
parsing level (since it requires knowledge about the available space).

Test: fast/css-grid-layout/grid-element-auto-repeat-get-set.html

* CMakeLists.txt:
* css/CSSGridAutoRepeatValue.cpp: Added.
(WebCore::CSSGridAutoRepeatValue::customCSSText):
* css/CSSGridAutoRepeatValue.h: Added.
(WebCore::CSSGridAutoRepeatValue::create):
(WebCore::CSSGridAutoRepeatValue::autoRepeatID):
(WebCore::CSSGridAutoRepeatValue::CSSGridAutoRepeatValue):
* css/CSSParser.cpp:
(WebCore::allTracksAreFixedSized):
(WebCore::CSSParser::parseGridTrackList):
(WebCore::CSSParser::parseGridTrackRepeatFunction):
(WebCore::CSSParser::parseGridTrackSize):
(WebCore::CSSParser::parseGridBreadth):
* css/CSSParser.h:
* css/CSSValue.cpp:
(WebCore::CSSValue::equals):
(WebCore::CSSValue::cssText):
(WebCore::CSSValue::destroy):
* css/CSSValue.h:
(WebCore::CSSValue::isGridAutoRepeatValue):
* css/CSSValueKeywords.in:

LayoutTests:

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

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreCMakeListstxt">trunk/Source/WebCore/CMakeLists.txt</a></li>
<li><a href="#trunkSourceWebCoreChangeLog">trunk/Source/WebCore/ChangeLog</a></li>
<li><a href="#trunkSourceWebCoreWebCorexcodeprojprojectpbxproj">trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj</a></li>
<li><a href="#trunkSourceWebCorecssCSSParsercpp">trunk/Source/WebCore/css/CSSParser.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValuecpp">trunk/Source/WebCore/css/CSSValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueh">trunk/Source/WebCore/css/CSSValue.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSValueKeywordsin">trunk/Source/WebCore/css/CSSValueKeywords.in</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<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="#trunkSourceWebCorecssCSSGridAutoRepeatValuecpp">trunk/Source/WebCore/css/CSSGridAutoRepeatValue.cpp</a></li>
<li><a href="#trunkSourceWebCorecssCSSGridAutoRepeatValueh">trunk/Source/WebCore/css/CSSGridAutoRepeatValue.h</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/LayoutTests/ChangeLog        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -1,3 +1,13 @@
</span><ins>+2016-03-17  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
+
+        [css-grid] Add parsing support for &lt;auto-repeat&gt; syntax
+        https://bugs.webkit.org/show_bug.cgi?id=155583
+
+        Reviewed by Antti Koivisto.
+
+        * fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt: Added.
+        * fast/css-grid-layout/grid-element-auto-repeat-get-set.html: Added.
+
</ins><span class="cx"> 2016-04-12  Alex Christensen  &lt;achristensen@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove failing assertion in ANGLE
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementautorepeatgetsetexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt (0 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -0,0 +1,60 @@
</span><ins>+Test that setting/getting -webkit-grid-template-{columns|rows} with repeat(auto-fill|auto-fit,) works as expected
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test auto-repeat syntax.
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;[foo bar] 10px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;[foo bar] 10px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;20px [foo bar]&quot;
+PASS element.style.webkitGridTemplateRows is &quot;2em [foo bar]&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;[foo bar] 800px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;[foo bar] minmax(10px, 1fr)&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;[foo] 20px [bar]&quot;
+PASS element.style.webkitGridTemplateRows is &quot;[foo] minmax(2em, -webkit-max-content) [bar]&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;100px 20px 20px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;minmax(10px, 100px) 20px 20px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;70px 20px [bar foo] 10px [foo] 10px&quot;
+PASS element.style.webkitGridTemplateRows is &quot;70px minmax(2em, -webkit-max-content) [bar] [foo] 1em [foo] 1em&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;[foo bar] 10px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;[foo bar] 10px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;20px [foo bar]&quot;
+PASS element.style.webkitGridTemplateRows is &quot;2em [foo bar]&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;[foo bar] 800px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;[foo bar] minmax(10px, 1fr)&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;[foo] 20px [bar]&quot;
+PASS element.style.webkitGridTemplateRows is &quot;[foo] minmax(2em, -webkit-max-content) [bar]&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px 20px 20px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;minmax(10px, -webkit-min-content) 20px 20px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;60px 20px [bar foo] 10px [foo] 10px&quot;
+PASS element.style.webkitGridTemplateRows is &quot;10% minmax(2em, -webkit-max-content) [bar] [foo] 1em [foo] 1em&quot;
+
+Test invalid repeat syntax.
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set-expected.txt
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridelementautorepeatgetsethtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html (0 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -0,0 +1,57 @@
</span><ins>+&lt;!DOCTYPE html&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;script src=&quot;resources/grid-definitions-parsing-utils.js&quot;&gt;&lt;/script&gt;
+
+&lt;body&gt;
+&lt;/body&gt;
+&lt;script&gt;
+    description('Test that setting/getting -webkit-grid-template-{columns|rows} with repeat(auto-fill|auto-fit,) works as expected');
+
+    debug(&quot;Test auto-repeat syntax.&quot;);
+    testGridTemplatesSetJSValues(&quot;repeat(auto-fill, [foo bar] 10px)&quot;, &quot;repeat(auto-fill, 2em [foo bar])&quot;, &quot;[foo bar] 10px&quot;, &quot;20px [foo bar]&quot;, &quot;[foo bar] 10px&quot;, &quot;2em [foo bar]&quot;);
+    testGridTemplatesSetJSValues(&quot;repeat(auto-fill, [foo bar] minmax(10px, 1fr))&quot;, &quot;repeat(auto-fill, [foo] minmax(2em, -webkit-max-content) [bar])&quot;, &quot;[foo bar] 800px&quot;, &quot;[foo] 20px [bar]&quot;, &quot;[foo bar] minmax(10px, 1fr)&quot;, &quot;[foo] minmax(2em, -webkit-max-content) [bar]&quot;);
+    testGridTemplatesSetJSValues(&quot;repeat(auto-fill, minmax(10px, 100px)) repeat(2, 20px)&quot;, &quot;repeat(1, 70px) repeat(auto-fill, minmax(2em, -webkit-max-content) [bar]) repeat(2, [foo] 1em)&quot;, &quot;100px 20px 20px&quot;, &quot;70px 20px [bar foo] 10px [foo] 10px&quot;, &quot;minmax(10px, 100px) 20px 20px&quot;, &quot;70px minmax(2em, -webkit-max-content) [bar] [foo] 1em [foo] 1em&quot;);
+    testGridTemplatesSetJSValues(&quot;repeat(auto-fit, [foo bar] 10px)&quot;, &quot;repeat(auto-fit, 2em [foo bar])&quot;, &quot;[foo bar] 10px&quot;, &quot;20px [foo bar]&quot;, &quot;[foo bar] 10px&quot;, &quot;2em [foo bar]&quot;);
+    testGridTemplatesSetJSValues(&quot;repeat(auto-fit, [foo bar] minmax(10px, 1fr))&quot;, &quot;repeat(auto-fit, [foo] minmax(2em, -webkit-max-content) [bar])&quot;, &quot;[foo bar] 800px&quot;, &quot;[foo] 20px [bar]&quot;, &quot;[foo bar] minmax(10px, 1fr)&quot;, &quot;[foo] minmax(2em, -webkit-max-content) [bar]&quot;);
+    testGridTemplatesSetJSValues(&quot;repeat(auto-fit, minmax(10px, -webkit-min-content)) repeat(2, 20px)&quot;, &quot;repeat(1, 10%) repeat(auto-fit, minmax(2em, -webkit-max-content) [bar]) repeat(2, [foo] 1em)&quot;, &quot;10px 20px 20px&quot;, &quot;60px 20px [bar foo] 10px [foo] 10px&quot;, &quot;minmax(10px, -webkit-min-content) 20px 20px&quot;, &quot;10% minmax(2em, -webkit-max-content) [bar] [foo] 1em [foo] 1em&quot;);
+
+    debug(&quot;&quot;);
+    debug(&quot;Test invalid repeat syntax.&quot;);
+    function testInvalidSyntax(gridColumn) {
+        element = document.createElement(&quot;div&quot;);
+        document.body.appendChild(element);
+        element.style.webkitGridTemplateColumns = gridColumn;
+        shouldBeEqualToString(&quot;window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns')&quot;, &quot;none&quot;);
+        document.body.removeChild(element);
+    }
+
+    testInvalidSyntax(&quot;repeat(auto-fill, 1fr)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, minmax(-webkit-min-content, 20px))&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, [bar] auto)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, 20px 10px)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, 20px [foo bar] 10px)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill,)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, [foo])&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, 1fr)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, minmax(-webkit-min-content, 20px))&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, [bar] auto)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, 20px 10px)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, 20px [foo bar] 10px)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit,)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, [foo])&quot;);
+
+    // &lt;auto-repeat&gt; can only be used once in a &lt;track-list&gt;.
+    testInvalidSyntax(&quot;repeat(auto-fill, 10px) repeat(auto-fill, [foo] 2em)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, 10em [bar]) auto repeat(auto-fill, [foo] 2em)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, 10px) repeat(auto-fit, [foo] 2em)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fit, 10em [bar]) auto repeat(auto-fit, [foo] 2em)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, [foo] 1em [bar]) auto repeat(auto-fit, [foo] 32px)&quot;);
+    testInvalidSyntax(&quot;repeat(auto-fill, 1em [bar]) repeat(3, -webkit-max-content [last]) repeat(auto-fit, 32px)&quot;);
+
+    // &lt;auto-repeat&gt; requires definite minimum track sizes.
+    testInvalidSyntax(&quot;repeat(auto-fill, 10px) repeat(10, minmax(-webkit-min-content, auto))&quot;);
+    testInvalidSyntax(&quot;auto repeat(auto-fit, [foo] 10px)&quot;);
+    testInvalidSyntax(&quot;10% repeat(auto-fit, [foo] 10px) -webkit-min-content&quot;);
+    testInvalidSyntax(&quot;20px [bar] repeat(4, auto) [foo] repeat(auto-fill, 3em)&quot;);
+&lt;/script&gt;
</ins><span class="cx">Property changes on: trunk/LayoutTests/fast/css-grid-layout/grid-element-auto-repeat-get-set.html
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svnmimetype"></a>
<div class="addfile"><h4>Added: svn:mime-type</h4></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCoreCMakeListstxt"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/CMakeLists.txt (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/CMakeLists.txt        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/CMakeLists.txt        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -1299,6 +1299,7 @@
</span><span class="cx">     css/CSSFontValue.cpp
</span><span class="cx">     css/CSSFunctionValue.cpp
</span><span class="cx">     css/CSSGradientValue.cpp
</span><ins>+    css/CSSGridAutoRepeatValue.cpp
</ins><span class="cx">     css/CSSGridLineNamesValue.cpp
</span><span class="cx">     css/CSSGridTemplateAreasValue.cpp
</span><span class="cx">     css/CSSGroupingRule.cpp
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/ChangeLog        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -1,3 +1,42 @@
</span><ins>+2016-03-17  Sergio Villar Senin  &lt;svillar@igalia.com&gt;
+
+        [css-grid] Add parsing support for &lt;auto-repeat&gt; syntax
+        https://bugs.webkit.org/show_bug.cgi?id=155583
+
+        Reviewed by Antti Koivisto.
+
+        The repeat() notation allows now to specify auto-fill or auto-fit instead of
+        a fixed number of repetitions meaning that it will be automatically computed
+        depending on the available space.
+
+        This patch just adds the parsing support, the expansion of the repeat notation
+        will be implemented in a follow up patch because it cannot be done at
+        parsing level (since it requires knowledge about the available space).
+
+        Test: fast/css-grid-layout/grid-element-auto-repeat-get-set.html
+
+        * CMakeLists.txt:
+        * css/CSSGridAutoRepeatValue.cpp: Added.
+        (WebCore::CSSGridAutoRepeatValue::customCSSText):
+        * css/CSSGridAutoRepeatValue.h: Added.
+        (WebCore::CSSGridAutoRepeatValue::create):
+        (WebCore::CSSGridAutoRepeatValue::autoRepeatID):
+        (WebCore::CSSGridAutoRepeatValue::CSSGridAutoRepeatValue):
+        * css/CSSParser.cpp:
+        (WebCore::allTracksAreFixedSized):
+        (WebCore::CSSParser::parseGridTrackList):
+        (WebCore::CSSParser::parseGridTrackRepeatFunction):
+        (WebCore::CSSParser::parseGridTrackSize):
+        (WebCore::CSSParser::parseGridBreadth):
+        * css/CSSParser.h:
+        * css/CSSValue.cpp:
+        (WebCore::CSSValue::equals):
+        (WebCore::CSSValue::cssText):
+        (WebCore::CSSValue::destroy):
+        * css/CSSValue.h:
+        (WebCore::CSSValue::isGridAutoRepeatValue):
+        * css/CSSValueKeywords.in:
+
</ins><span class="cx"> 2016-04-12  Yusuke Suzuki  &lt;utatane.tea@gmail.com&gt;
</span><span class="cx"> 
</span><span class="cx">         [JSC] addStaticGlobals should emit SymbolTableEntry watchpoints to encourage constant folding in DFG
</span></span></pre></div>
<a id="trunkSourceWebCoreWebCorexcodeprojprojectpbxproj"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/WebCore.xcodeproj/project.pbxproj        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -6334,6 +6334,8 @@
</span><span class="cx">                 E10B9B6D0B747599003ED890 /* NativeXPathNSResolver.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E10B9B6B0B747599003ED890 /* NativeXPathNSResolver.cpp */; };
</span><span class="cx">                 E10B9CCC0B747A44003ED890 /* DOMCustomXPathNSResolver.h in Headers */ = {isa = PBXBuildFile; fileRef = E10B9CCA0B747A44003ED890 /* DOMCustomXPathNSResolver.h */; };
</span><span class="cx">                 E10B9CCD0B747A44003ED890 /* DOMCustomXPathNSResolver.mm in Sources */ = {isa = PBXBuildFile; fileRef = E10B9CCB0B747A44003ED890 /* DOMCustomXPathNSResolver.mm */; };
</span><ins>+                E11003301C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E110032E1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp */; };
+                E11003311C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h in Headers */ = {isa = PBXBuildFile; fileRef = E110032F1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h */; };
</ins><span class="cx">                 E11AF15111B9A1A300805103 /* Cursor.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E11AF15011B9A1A300805103 /* Cursor.cpp */; };
</span><span class="cx">                 E11C9D9B0EB3681200E409DB /* ScriptExecutionContext.h in Headers */ = {isa = PBXBuildFile; fileRef = E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */; settings = {ATTRIBUTES = (Private, ); }; };
</span><span class="cx">                 E11C9DB00EB3699500E409DB /* ScriptExecutionContext.cpp in Sources */ = {isa = PBXBuildFile; fileRef = E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */; };
</span><span class="lines">@@ -14349,6 +14351,8 @@
</span><span class="cx">                 E10B9B6B0B747599003ED890 /* NativeXPathNSResolver.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = NativeXPathNSResolver.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E10B9CCA0B747A44003ED890 /* DOMCustomXPathNSResolver.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = DOMCustomXPathNSResolver.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E10B9CCB0B747A44003ED890 /* DOMCustomXPathNSResolver.mm */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.objcpp; path = DOMCustomXPathNSResolver.mm; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><ins>+                E110032E1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = CSSGridAutoRepeatValue.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
+                E110032F1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = CSSGridAutoRepeatValue.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</ins><span class="cx">                 E11AF15011B9A1A300805103 /* Cursor.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = Cursor.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E11C9D9A0EB3681200E409DB /* ScriptExecutionContext.h */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.c.h; path = ScriptExecutionContext.h; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="cx">                 E11C9DAF0EB3699500E409DB /* ScriptExecutionContext.cpp */ = {isa = PBXFileReference; fileEncoding = 4; lastKnownFileType = sourcecode.cpp.cpp; path = ScriptExecutionContext.cpp; sourceTree = &quot;&lt;group&gt;&quot;; };
</span><span class="lines">@@ -23547,6 +23551,8 @@
</span><span class="cx">                 F523D18402DE42E8018635CA /* css */ = {
</span><span class="cx">                         isa = PBXGroup;
</span><span class="cx">                         children = (
</span><ins>+                                E110032E1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp */,
+                                E110032F1C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h */,
</ins><span class="cx">                                 FBD6AF8415EF21D4008B7110 /* BasicShapeFunctions.cpp */,
</span><span class="cx">                                 FBD6AF8515EF21D4008B7110 /* BasicShapeFunctions.h */,
</span><span class="cx">                                 A80E6CDA0A1989CA007FB8C5 /* Counter.h */,
</span><span class="lines">@@ -27655,6 +27661,7 @@
</span><span class="cx">                                 934F713C0D5A6F1900018D69 /* ResourceErrorBase.h in Headers */,
</span><span class="cx">                                 514C76790CE923A1007EF3CD /* ResourceHandle.h in Headers */,
</span><span class="cx">                                 26FAE4CD1852E3A5004C8C46 /* ResourceHandleCFURLConnectionDelegate.h in Headers */,
</span><ins>+                                E11003311C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.h in Headers */,
</ins><span class="cx">                                 26C15CF71857E15E00F15C03 /* ResourceHandleCFURLConnectionDelegateWithOperationQueue.h in Headers */,
</span><span class="cx">                                 514C767A0CE923A1007EF3CD /* ResourceHandleClient.h in Headers */,
</span><span class="cx">                                 514C767B0CE923A1007EF3CD /* ResourceHandleInternal.h in Headers */,
</span><span class="lines">@@ -29327,6 +29334,7 @@
</span><span class="cx">                                 FEB26D28167A8F2A00FDD26B /* DatabaseServer.cpp in Sources */,
</span><span class="cx">                                 97BC6A2D1505F081001B74AC /* DatabaseTask.cpp in Sources */,
</span><span class="cx">                                 97BC6A2F1505F081001B74AC /* DatabaseThread.cpp in Sources */,
</span><ins>+                                E11003301C9AC3DE00412DD0 /* CSSGridAutoRepeatValue.cpp in Sources */,
</ins><span class="cx">                                 97BC6A311505F081001B74AC /* DatabaseTracker.cpp in Sources */,
</span><span class="cx">                                 BE23480C18A9870B00E4B6E8 /* DataCue.cpp in Sources */,
</span><span class="cx">                                 C5227DF21C3C6DF900F5ED54 /* DataDetection.mm in Sources */,
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSGridAutoRepeatValuecpp"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSGridAutoRepeatValue.cpp (0 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGridAutoRepeatValue.cpp                                (rev 0)
+++ trunk/Source/WebCore/css/CSSGridAutoRepeatValue.cpp        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -0,0 +1,53 @@
</span><ins>+/*
+ * Copyright (C) 2016 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#include &quot;config.h&quot;
+#include &quot;CSSGridAutoRepeatValue.h&quot;
+
+#if ENABLE(CSS_GRID_LAYOUT)
+
+#include &lt;wtf/text/StringBuilder.h&gt;
+
+namespace WebCore {
+
+String CSSGridAutoRepeatValue::customCSSText() const
+{
+    StringBuilder result;
+    result.append(&quot;repeat(&quot;);
+    result.append(getValueName(autoRepeatID()));
+    result.append(&quot;, &quot;);
+    result.append(CSSValueList::customCSSText());
+    result.append(&quot;)&quot;);
+    return result.toString();
+}
+
+} // namespace WebCore
+
+#endif // ENABLE(CSS_GRID_LAYOUT)
</ins><span class="cx">Property changes on: trunk/Source/WebCore/css/CSSGridAutoRepeatValue.cpp
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCorecssCSSGridAutoRepeatValueh"></a>
<div class="addfile"><h4>Added: trunk/Source/WebCore/css/CSSGridAutoRepeatValue.h (0 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSGridAutoRepeatValue.h                                (rev 0)
+++ trunk/Source/WebCore/css/CSSGridAutoRepeatValue.h        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -0,0 +1,79 @@
</span><ins>+/*
+ * Copyright (C) 2016 Igalia S.L.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions are
+ * met:
+ *
+ *     * Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ *     * Redistributions in binary form must reproduce the above
+ * copyright notice, this list of conditions and the following disclaimer
+ * in the documentation and/or other materials provided with the
+ * distribution.
+ *     * Neither the name of Google Inc. nor the names of its
+ * contributors may be used to endorse or promote products derived from
+ * this software without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
+ * &quot;AS IS&quot; AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
+ * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
+ * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
+ * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
+ * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
+ * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
+ * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
+ * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
+ * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
+ * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
+ */
+
+#ifndef CSSGridAutoRepeatValue_h
+#define CSSGridAutoRepeatValue_h
+
+#if ENABLE(CSS_GRID_LAYOUT)
+
+#include &quot;CSSValueKeywords.h&quot;
+#include &quot;CSSValueList.h&quot;
+
+namespace WebCore {
+
+// CSSGridAutoRepeatValue stores the track sizes and line numbers when the auto-repeat
+// syntax is used
+//
+// Right now the auto-repeat syntax is as follows:
+// &lt;auto-repeat&gt;  = repeat( [ auto-fill | auto-fit ], &lt;line-names&gt;? &lt;fixed-size&gt; &lt;line-names&gt;? )
+//
+// meaning that only one fixed size track is allowed. It could be argued that a different
+// class storing two CSSGridLineNamesValue and one CSSValue (for the track size) fits
+// better but the CSSWG has left the door open to allow more than one track in the
+// future. That's why we're using a list, it's prepared for future changes and it also
+// allows us to keep the parsing algorithm almost intact.
+class CSSGridAutoRepeatValue : public CSSValueList {
+public:
+    static Ref&lt;CSSGridAutoRepeatValue&gt; create(CSSValueID id)
+    {
+        return adoptRef(*new CSSGridAutoRepeatValue(id));
+    }
+
+    String customCSSText() const;
+    CSSValueID autoRepeatID() const { return m_autoRepeatID; }
+
+private:
+    CSSGridAutoRepeatValue(CSSValueID id)
+        : CSSValueList(GridAutoRepeatClass, SpaceSeparator)
+        , m_autoRepeatID(id)
+    {
+        ASSERT(id == CSSValueAutoFill || id == CSSValueAutoFit);
+    }
+
+    const CSSValueID m_autoRepeatID;
+};
+
+} // namespace WebCore
+
+SPECIALIZE_TYPE_TRAITS_CSS_VALUE(CSSGridAutoRepeatValue, isGridAutoRepeatValue());
+
+#endif // ENABLE(CSS_GRID_LAYOUT)
+
+#endif // CSSGridAutoRepeatValue_h
</ins><span class="cx">Property changes on: trunk/Source/WebCore/css/CSSGridAutoRepeatValue.h
</span><span class="cx">___________________________________________________________________
</span></span></pre></div>
<a id="svneolstyle"></a>
<div class="addfile"><h4>Added: svn:eol-style</h4></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -109,6 +109,7 @@
</span><span class="cx"> #include &lt;wtf/text/StringImpl.h&gt;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+#include &quot;CSSGridAutoRepeatValue.h&quot;
</ins><span class="cx"> #include &quot;CSSGridLineNamesValue.h&quot;
</span><span class="cx"> #include &quot;CSSGridTemplateAreasValue.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -5840,6 +5841,28 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+static bool allTracksAreFixedSized(CSSValueList&amp; valueList)
+{
+    for (auto&amp; value : valueList) {
+        if (is&lt;CSSGridLineNamesValue&gt;(value))
+            continue;
+        // The auto-repeat value holds a &lt;fixed-size&gt; = &lt;fixed-breadth&gt; | minmax( &lt;fixed-breadth&gt;, &lt;track-breadth&gt; )
+        if (is&lt;CSSGridAutoRepeatValue&gt;(value)) {
+            if (!allTracksAreFixedSized(downcast&lt;CSSValueList&gt;(value.get())))
+                return false;
+            continue;
+        }
+        ASSERT(value-&gt;isPrimitiveValue() || (value-&gt;isFunctionValue() &amp;&amp; downcast&lt;CSSFunctionValue&gt;(value.get()).arguments()));
+        const CSSPrimitiveValue&amp; primitiveValue = value-&gt;isPrimitiveValue()
+            ? downcast&lt;CSSPrimitiveValue&gt;(value.get())
+            : downcast&lt;CSSPrimitiveValue&gt;(*downcast&lt;CSSFunctionValue&gt;(value.get()).arguments()-&gt;item(0));
+        CSSValueID valueID = primitiveValue.getValueID();
+        if (valueID == CSSValueWebkitMinContent || valueID == CSSValueWebkitMaxContent || valueID == CSSValueAuto || primitiveValue.isFlex())
+            return false;
+    }
+    return true;
+}
+
</ins><span class="cx"> RefPtr&lt;CSSValue&gt; CSSParser::parseGridTrackList()
</span><span class="cx"> {
</span><span class="cx">     CSSParserValue* value = m_valueList-&gt;current();
</span><span class="lines">@@ -5855,14 +5878,19 @@
</span><span class="cx">         parseGridLineNames(*m_valueList, *values);
</span><span class="cx"> 
</span><span class="cx">     bool seenTrackSizeOrRepeatFunction = false;
</span><ins>+    bool seenAutoRepeat = false;
</ins><span class="cx">     while (CSSParserValue* currentValue = m_valueList-&gt;current()) {
</span><span class="cx">         if (isForwardSlashOperator(*currentValue))
</span><span class="cx">             break;
</span><span class="cx">         if (currentValue-&gt;unit == CSSParserValue::Function &amp;&amp; equalLettersIgnoringASCIICase(currentValue-&gt;function-&gt;name, &quot;repeat(&quot;)) {
</span><del>-            if (!parseGridTrackRepeatFunction(*values))
</del><ins>+            bool isAutoRepeat;
+            if (!parseGridTrackRepeatFunction(*values, isAutoRepeat))
</ins><span class="cx">                 return nullptr;
</span><ins>+            if (isAutoRepeat &amp;&amp; seenAutoRepeat)
+                return nullptr;
+            seenAutoRepeat = seenAutoRepeat || isAutoRepeat;
</ins><span class="cx">         } else {
</span><del>-            RefPtr&lt;CSSValue&gt; value = parseGridTrackSize(*m_valueList);
</del><ins>+            RefPtr&lt;CSSValue&gt; value = parseGridTrackSize(*m_valueList, seenAutoRepeat ? FixedSizeOnly : AllowAll);
</ins><span class="cx">             if (!value)
</span><span class="cx">                 return nullptr;
</span><span class="cx">             values-&gt;append(value.releaseNonNull());
</span><span class="lines">@@ -5878,24 +5906,33 @@
</span><span class="cx">     if (!seenTrackSizeOrRepeatFunction)
</span><span class="cx">         return nullptr;
</span><span class="cx"> 
</span><ins>+    // &lt;auto-repeat&gt; requires definite minimum track sizes in order to compute the number of repetitions.
+    // The above while loop detects those appearances after the &lt;auto-repeat&gt; but not the ones before.
+    if (seenAutoRepeat &amp;&amp; !allTracksAreFixedSized(*values))
+        return nullptr;
+
</ins><span class="cx">     return values;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CSSParser::parseGridTrackRepeatFunction(CSSValueList&amp; list)
</del><ins>+bool CSSParser::parseGridTrackRepeatFunction(CSSValueList&amp; list, bool&amp; isAutoRepeat)
</ins><span class="cx"> {
</span><span class="cx">     CSSParserValueList* arguments = m_valueList-&gt;current()-&gt;function-&gt;args.get();
</span><del>-    if (!arguments || arguments-&gt;size() &lt; 3)
</del><ins>+    if (!arguments || arguments-&gt;size() &lt; 3 || !isComma(arguments-&gt;valueAt(1)))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     ValueWithCalculation firstValueWithCalculation(*arguments-&gt;valueAt(0));
</span><del>-    if (!validateUnit(firstValueWithCalculation, FPositiveInteger) || !isComma(arguments-&gt;valueAt(1)))
</del><ins>+    CSSValueID firstValueID = firstValueWithCalculation.value().id;
+    isAutoRepeat = firstValueID == CSSValueAutoFill || firstValueID == CSSValueAutoFit;
+    if (!isAutoRepeat &amp;&amp; !validateUnit(firstValueWithCalculation, FPositiveInteger))
</ins><span class="cx">         return false;
</span><span class="cx"> 
</span><span class="cx">     // If arguments-&gt;valueAt(0)-&gt;fValue &gt; SIZE_MAX then repetitions becomes 0 during the type casting, that's why we
</span><span class="cx">     // clamp it down to kGridMaxTracks before the type casting.
</span><del>-    unsigned repetitions = clampTo&lt;unsigned&gt;(parsedDouble(firstValueWithCalculation), 0, kGridMaxTracks);
</del><ins>+    // The number of repetitions for &lt;auto-repeat&gt; is not important at parsing level
+    // because it will be computed later, let's set it to 1.
+    unsigned repetitions = isAutoRepeat ? 1 : clampTo&lt;unsigned&gt;(parsedDouble(firstValueWithCalculation), 0, kGridMaxTracks);
</ins><span class="cx"> 
</span><del>-    RefPtr&lt;CSSValueList&gt; repeatedValues = CSSValueList::createSpaceSeparated();
</del><ins>+    RefPtr&lt;CSSValueList&gt; repeatedValues = isAutoRepeat ? CSSGridAutoRepeatValue::create(firstValueID).get() : CSSValueList::createSpaceSeparated();
</ins><span class="cx">     arguments-&gt;next(); // Skip the repetition count.
</span><span class="cx">     arguments-&gt;next(); // Skip the comma.
</span><span class="cx"> 
</span><span class="lines">@@ -5905,8 +5942,12 @@
</span><span class="cx">         parseGridLineNames(*arguments, *repeatedValues);
</span><span class="cx"> 
</span><span class="cx">     unsigned numberOfTracks = 0;
</span><ins>+    TrackSizeRestriction restriction = isAutoRepeat ? FixedSizeOnly : AllowAll;
</ins><span class="cx">     while (arguments-&gt;current()) {
</span><del>-        RefPtr&lt;CSSValue&gt; trackSize = parseGridTrackSize(*arguments);
</del><ins>+        if (isAutoRepeat &amp;&amp; numberOfTracks)
+            return false;
+
+        RefPtr&lt;CSSValue&gt; trackSize = parseGridTrackSize(*arguments, restriction);
</ins><span class="cx">         if (!trackSize)
</span><span class="cx">             return false;
</span><span class="cx"> 
</span><span class="lines">@@ -5936,7 +5977,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSValue&gt; CSSParser::parseGridTrackSize(CSSParserValueList&amp; inputList)
</del><ins>+RefPtr&lt;CSSValue&gt; CSSParser::parseGridTrackSize(CSSParserValueList&amp; inputList, TrackSizeRestriction restriction)
</ins><span class="cx"> {
</span><span class="cx">     CSSParserValue&amp; currentValue = *inputList.current();
</span><span class="cx">     inputList.next();
</span><span class="lines">@@ -5950,7 +5991,7 @@
</span><span class="cx">         if (!arguments || arguments-&gt;size() != 3 || !isComma(arguments-&gt;valueAt(1)))
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><del>-        RefPtr&lt;CSSPrimitiveValue&gt; minTrackBreadth = parseGridBreadth(*arguments-&gt;valueAt(0));
</del><ins>+        RefPtr&lt;CSSPrimitiveValue&gt; minTrackBreadth = parseGridBreadth(*arguments-&gt;valueAt(0), restriction);
</ins><span class="cx">         if (!minTrackBreadth)
</span><span class="cx">             return nullptr;
</span><span class="cx"> 
</span><span class="lines">@@ -5964,15 +6005,21 @@
</span><span class="cx">         return CSSFunctionValue::create(&quot;minmax(&quot;, parsedArguments);
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    return parseGridBreadth(currentValue);
</del><ins>+    return parseGridBreadth(currentValue, restriction);
</ins><span class="cx"> }
</span><span class="cx"> 
</span><del>-RefPtr&lt;CSSPrimitiveValue&gt; CSSParser::parseGridBreadth(CSSParserValue&amp; value)
</del><ins>+RefPtr&lt;CSSPrimitiveValue&gt; CSSParser::parseGridBreadth(CSSParserValue&amp; value, TrackSizeRestriction restriction)
</ins><span class="cx"> {
</span><del>-    if (value.id == CSSValueWebkitMinContent || value.id == CSSValueWebkitMaxContent || value.id == CSSValueAuto)
</del><ins>+    if (value.id == CSSValueWebkitMinContent || value.id == CSSValueWebkitMaxContent || value.id == CSSValueAuto) {
+        if (restriction == FixedSizeOnly)
+            return nullptr;
</ins><span class="cx">         return CSSValuePool::singleton().createIdentifierValue(value.id);
</span><ins>+    }
</ins><span class="cx"> 
</span><span class="cx">     if (value.unit == CSSPrimitiveValue::CSS_FR) {
</span><ins>+        if (restriction == FixedSizeOnly)
+            return nullptr;
+
</ins><span class="cx">         double flexValue = value.fValue;
</span><span class="cx"> 
</span><span class="cx">         // Fractional unit is a non-negative dimension.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/css/CSSParser.h        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -218,9 +218,10 @@
</span><span class="cx">     bool parseGridGapShorthand(bool important);
</span><span class="cx">     bool parseSingleGridAreaLonghand(RefPtr&lt;CSSValue&gt;&amp;);
</span><span class="cx">     RefPtr&lt;CSSValue&gt; parseGridTrackList();
</span><del>-    bool parseGridTrackRepeatFunction(CSSValueList&amp;);
-    RefPtr&lt;CSSValue&gt; parseGridTrackSize(CSSParserValueList&amp; inputList);
-    RefPtr&lt;CSSPrimitiveValue&gt; parseGridBreadth(CSSParserValue&amp;);
</del><ins>+    bool parseGridTrackRepeatFunction(CSSValueList&amp;, bool&amp; isAutoRepeat);
+    enum TrackSizeRestriction { FixedSizeOnly, AllowAll };
+    RefPtr&lt;CSSValue&gt; parseGridTrackSize(CSSParserValueList&amp; inputList, TrackSizeRestriction = AllowAll);
+    RefPtr&lt;CSSPrimitiveValue&gt; parseGridBreadth(CSSParserValue&amp;, TrackSizeRestriction = AllowAll);
</ins><span class="cx">     bool parseGridTemplateAreasRow(NamedGridAreaMap&amp;, const unsigned, unsigned&amp;);
</span><span class="cx">     RefPtr&lt;CSSValue&gt; parseGridTemplateAreas();
</span><span class="cx">     bool parseGridLineNames(CSSParserValueList&amp;, CSSValueList&amp;, CSSGridLineNamesValue* = nullptr);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValuecpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.cpp (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.cpp        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/css/CSSValue.cpp        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -65,6 +65,7 @@
</span><span class="cx"> #include &quot;WebKitCSSTransformValue.h&quot;
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+#include &quot;CSSGridAutoRepeatValue.h&quot;
</ins><span class="cx"> #include &quot;CSSGridLineNamesValue.h&quot;
</span><span class="cx"> #include &quot;CSSGridTemplateAreasValue.h&quot;
</span><span class="cx"> #endif
</span><span class="lines">@@ -208,6 +209,8 @@
</span><span class="cx">         case RevertClass:
</span><span class="cx">             return compareCSSValues&lt;CSSRevertValue&gt;(*this, other);
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+        case GridAutoRepeatClass:
+            return compareCSSValues&lt;CSSGridAutoRepeatValue&gt;(*this, other);
</ins><span class="cx">         case GridLineNamesClass:
</span><span class="cx">             return compareCSSValues&lt;CSSGridLineNamesValue&gt;(*this, other);
</span><span class="cx">         case GridTemplateAreasClass:
</span><span class="lines">@@ -312,6 +315,8 @@
</span><span class="cx">     case RevertClass:
</span><span class="cx">         return downcast&lt;CSSRevertValue&gt;(*this).customCSSText();
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+    case GridAutoRepeatClass:
+        return downcast&lt;CSSGridAutoRepeatValue&gt;(*this).customCSSText();
</ins><span class="cx">     case GridLineNamesClass:
</span><span class="cx">         return downcast&lt;CSSGridLineNamesValue&gt;(*this).customCSSText();
</span><span class="cx">     case GridTemplateAreasClass:
</span><span class="lines">@@ -427,6 +432,9 @@
</span><span class="cx">         delete downcast&lt;CSSRevertValue&gt;(this);
</span><span class="cx">         return;
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+    case GridAutoRepeatClass:
+        delete downcast&lt;CSSGridAutoRepeatValue&gt;(this);
+        return;
</ins><span class="cx">     case GridLineNamesClass:
</span><span class="cx">         delete downcast&lt;CSSGridLineNamesValue&gt;(this);
</span><span class="cx">         return;
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValue.h (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValue.h        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/css/CSSValue.h        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -111,6 +111,7 @@
</span><span class="cx">     bool isWebKitCSSFilterValue() const { return m_classType == WebKitCSSFilterClass; }
</span><span class="cx">     bool isContentDistributionValue() const { return m_classType == CSSContentDistributionClass; }
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+    bool isGridAutoRepeatValue() const { return m_classType == GridAutoRepeatClass; }
</ins><span class="cx">     bool isGridTemplateAreasValue() const { return m_classType == GridTemplateAreasClass; }
</span><span class="cx">     bool isGridLineNamesValue() const { return m_classType == GridLineNamesClass; }
</span><span class="cx"> #endif
</span><span class="lines">@@ -202,6 +203,7 @@
</span><span class="cx">         WebKitCSSTransformClass,
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx">         GridLineNamesClass,
</span><ins>+        GridAutoRepeatClass,
</ins><span class="cx"> #endif
</span><span class="cx">         // Do not append non-list class types here.
</span><span class="cx">     };
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSValueKeywordsin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSValueKeywords.in (199342 => 199343)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSValueKeywords.in        2016-04-12 08:25:48 UTC (rev 199342)
+++ trunk/Source/WebCore/css/CSSValueKeywords.in        2016-04-12 12:21:57 UTC (rev 199343)
</span><span class="lines">@@ -1201,3 +1201,9 @@
</span><span class="cx"> // color-gamut
</span><span class="cx"> p3
</span><span class="cx"> rec2020
</span><ins>+
+#if defined(ENABLE_CSS_GRID_LAYOUT) &amp;&amp; ENABLE_CSS_GRID_LAYOUT
+// auto-repeat
+auto-fill
+auto-fit
+#endif
</ins></span></pre>
</div>
</div>

</body>
</html>