<!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>[167799] 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/167799">167799</a></dd>
<dt>Author</dt> <dd>commit-queue@webkit.org</dd>
<dt>Date</dt> <dd>2014-04-25 05:06:53 -0700 (Fri, 25 Apr 2014)</dd>
</dl>

<h3>Log Message</h3>
<pre>[CSS Grid Layout] Implementation of the grid-template shorthand.
https://bugs.webkit.org/show_bug.cgi?id=128980

Patch by Javier Fernandez &lt;jfernandez@igalia.com&gt; on 2014-04-25
Reviewed by Darin Adler.

Source/WebCore:
This shorthand sets the values for the grid-template-columns,
grid-template-rows and grid-template-areas, so the implementation
tries to reuse as much available parsing functions as possible.

The &quot;parsingGridTrackList&quot; was refactored to return a CSSValue and
let the &quot;parseValue&quot; function to assign the property value. The
&quot;forwardSlash&quot; operator is now valid when the track-list clause is
part of a shorthand. The &quot;parseValue&quot; function checkouts that only
additional clauses are allowed when processing shorthands; the
grid-columns-rows-get-set.html tests was modified to verify this.

The &quot;parseGridTemplateAreas&quot; was refactored too, in order to
process single areas's rows. This is very useful for the
gris-template secondary syntax, which mixes areas and rows values.

Finally, the &quot;parseGirdLineNames&quot; function was modified as well by
defining an new argument to concatenate head/tail custom-ident
elements and ensure the identList is at the heading index, since
it's now possible the parseList was rewound.

The implementation of the grid-template shorthand tries first to
match the &lt;grid-template-columns&gt; / &lt;grid-template-rows&gt; syntax,
failing back to the secondary syntax if needed.  This approach
requires to rewind the parseList but it produces a clearer code.

Test: fast/css-grid-layout/grid-template-shorthand-get-set.html

* css/CSSComputedStyleDeclaration.cpp:
(WebCore::ComputedStyleExtractor::propertyValue):
* css/CSSParser.cpp:
(WebCore::CSSParser::parseValue):
(WebCore::CSSParser::parseGridTemplateRowsAndAreas):
(WebCore::CSSParser::parseGridTemplateShorthand):
(WebCore::CSSParser::parseGridLineNames):
(WebCore::CSSParser::parseGridTrackList):
(WebCore::CSSParser::parseGridTemplateAreasRow):
(WebCore::CSSParser::parseGridTemplateAreas):
* css/CSSParser.h:
* css/CSSParserValues.h:
(WebCore::CSSParserValueList::setCurrentIndex):
* css/CSSPropertyNames.in:
* css/StylePropertyShorthand.cpp:
(WebCore::webkitGridTemplateShorthand):
* css/StylePropertyShorthand.h:

LayoutTests:
Layout Test for the basic functionality of the grid-template shorthand. It was
also added a new javascript file with some utility functions.

This shorthand sets the values for the grid-template-columns,
grid-template-rows and grid-template-areas, so the implementation
tries to reuse as much available parsing functions as possible.

* fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt: Added.
* fast/css-grid-layout/grid-template-shorthand-get-set.html: Added.
* fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js: Added.
(testGridDefinitionsValues):
(testGridDefinitionsSetJSValues):
(testNonGridDefinitionsSetJSValues):
(checkGridDefinitionsSetJSValues):
(testGridDefinitionsSetBadJSValues):</pre>

<h3>Modified Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsChangeLog">trunk/LayoutTests/ChangeLog</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="#trunkSourceWebCorecssCSSParserh">trunk/Source/WebCore/css/CSSParser.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSParserValuesh">trunk/Source/WebCore/css/CSSParserValues.h</a></li>
<li><a href="#trunkSourceWebCorecssCSSPropertyNamesin">trunk/Source/WebCore/css/CSSPropertyNames.in</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertyShorthandcpp">trunk/Source/WebCore/css/StylePropertyShorthand.cpp</a></li>
<li><a href="#trunkSourceWebCorecssStylePropertyShorthandh">trunk/Source/WebCore/css/StylePropertyShorthand.h</a></li>
</ul>

<h3>Added Paths</h3>
<ul>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridtemplateshorthandgetsetexpectedtxt">trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutgridtemplateshorthandgetsethtml">trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html</a></li>
<li><a href="#trunkLayoutTestsfastcssgridlayoutresourcesgridtemplateshorthandparsingutilsjs">trunk/LayoutTests/fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js</a></li>
</ul>

</div>
<div id="patch">
<h3>Diff</h3>
<a id="trunkLayoutTestsChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/LayoutTests/ChangeLog (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/ChangeLog        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/LayoutTests/ChangeLog        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -1,3 +1,26 @@
</span><ins>+2014-04-25  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Grid Layout] Implementation of the grid-template shorthand.
+        https://bugs.webkit.org/show_bug.cgi?id=128980
+
+        Reviewed by Darin Adler.
+
+        Layout Test for the basic functionality of the grid-template shorthand. It was
+        also added a new javascript file with some utility functions.
+
+        This shorthand sets the values for the grid-template-columns,
+        grid-template-rows and grid-template-areas, so the implementation
+        tries to reuse as much available parsing functions as possible.
+
+        * fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt: Added.
+        * fast/css-grid-layout/grid-template-shorthand-get-set.html: Added.
+        * fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js: Added.
+        (testGridDefinitionsValues):
+        (testGridDefinitionsSetJSValues):
+        (testNonGridDefinitionsSetJSValues):
+        (checkGridDefinitionsSetJSValues):
+        (testGridDefinitionsSetBadJSValues):
+
</ins><span class="cx"> 2014-04-25  Antoine Quint  &lt;graouts@webkit.org&gt;
</span><span class="cx"> 
</span><span class="cx">         Implement Array.prototype.find()
</span></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridtemplateshorthandgetsetexpectedtxt"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt (0 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -0,0 +1,170 @@
</span><ins>+This test checks that the 'grid-template' shorthand is properly parsed and the longhand properties correctly assigned.
+
+On success, you will see a series of &quot;PASS&quot; messages, followed by &quot;TEST COMPLETE&quot;.
+
+
+Test getting grid-template-areas set through CSS.
+PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('-webkit-grid-template-rows') is &quot;15px&quot;
+PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-rows') is &quot;15px&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('-webkit-grid-template-rows') is &quot;15px&quot;
+PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot;&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-rows') is &quot;(head) 15px (tail)&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot;&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-rows') is &quot;(head) 15px (tail)&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a b\&quot;&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-rows') is &quot;(head1) 15px (tail1 head2) 20px (tail2)&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot; \&quot;b\&quot;&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is &quot;(first) 10px (nav nav2) 15px (nav nav2) 15px&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is &quot;100px (nav nav2) 25px (nav nav2) 25px (last)&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a b c\&quot; \&quot;d e f\&quot; \&quot;g h i\&quot;&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-rows') is &quot;0px&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot;&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-rows') is &quot;0px&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot;&quot;
+
+Test getting wrong values for grid-template shorthand through CSS (they should resolve to the default: 'none')
+PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+
+Test the initial value
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is 'none'
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is 'none'
+
+Test setting grid-template-columns and grid-template-rows back to 'none' through JS
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;10px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;(line) 20px&quot;
+PASS element.style.webkitGridTemplateRows is &quot;(line) 20px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot;&quot;
+PASS element.style.webkitGridTemplateAreas is &quot;\&quot;a\&quot;&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;none&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS element.style.webkitGridTemplateRows is &quot;none&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS element.style.webkitGridTemplateAreas is &quot;none&quot;
+
+Test getting and setting grid-template shorthand through JS
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;18px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;18px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;66px&quot;
+PASS element.style.webkitGridTemplateRows is &quot;66px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS element.style.webkitGridTemplateAreas is &quot;none&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;10px&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;10px&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;(head) 15px (tail)&quot;
+PASS element.style.webkitGridTemplateRows is &quot;(head) 15px (tail)&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot;&quot;
+PASS element.style.webkitGridTemplateAreas is &quot;\&quot;a\&quot;&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS element.style.webkitGridTemplateColumns is &quot;none&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;0px&quot;
+PASS element.style.webkitGridTemplateRows is &quot;auto&quot;
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is &quot;\&quot;a\&quot;&quot;
+PASS element.style.webkitGridTemplateAreas is &quot;\&quot;a\&quot;&quot;
+
+Test setting grid-template shorthand to bad values through JS
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') 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-rows') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') 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-rows') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') 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-rows') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') 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-rows') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') 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-rows') is &quot;none&quot;
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is &quot;none&quot;
+PASS successfullyParsed is true
+
+TEST COMPLETE
+
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutgridtemplateshorthandgetsethtml"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html (0 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -0,0 +1,221 @@
</span><ins>+&lt;!DOCTYPE HTML PUBLIC &quot;-//IETF//DTD HTML//EN&quot;&gt;
+&lt;html&gt;
+&lt;head&gt;
+&lt;script&gt;
+if (window.testRunner)
+    testRunner.overridePreference(&quot;WebKitCSSGridLayoutEnabled&quot;, 1);
+&lt;/script&gt;
+&lt;link href=&quot;resources/grid.css&quot; rel=&quot;stylesheet&quot;&gt;
+&lt;style&gt;
+#gridTemplateWithNone {
+    -webkit-grid-template: none;
+}
+#gridTemplateSimpleForm {
+    -webkit-grid-template: 10px / 15px;
+}
+#gridTemplateSimpleFormWithNoneColumns {
+    -webkit-grid-template: none / 15px;
+}
+#gridTemplateSimpleFormWithNoneRows {
+    -webkit-grid-template: 10px / none;
+}
+#gridTemplateSimpleFormWithNone {
+    -webkit-grid-template: none / none;
+}
+#gridTemplateComplexForm {
+    -webkit-grid-template: 10px / &quot;a&quot; 15px;
+}
+#gridTemplateComplexFormWithLineNames {
+    -webkit-grid-template: 10px / (head) &quot;a&quot; 15px (tail);
+}
+#gridTemplateComplexFormWithLineNamesMultipleColumns {
+    -webkit-grid-template: 10px / (head) &quot;a b&quot; 15px (tail)
+}
+#gridTemplateComplexFormWithLineNamesMultipleRows {
+    -webkit-grid-template: 10px / (head1) &quot;a&quot; 15px (tail1)
+                          (head2) &quot;b&quot; 20px (tail2);
+}
+#gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns {
+    -webkit-grid-template: (first) 10px repeat(2, (nav nav2) 15px) /       &quot;a b c&quot; 100px (nav)
+                                                            (nav2) &quot;d e f&quot; 25px  (nav)
+                                                            (nav2) &quot;g h i&quot; 25px  (last);
+}
+#gridTemplateComplexFormWithAuto {
+    -webkit-grid-template: 10px / &quot;a&quot;;
+}
+#gridTemplateComplexFormOnlyAreas {
+    -webkit-grid-template: &quot;a&quot;;
+}
+
+/* Bad values. */
+
+#gridTemplateMultipleSlash {
+    -webkit-grid-template: 10px / 20px / 30px;
+}
+#gridTemplateSimpleFormJustColumns {
+    -webkit-grid-template: 10px;
+}
+#gridTemplateSimpleFormNoRows {
+    -webkit-grid-template: 10px /;
+}
+#gridTemplateSimpleFormNoColumns {
+    -webkit-grid-template: / 10px;
+}
+#gridTemplateSimpleFormNoColumnSize {
+    -webkit-grid-template: (line) / 10px;
+}
+#gridTemplateSimpleFormWithFitContent {
+    -webkit-grid-template: -webkit-fit-content / 10px;
+}
+#gridTemplateSimpleFormWithWrongRepeat {
+    -webkit-grid-template: repeat(2, 50% (title) a) / 10px;
+}
+#gridTemplateSimpleFormWithMisplacedNone1 {
+    -webkit-grid-template: 10px / none 20px;
+}
+#gridTemplateSimpleFormWithMisplacedNone2 {
+    -webkit-grid-template: 10px / 20px none;
+}
+#gridTemplateSimpleFormWithMisplacedNone3 {
+    -webkit-grid-template: none 10px / 20px;
+}
+#gridTemplateSimpleFormWithMisplacedNone4 {
+    -webkit-grid-template: 10px none / 20px;
+}
+#gridTemplateComplexFormWithRepeat {
+    -webkit-grid-template: 10px / &quot;a&quot; repeat(2, 50% (title));
+}
+#gridTemplateComplexFormWithWrongRepeat {
+    -webkit-grid-template: repeat(2, 50% (title) a) / &quot;a&quot;;
+}
+#griTemplateComplexFormdWithFitAvailable {
+    -webkit-grid-template: -webkit-fit-available / &quot;a&quot;;
+}
+#gridTemplateComplexFormNoColumnSize {
+    -webkit-grid-template: (line) / &quot;a&quot;;
+}
+#gridTemplateComplexFormMisplacedRowsSize1 {
+    -webkit-grid-template: 25px / 10px &quot;a&quot;;
+}
+#gridTemplateComplexFormMisplacedRowsSize2 {
+    -webkit-grid-template: 25px / &quot;a&quot; (name) 10px;
+}
+#gridTemplateComplexFormColumnsNotParsing1 {
+    -webkit-grid-template: a / &quot;a&quot; (name) 10px;
+}
+#gridTemplateComplexFormColumnsNotParsing2 {
+    -webkit-grid-template: &quot;B&quot; / &quot;a&quot; (name) 10px;
+}
+#gridTemplateComplexFormWithNoneColumns {
+    -webkit-grid-template: none / &quot;a&quot; (name) 10px;
+}
+
+&lt;/style&gt;
+&lt;script src=&quot;../../resources/js-test.js&quot;&gt;&lt;/script&gt;
+&lt;/head&gt;
+&lt;body&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateWithNone&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleForm&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithNoneColumns&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithNoneRows&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithNone&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexForm&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithLineNames&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithLineNamesMultipleColumns&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithLineNamesMultipleRows&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithAuto&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormOnlyAreas&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateMultipleSlash&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormJustColumns&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormNoRows&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormNoColumns&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormNoColumnSize&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithFitContent&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithWrongRepeat&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithMisplacedNone1&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithMisplacedNone2&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithMisplacedNone3&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateSimpleFormWithMisplacedNone4&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithRepeat&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithWrongRepeat&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;griTemplateComplexFormdWithFitAvailable&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormNoColumnSize&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormMisplacedRowsSize1&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormMisplacedRowsSize2&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormColumnsNotParsing1&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormColumnsNotParsing2&quot;&gt;&lt;/div&gt;
+&lt;div class=&quot;grid&quot; id=&quot;gridTemplateComplexFormWithNoneColumns&quot;&gt;&lt;/div&gt;
+&lt;script src=&quot;resources/grid-template-shorthand-parsing-utils.js&quot;&gt;&lt;/script&gt;
+&lt;script&gt;
+    description(&quot;This test checks that the 'grid-template' shorthand is properly parsed and the longhand properties correctly assigned.&quot;);
+
+    debug(&quot;Test getting grid-template-areas set through CSS.&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateWithNone&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleForm&quot;), &quot;10px&quot;, &quot;15px&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithNoneColumns&quot;), &quot;none&quot;, &quot;15px&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithNoneRows&quot;), &quot;10px&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithNone&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexForm&quot;), &quot;10px&quot;, &quot;15px&quot;, '&quot;a&quot;');
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithLineNames&quot;), &quot;10px&quot;, &quot;(head) 15px (tail)&quot;, '&quot;a&quot;');
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithLineNamesMultipleColumns&quot;), &quot;10px&quot;, &quot;(head) 15px (tail)&quot;, '&quot;a b&quot;');
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithLineNamesMultipleRows&quot;), &quot;10px&quot;, &quot;(head1) 15px (tail1 head2) 20px (tail2)&quot;, '&quot;a&quot; &quot;b&quot;');
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns&quot;), &quot;(first) 10px (nav nav2) 15px (nav nav2) 15px&quot;, &quot;100px (nav nav2) 25px (nav nav2) 25px (last)&quot;, '&quot;a b c&quot; &quot;d e f&quot; &quot;g h i&quot;');
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithAuto&quot;), &quot;10px&quot;, &quot;0px&quot;, '&quot;a&quot;');
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormOnlyAreas&quot;), &quot;none&quot;, &quot;0px&quot;, '&quot;a&quot;');
+
+    debug(&quot;&quot;);
+    debug(&quot;Test getting wrong values for grid-template shorthand through CSS (they should resolve to the default: 'none')&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateMultipleSlash&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormJustColumns&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormNoRows&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormNoColumns&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormNoColumnSize&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithFitContent&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithWrongRepeat&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithMisplacedNone1&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithMisplacedNone2&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithMisplacedNone3&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateSimpleFormWithMisplacedNone4&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithRepeat&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithWrongRepeat&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;griTemplateComplexFormdWithFitAvailable&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormNoColumnSize&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormMisplacedRowsSize1&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormMisplacedRowsSize2&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormColumnsNotParsing1&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormColumnsNotParsing2&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    testGridDefinitionsValues(document.getElementById(&quot;gridTemplateComplexFormWithNoneColumns&quot;), &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+
+    debug(&quot;&quot;);
+    debug(&quot;Test the initial value&quot;);
+    var element = document.createElement(&quot;div&quot;);
+    document.body.appendChild(element);
+    testGridDefinitionsValues(element, &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns')&quot;, &quot;'none'&quot;);
+    shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows')&quot;, &quot;'none'&quot;);
+    shouldBe(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas')&quot;, &quot;'none'&quot;);
+
+    debug(&quot;&quot;);
+    debug(&quot;Test setting grid-template-columns and grid-template-rows back to 'none' through JS&quot;);
+    testGridDefinitionsSetJSValues(&quot;10px / (line) 'a' 20px&quot;, &quot;10px&quot;, &quot;(line) 20px&quot;, &quot;\&quot;a\&quot;&quot;);
+    testGridDefinitionsSetJSValues(&quot;none&quot;, &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+
+    debug(&quot;&quot;);
+    debug(&quot;Test getting and setting grid-template shorthand through JS&quot;);
+    testGridDefinitionsSetJSValues(&quot;18px / 66px&quot;, &quot;18px&quot;, &quot;66px&quot;, &quot;none&quot;);
+    testGridDefinitionsSetJSValues(&quot;10px / (head) 'a' 15px (tail)&quot;, &quot;10px&quot;, &quot;(head) 15px (tail)&quot;, &quot;\&quot;a\&quot;&quot;);
+    testGridDefinitionsSetJSValues(&quot;'a'&quot;, &quot;none&quot;, &quot;0px&quot;, &quot;\&quot;a\&quot;&quot;, &quot;none&quot;, &quot;auto&quot;);
+
+    debug(&quot;&quot;);
+    debug(&quot;Test setting grid-template shorthand to bad values through JS&quot;);
+    testGridDefinitionsSetBadJSValues(&quot;none / 'a'&quot;);
+    testGridDefinitionsSetBadJSValues(&quot;25px / 'a' (name) 10px&quot;);
+    testGridDefinitionsSetBadJSValues(&quot;'a' / 'b'&quot;);
+    testGridDefinitionsSetBadJSValues(&quot;15px&quot;);
+    testGridDefinitionsSetBadJSValues(&quot;15px / 20px none&quot;);
+    testGridDefinitionsSetBadJSValues(&quot;25px / 10px 'a'&quot;);
+
+&lt;/script&gt;
+&lt;/body&gt;
+&lt;/html&gt;
</ins></span></pre></div>
<a id="trunkLayoutTestsfastcssgridlayoutresourcesgridtemplateshorthandparsingutilsjs"></a>
<div class="addfile"><h4>Added: trunk/LayoutTests/fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js (0 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/LayoutTests/fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js                                (rev 0)
+++ trunk/LayoutTests/fast/css-grid-layout/resources/grid-template-shorthand-parsing-utils.js        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -0,0 +1,51 @@
</span><ins>+function testGridDefinitionsValues(element, computedColumnsValue, computedRowsValue, computedAreasValue)
+{
+    window.element = element;
+    var elementID = element.id || &quot;element&quot;;
+    shouldBeEqualToString(&quot;window.getComputedStyle(&quot; + elementID + &quot;, '').getPropertyValue('-webkit-grid-template-columns')&quot;, computedColumnsValue);
+    shouldBeEqualToString(&quot;window.getComputedStyle(&quot; + elementID + &quot;, '').getPropertyValue('-webkit-grid-template-rows')&quot;, computedRowsValue);
+    shouldBeEqualToString(&quot;window.getComputedStyle(&quot; + elementID + &quot;, '').getPropertyValue('-webkit-grid-template-areas')&quot;, computedAreasValue);
+}
+
+function testGridDefinitionsSetJSValues(shorthandValue, computedColumnsValue, computedRowsValue, computedAreasValue, jsColumnsValue, jsRowsValue, jsAreasValue)
+{
+    checkGridDefinitionsSetJSValues(true, shorthandValue, computedColumnsValue, computedRowsValue, computedAreasValue, jsColumnsValue, jsRowsValue, jsAreasValue);
+}
+
+function testNonGridDefinitionsSetJSValues(shorthandValue, computedColumnsValue, computedRowsValue, computedAreasValue, jsColumnsValue, jsRowsValue, jsAreasValue)
+{
+    checkGridDefinitionsSetJSValues(false, shorthandValue, computedColumnsValue, computedRowsValue, computedAreasValue, jsColumnsValue, jsRowsValue, jsAreasValue);
+}
+
+function checkGridDefinitionsSetJSValues(useGrid, shorthandValue, computedColumnsValue, computedRowsValue, computedAreasValue, jsColumnsValue, jsRowsValue, jsAreasValue)
+{
+    window.element = document.createElement(&quot;div&quot;);
+    document.body.appendChild(element);
+    if (useGrid) {
+        element.style.display = &quot;-webkit-grid&quot;;
+        element.style.width = &quot;800px&quot;;
+        element.style.height = &quot;600px&quot;;
+    }
+
+    element.style.font = &quot;10px Ahem&quot;; // Used to resolve em font consistently.
+    element.style.webkitGridTemplate = shorthandValue;
+    shouldBeEqualToString(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns')&quot;, computedColumnsValue);
+    shouldBeEqualToString(&quot;element.style.webkitGridTemplateColumns&quot;, jsColumnsValue || computedColumnsValue);
+    shouldBeEqualToString(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows')&quot;, computedRowsValue);
+    shouldBeEqualToString(&quot;element.style.webkitGridTemplateRows&quot;, jsRowsValue || computedRowsValue);
+    shouldBeEqualToString(&quot;getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas')&quot;, computedAreasValue);
+    shouldBeEqualToString(&quot;element.style.webkitGridTemplateAreas&quot;, jsAreasValue || computedAreasValue);
+    document.body.removeChild(element);
+
+}
+
+function testGridDefinitionsSetBadJSValues(shorthandValue)
+{
+    window.element = document.createElement(&quot;div&quot;);
+    document.body.appendChild(element);
+
+    element.style.webkitGridTemplate = shorthandValue;
+    // We can't use testSetJSValues as element.style.webkitGridTemplateRows returns &quot;&quot;.
+    testGridDefinitionsValues(element, &quot;none&quot;, &quot;none&quot;, &quot;none&quot;);
+    document.body.removeChild(element);
+}
</ins><span class="cx">\ No newline at end of file
</span></span></pre></div>
<a id="trunkSourceWebCoreChangeLog"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/ChangeLog (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/ChangeLog        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/ChangeLog        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -1,3 +1,55 @@
</span><ins>+2014-04-25  Javier Fernandez  &lt;jfernandez@igalia.com&gt;
+
+        [CSS Grid Layout] Implementation of the grid-template shorthand.
+        https://bugs.webkit.org/show_bug.cgi?id=128980
+
+        Reviewed by Darin Adler.
+
+        This shorthand sets the values for the grid-template-columns,
+        grid-template-rows and grid-template-areas, so the implementation
+        tries to reuse as much available parsing functions as possible.
+
+        The &quot;parsingGridTrackList&quot; was refactored to return a CSSValue and
+        let the &quot;parseValue&quot; function to assign the property value. The
+        &quot;forwardSlash&quot; operator is now valid when the track-list clause is
+        part of a shorthand. The &quot;parseValue&quot; function checkouts that only
+        additional clauses are allowed when processing shorthands; the
+        grid-columns-rows-get-set.html tests was modified to verify this.
+
+        The &quot;parseGridTemplateAreas&quot; was refactored too, in order to
+        process single areas's rows. This is very useful for the
+        gris-template secondary syntax, which mixes areas and rows values.
+
+        Finally, the &quot;parseGirdLineNames&quot; function was modified as well by
+        defining an new argument to concatenate head/tail custom-ident
+        elements and ensure the identList is at the heading index, since
+        it's now possible the parseList was rewound.
+
+        The implementation of the grid-template shorthand tries first to
+        match the &lt;grid-template-columns&gt; / &lt;grid-template-rows&gt; syntax,
+        failing back to the secondary syntax if needed.  This approach
+        requires to rewind the parseList but it produces a clearer code.
+
+        Test: fast/css-grid-layout/grid-template-shorthand-get-set.html
+
+        * css/CSSComputedStyleDeclaration.cpp:
+        (WebCore::ComputedStyleExtractor::propertyValue):
+        * css/CSSParser.cpp:
+        (WebCore::CSSParser::parseValue):
+        (WebCore::CSSParser::parseGridTemplateRowsAndAreas):
+        (WebCore::CSSParser::parseGridTemplateShorthand):
+        (WebCore::CSSParser::parseGridLineNames):
+        (WebCore::CSSParser::parseGridTrackList):
+        (WebCore::CSSParser::parseGridTemplateAreasRow):
+        (WebCore::CSSParser::parseGridTemplateAreas):
+        * css/CSSParser.h:
+        * css/CSSParserValues.h:
+        (WebCore::CSSParserValueList::setCurrentIndex):
+        * css/CSSPropertyNames.in:
+        * css/StylePropertyShorthand.cpp:
+        (WebCore::webkitGridTemplateShorthand):
+        * css/StylePropertyShorthand.h:
+
</ins><span class="cx"> 2014-04-25  Andreas Kling  &lt;akling@apple.com&gt;
</span><span class="cx"> 
</span><span class="cx">         Remove two unused SVGDocument functions.
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSComputedStyleDeclarationcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/css/CSSComputedStyleDeclaration.cpp        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -2082,6 +2082,8 @@
</span><span class="cx">             return valueForGridPosition(style-&gt;gridItemRowEnd());
</span><span class="cx">         case CSSPropertyWebkitGridArea:
</span><span class="cx">             return getCSSPropertyValuesForGridShorthand(webkitGridAreaShorthand());
</span><ins>+        case CSSPropertyWebkitGridTemplate:
+            return getCSSPropertyValuesForGridShorthand(webkitGridTemplateShorthand());
</ins><span class="cx">         case CSSPropertyWebkitGridColumn:
</span><span class="cx">             return getCSSPropertyValuesForGridShorthand(webkitGridColumnShorthand());
</span><span class="cx">         case CSSPropertyWebkitGridRow:
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParsercpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.cpp (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.cpp        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/css/CSSParser.cpp        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -95,7 +95,6 @@
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><span class="cx"> #include &quot;CSSGridLineNamesValue.h&quot;
</span><del>-#include &quot;CSSGridTemplateAreasValue.h&quot;
</del><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_IMAGE_SET)
</span><span class="lines">@@ -2573,7 +2572,8 @@
</span><span class="cx">     case CSSPropertyWebkitGridTemplateRows:
</span><span class="cx">         if (!cssGridLayoutEnabled())
</span><span class="cx">             return false;
</span><del>-        return parseGridTrackList(propId, important);
</del><ins>+        parsedValue = parseGridTrackList();
+        break;
</ins><span class="cx"> 
</span><span class="cx">     case CSSPropertyWebkitGridColumnStart:
</span><span class="cx">     case CSSPropertyWebkitGridColumnEnd:
</span><span class="lines">@@ -2593,6 +2593,11 @@
</span><span class="cx">         return parseGridItemPositionShorthand(propId, important);
</span><span class="cx">     }
</span><span class="cx"> 
</span><ins>+    case CSSPropertyWebkitGridTemplate:
+        if (!cssGridLayoutEnabled())
+            return false;
+        return parseGridTemplateShorthand(important);
+
</ins><span class="cx">     case CSSPropertyWebkitGridArea:
</span><span class="cx">         if (!cssGridLayoutEnabled())
</span><span class="cx">             return false;
</span><span class="lines">@@ -4796,6 +4801,113 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><ins>+bool CSSParser::parseGridTemplateRowsAndAreas(PassRefPtr&lt;CSSValue&gt; templateColumns, bool important)
+{
+    // At least template-areas strings must be defined.
+    if (!m_valueList-&gt;current())
+        return false;
+
+    NamedGridAreaMap gridAreaMap;
+    unsigned rowCount = 0;
+    unsigned columnCount = 0;
+    bool trailingIdentWasAdded = false;
+    RefPtr&lt;CSSValueList&gt; templateRows = CSSValueList::createSpaceSeparated();
+
+    do {
+        // Handle leading &lt;custom-ident&gt;*.
+        if (m_valueList-&gt;current()-&gt;unit == CSSParserValue::ValueList) {
+            if (trailingIdentWasAdded) {
+                // A row's trailing ident must be concatenated with the next row's leading one.
+                parseGridLineNames(*m_valueList, *templateRows, static_cast&lt;CSSGridLineNamesValue*&gt;(templateRows-&gt;item(templateRows-&gt;length() - 1)));
+            } else
+                parseGridLineNames(*m_valueList, *templateRows);
+        }
+
+        // Handle a template-area's row.
+        if (!parseGridTemplateAreasRow(gridAreaMap, rowCount, columnCount))
+            return false;
+        ++rowCount;
+
+        // Handle template-rows's track-size.
+        if (m_valueList-&gt;current() &amp;&amp; m_valueList-&gt;current()-&gt;unit != CSSParserValue::ValueList &amp;&amp; m_valueList-&gt;current()-&gt;unit != CSSPrimitiveValue::CSS_STRING) {
+            RefPtr&lt;CSSValue&gt; value = parseGridTrackSize(*m_valueList);
+            if (!value)
+                return false;
+            templateRows-&gt;append(value.release());
+        } else
+            templateRows-&gt;append(cssValuePool().createIdentifierValue(CSSValueAuto));
+
+        // This will handle the trailing/leading &lt;custom-ident&gt;* in the grammar.
+        trailingIdentWasAdded = false;
+        if (m_valueList-&gt;current() &amp;&amp; m_valueList-&gt;current()-&gt;unit == CSSParserValue::ValueList) {
+            parseGridLineNames(*m_valueList, *templateRows);
+            trailingIdentWasAdded = true;
+        }
+    } while (m_valueList-&gt;current());
+
+    // [&lt;track-list&gt; /]?
+    if (templateColumns)
+        addProperty(CSSPropertyWebkitGridTemplateColumns, templateColumns, important);
+    else
+        addProperty(CSSPropertyWebkitGridTemplateColumns, cssValuePool().createIdentifierValue(CSSValueNone), important);
+
+    // [&lt;line-names&gt;? &lt;string&gt; [&lt;track-size&gt; &lt;line-names&gt;]? ]+
+    RefPtr&lt;CSSValue&gt; templateAreas = CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount);
+    addProperty(CSSPropertyWebkitGridTemplateAreas, templateAreas.release(), important);
+    addProperty(CSSPropertyWebkitGridTemplateRows, templateRows.release(), important);
+
+    return true;
+}
+
+bool CSSParser::parseGridTemplateShorthand(bool important)
+{
+    ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
+
+    ShorthandScope scope(this, CSSPropertyWebkitGridTemplate);
+    ASSERT(gridTemplateShorthand().length() == 3);
+
+    // At least &quot;none&quot; must be defined.
+    if (!m_valueList-&gt;current())
+        return false;
+
+    bool firstValueIsNone = m_valueList-&gt;current()-&gt;id == CSSValueNone;
+
+    // 1- 'none' case.
+    if (firstValueIsNone &amp;&amp; !m_valueList-&gt;next()) {
+        addProperty(CSSPropertyWebkitGridTemplateColumns, cssValuePool().createIdentifierValue(CSSValueNone), important);
+        addProperty(CSSPropertyWebkitGridTemplateRows, cssValuePool().createIdentifierValue(CSSValueNone), important);
+        addProperty(CSSPropertyWebkitGridTemplateAreas, cssValuePool().createIdentifierValue(CSSValueNone), important);
+        return true;
+    }
+
+    unsigned index = 0;
+    RefPtr&lt;CSSValue&gt; columnsValue = firstValueIsNone ? cssValuePool().createIdentifierValue(CSSValueNone) : parseGridTrackList();
+
+    // 2- &lt;grid-template-columns&gt; / &lt;grid-template-columns&gt; syntax.
+    if (columnsValue) {
+        if (!(m_valueList-&gt;current() &amp;&amp; isForwardSlashOperator(m_valueList-&gt;current()) &amp;&amp; m_valueList-&gt;next()))
+            return false;
+        index = m_valueList-&gt;currentIndex();
+        if (RefPtr&lt;CSSValue&gt; rowsValue = parseGridTrackList()) {
+            if (m_valueList-&gt;current())
+                return false;
+            addProperty(CSSPropertyWebkitGridTemplateColumns, columnsValue.release(), important);
+            addProperty(CSSPropertyWebkitGridTemplateRows, rowsValue.release(), important);
+            addProperty(CSSPropertyWebkitGridTemplateAreas, cssValuePool().createIdentifierValue(CSSValueNone), important);
+            return true;
+        }
+    }
+
+
+    // 3- [&lt;track-list&gt; /]? [&lt;line-names&gt;? &lt;string&gt; [&lt;track-size&gt; &lt;line-names&gt;]? ]+ syntax.
+    // The template-columns &lt;track-list&gt; can't be 'none'.
+    if (firstValueIsNone)
+        return false;
+    // It requires to rewind parsing due to previous syntax failures.
+    m_valueList-&gt;setCurrentIndex(index);
+    return parseGridTemplateRowsAndAreas(columnsValue, important);
+}
+
</ins><span class="cx"> bool CSSParser::parseGridAreaShorthand(bool important)
</span><span class="cx"> {
</span><span class="cx">     ASSERT(cssGridLayoutEnabled());
</span><span class="lines">@@ -4850,7 +4962,7 @@
</span><span class="cx">     return true;
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-void CSSParser::parseGridLineNames(CSSParserValueList&amp; inputList, CSSValueList&amp; valueList)
</del><ins>+void CSSParser::parseGridLineNames(CSSParserValueList&amp; inputList, CSSValueList&amp; valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames)
</ins><span class="cx"> {
</span><span class="cx">     ASSERT(inputList.current() &amp;&amp; inputList.current()-&gt;unit == CSSParserValue::ValueList);
</span><span class="cx"> 
</span><span class="lines">@@ -4860,26 +4972,27 @@
</span><span class="cx">         return;
</span><span class="cx">     }
</span><span class="cx"> 
</span><del>-    RefPtr&lt;CSSGridLineNamesValue&gt; lineNames = CSSGridLineNamesValue::create();
</del><ins>+    // Need to ensure the identList is at the heading index, since the parserList might have been rewound.
+    identList-&gt;setCurrentIndex(0);
+
+    RefPtr&lt;CSSGridLineNamesValue&gt; lineNames = previousNamedAreaTrailingLineNames ? previousNamedAreaTrailingLineNames : CSSGridLineNamesValue::create();
</ins><span class="cx">     while (CSSParserValue* identValue = identList-&gt;current()) {
</span><span class="cx">         ASSERT(identValue-&gt;unit == CSSPrimitiveValue::CSS_IDENT);
</span><span class="cx">         lineNames-&gt;append(createPrimitiveStringValue(identValue));
</span><span class="cx">         identList-&gt;next();
</span><span class="cx">     }
</span><del>-    valueList.append(lineNames.release());
</del><ins>+    if (!previousNamedAreaTrailingLineNames)
+        valueList.append(lineNames.release());
</ins><span class="cx"> 
</span><span class="cx">     inputList.next();
</span><span class="cx"> }
</span><span class="cx"> 
</span><del>-bool CSSParser::parseGridTrackList(CSSPropertyID propId, bool important)
</del><ins>+PassRefPtr&lt;CSSValue&gt; CSSParser::parseGridTrackList()
</ins><span class="cx"> {
</span><span class="cx">     CSSParserValue* value = m_valueList-&gt;current();
</span><span class="cx">     if (value-&gt;id == CSSValueNone) {
</span><del>-        if (m_valueList-&gt;next())
-            return false;
-
-        addProperty(propId, cssValuePool().createIdentifierValue(value-&gt;id), important);
-        return true;
</del><ins>+        m_valueList-&gt;next();
+        return cssValuePool().createIdentifierValue(CSSValueNone);
</ins><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     RefPtr&lt;CSSValueList&gt; values = CSSValueList::createSpaceSeparated();
</span><span class="lines">@@ -4890,13 +5003,15 @@
</span><span class="cx"> 
</span><span class="cx">     bool seenTrackSizeOrRepeatFunction = false;
</span><span class="cx">     while (CSSParserValue* currentValue = m_valueList-&gt;current()) {
</span><ins>+        if (isForwardSlashOperator(currentValue))
+            break;
</ins><span class="cx">         if (currentValue-&gt;unit == CSSParserValue::Function &amp;&amp; equalIgnoringCase(currentValue-&gt;function-&gt;name, &quot;repeat(&quot;)) {
</span><span class="cx">             if (!parseGridTrackRepeatFunction(*values))
</span><del>-                return false;
</del><ins>+                return nullptr;
</ins><span class="cx">         } else {
</span><span class="cx">             RefPtr&lt;CSSValue&gt; value = parseGridTrackSize(*m_valueList);
</span><span class="cx">             if (!value)
</span><del>-                return false;
</del><ins>+                return nullptr;
</ins><span class="cx">             values-&gt;append(value.release());
</span><span class="cx">         }
</span><span class="cx">         seenTrackSizeOrRepeatFunction = true;
</span><span class="lines">@@ -4908,10 +5023,9 @@
</span><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!seenTrackSizeOrRepeatFunction)
</span><del>-        return false;
</del><ins>+        return nullptr;
</ins><span class="cx"> 
</span><del>-    addProperty(propId, values.release(), important);
-    return true;
</del><ins>+    return values.release();
</ins><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> bool CSSParser::parseGridTrackRepeatFunction(CSSValueList&amp; list)
</span><span class="lines">@@ -5148,73 +5262,79 @@
</span><span class="cx"> #endif /* ENABLE(DASHBOARD_SUPPORT) */
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><del>-PassRefPtr&lt;CSSValue&gt; CSSParser::parseGridTemplateAreas()
</del><ins>+bool CSSParser::parseGridTemplateAreasRow(NamedGridAreaMap&amp; gridAreaMap, const unsigned rowCount, unsigned&amp; columnCount)
</ins><span class="cx"> {
</span><del>-    NamedGridAreaMap gridAreaMap;
-    size_t rowCount = 0;
-    size_t columnCount = 0;
</del><ins>+    CSSParserValue* currentValue = m_valueList-&gt;current();
+    if (!currentValue || currentValue-&gt;unit != CSSPrimitiveValue::CSS_STRING)
+        return false;
</ins><span class="cx"> 
</span><del>-    while (CSSParserValue* currentValue = m_valueList-&gt;current()) {
-        if (currentValue-&gt;unit != CSSPrimitiveValue::CSS_STRING)
-            return 0;
</del><ins>+    String gridRowNames = currentValue-&gt;string;
+    if (gridRowNames.isEmpty())
+        return false;
</ins><span class="cx"> 
</span><del>-        String gridRowNames = currentValue-&gt;string;
-        if (!gridRowNames.length())
-            return 0;
</del><ins>+    Vector&lt;String&gt; columnNames;
+    gridRowNames.split(' ', columnNames);
</ins><span class="cx"> 
</span><del>-        Vector&lt;String&gt; columnNames;
-        gridRowNames.split(' ', columnNames);
</del><ins>+    if (!columnCount) {
+        columnCount = columnNames.size();
+        ASSERT(columnCount);
+    } else if (columnCount != columnNames.size()) {
+        // The declaration is invalid is all the rows don't have the number of columns.
+        return false;
+    }
</ins><span class="cx"> 
</span><del>-        if (columnCount &amp;&amp; (columnCount != columnNames.size())) {
-            // The declaration is invalid if all the rows don't have the number of columns.
-            return 0;
-        }
</del><ins>+    for (unsigned currentColumn = 0; currentColumn &lt; columnCount; ++currentColumn) {
+        const String&amp; gridAreaName = columnNames[currentColumn];
</ins><span class="cx"> 
</span><del>-        if (!columnCount) {
-            columnCount = columnNames.size();
-            ASSERT(columnCount);
</del><ins>+        // Unamed areas are always valid (we consider them to be 1x1).
+        if (gridAreaName == &quot;.&quot;)
+            continue;
+
+        // We handle several grid areas with the same name at once to simplify the validation code.
+        unsigned lookAheadColumn;
+        for (lookAheadColumn = currentColumn; lookAheadColumn &lt; columnCount - 1; ++lookAheadColumn) {
+            if (columnNames[lookAheadColumn + 1] != gridAreaName)
+                break;
</ins><span class="cx">         }
</span><span class="cx"> 
</span><del>-        for (size_t currentColumn = 0; currentColumn &lt; columnCount; ++currentColumn) {
-            const String&amp; gridAreaName = columnNames[currentColumn];
</del><ins>+        auto gridAreaIterator = gridAreaMap.find(gridAreaName);
+        if (gridAreaIterator == gridAreaMap.end())
+            gridAreaMap.add(gridAreaName, GridCoordinate(GridSpan(rowCount, rowCount), GridSpan(currentColumn, lookAheadColumn)));
+        else {
+            GridCoordinate&amp; gridCoordinate = gridAreaIterator-&gt;value;
</ins><span class="cx"> 
</span><del>-            // Unamed areas are always valid (we consider them to be 1x1).
-            if (gridAreaName == &quot;.&quot;)
-                continue;
</del><ins>+            // The following checks test that the grid area is a single filled-in rectangle.
+            // 1. The new row is adjacent to the previously parsed row.
+            if (rowCount != gridCoordinate.rows.finalPositionIndex + 1)
+                return 0;
</ins><span class="cx"> 
</span><del>-            // We handle several grid areas with the same name at once to simplify the validation code.
-            size_t lookAheadColumn;
-            for (lookAheadColumn = currentColumn; lookAheadColumn &lt; (columnCount - 1); ++lookAheadColumn) {
-                if (columnNames[lookAheadColumn + 1] != gridAreaName)
-                    break;
-            }
</del><ins>+            // 2. The new area starts at the same position as the previously parsed area.
+            if (currentColumn != gridCoordinate.columns.initialPositionIndex)
+                return 0;
</ins><span class="cx"> 
</span><del>-            auto gridAreaIterator = gridAreaMap.find(gridAreaName);
-            if (gridAreaIterator == gridAreaMap.end())
-                gridAreaMap.add(gridAreaName, GridCoordinate(GridSpan(rowCount, rowCount), GridSpan(currentColumn, lookAheadColumn)));
-            else {
-                GridCoordinate&amp; gridCoordinate = gridAreaIterator-&gt;value;
</del><ins>+            // 3. The new area ends at the same position as the previously parsed area.
+            if (lookAheadColumn != gridCoordinate.columns.finalPositionIndex)
+                return 0;
</ins><span class="cx"> 
</span><del>-                // The following checks test that the grid area is a single filled-in rectangle.
-                // 1. The new row is adjacent to the previously parsed row.
-                if (rowCount != gridCoordinate.rows.finalPositionIndex + 1)
-                    return 0;
</del><ins>+            ++gridCoordinate.rows.finalPositionIndex;
+        }
+        currentColumn = lookAheadColumn;
+    }
</ins><span class="cx"> 
</span><del>-                // 2. The new area starts at the same position as the previously parsed area.
-                if (currentColumn != gridCoordinate.columns.initialPositionIndex)
-                    return 0;
</del><ins>+    m_valueList-&gt;next();
+    return true;
+}
</ins><span class="cx"> 
</span><del>-                // 3. The new area ends at the same position as the previously parsed area.
-                if (lookAheadColumn != gridCoordinate.columns.finalPositionIndex)
-                    return 0;
</del><ins>+PassRefPtr&lt;CSSValue&gt; CSSParser::parseGridTemplateAreas()
+{
+    NamedGridAreaMap gridAreaMap;
+    unsigned rowCount = 0;
+    unsigned columnCount = 0;
</ins><span class="cx"> 
</span><del>-                ++gridCoordinate.rows.finalPositionIndex;
-            }
-            currentColumn = lookAheadColumn;
-        }
-
</del><ins>+    while (m_valueList-&gt;current()) {
+        if (!parseGridTemplateAreasRow(gridAreaMap, rowCount, columnCount))
+            return 0;
</ins><span class="cx">         ++rowCount;
</span><del>-        m_valueList-&gt;next();
</del><span class="cx">     }
</span><span class="cx"> 
</span><span class="cx">     if (!rowCount || !columnCount)
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParser.h (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParser.h        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/css/CSSParser.h        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -43,6 +43,10 @@
</span><span class="cx"> #include &quot;WebKitCSSFilterValue.h&quot;
</span><span class="cx"> #endif
</span><span class="cx"> 
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+#include &quot;CSSGridTemplateAreasValue.h&quot;
+#endif
+
</ins><span class="cx"> namespace WebCore {
</span><span class="cx"> 
</span><span class="cx"> class AnimationParseContext;
</span><span class="lines">@@ -53,6 +57,7 @@
</span><span class="cx"> class CSSValueList;
</span><span class="cx"> class CSSBasicShape;
</span><span class="cx"> class CSSBasicShapeInset;
</span><ins>+class CSSGridLineNamesValue;
</ins><span class="cx"> class Document;
</span><span class="cx"> class Element;
</span><span class="cx"> class ImmutableStyleProperties;
</span><span class="lines">@@ -156,14 +161,17 @@
</span><span class="cx">     bool cssGridLayoutEnabled() const;
</span><span class="cx">     PassRefPtr&lt;CSSValue&gt; parseGridPosition();
</span><span class="cx">     bool parseGridItemPositionShorthand(CSSPropertyID, bool important);
</span><ins>+    bool parseGridTemplateRowsAndAreas(PassRefPtr&lt;CSSValue&gt;, bool important);
+    bool parseGridTemplateShorthand(bool important);
</ins><span class="cx">     bool parseGridAreaShorthand(bool important);
</span><span class="cx">     bool parseSingleGridAreaLonghand(RefPtr&lt;CSSValue&gt;&amp;);
</span><del>-    bool parseGridTrackList(CSSPropertyID, bool important);
</del><ins>+    PassRefPtr&lt;CSSValue&gt; parseGridTrackList();
</ins><span class="cx">     bool parseGridTrackRepeatFunction(CSSValueList&amp;);
</span><span class="cx">     PassRefPtr&lt;CSSValue&gt; parseGridTrackSize(CSSParserValueList&amp; inputList);
</span><span class="cx">     PassRefPtr&lt;CSSPrimitiveValue&gt; parseGridBreadth(CSSParserValue*);
</span><ins>+    bool parseGridTemplateAreasRow(NamedGridAreaMap&amp;, const unsigned, unsigned&amp;);
</ins><span class="cx">     PassRefPtr&lt;CSSValue&gt; parseGridTemplateAreas();
</span><del>-    void parseGridLineNames(CSSParserValueList&amp;, CSSValueList&amp;);
</del><ins>+    void parseGridLineNames(CSSParserValueList&amp;, CSSValueList&amp;, CSSGridLineNamesValue* = nullptr);
</ins><span class="cx"> #endif
</span><span class="cx"> 
</span><span class="cx">     bool parseDashboardRegions(CSSPropertyID, bool important);
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSParserValuesh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSParserValues.h (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSParserValues.h        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/css/CSSParserValues.h        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -155,6 +155,12 @@
</span><span class="cx">         --m_current;
</span><span class="cx">         return current();
</span><span class="cx">     }
</span><ins>+    void setCurrentIndex(unsigned index)
+    {
+        ASSERT(index &lt; m_values.size());
+        if (index &lt; m_values.size())
+            m_current = index;
+    }
</ins><span class="cx"> 
</span><span class="cx">     CSSParserValue* valueAt(unsigned i) { return i &lt; m_values.size() ? &amp;m_values[i] : 0; }
</span><span class="cx"> 
</span></span></pre></div>
<a id="trunkSourceWebCorecssCSSPropertyNamesin"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/CSSPropertyNames.in (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/CSSPropertyNames.in        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/css/CSSPropertyNames.in        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -310,6 +310,7 @@
</span><span class="cx"> -webkit-grid-auto-rows
</span><span class="cx"> -webkit-grid-column-end
</span><span class="cx"> -webkit-grid-column-start
</span><ins>+-webkit-grid-template
</ins><span class="cx"> -webkit-grid-template-columns
</span><span class="cx"> -webkit-grid-template-rows
</span><span class="cx"> -webkit-grid-row-end
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertyShorthandcpp"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StylePropertyShorthand.cpp (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StylePropertyShorthand.cpp        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.cpp        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -352,6 +352,16 @@
</span><span class="cx"> }
</span><span class="cx"> 
</span><span class="cx"> #if ENABLE(CSS_GRID_LAYOUT)
</span><ins>+StylePropertyShorthand webkitGridTemplateShorthand()
+{
+    static const CSSPropertyID webkitGridTemplateProperties[] = {
+        CSSPropertyWebkitGridTemplateColumns,
+        CSSPropertyWebkitGridTemplateRows,
+        CSSPropertyWebkitGridTemplateAreas
+    };
+    return StylePropertyShorthand(CSSPropertyWebkitGridTemplate, webkitGridTemplateProperties, WTF_ARRAY_LENGTH(webkitGridTemplateProperties));
+}
+
</ins><span class="cx"> StylePropertyShorthand webkitGridAreaShorthand()
</span><span class="cx"> {
</span><span class="cx">     static const CSSPropertyID webkitGridAreaProperties[] = {
</span></span></pre></div>
<a id="trunkSourceWebCorecssStylePropertyShorthandh"></a>
<div class="modfile"><h4>Modified: trunk/Source/WebCore/css/StylePropertyShorthand.h (167798 => 167799)</h4>
<pre class="diff"><span>
<span class="info">--- trunk/Source/WebCore/css/StylePropertyShorthand.h        2014-04-25 09:23:13 UTC (rev 167798)
+++ trunk/Source/WebCore/css/StylePropertyShorthand.h        2014-04-25 12:06:53 UTC (rev 167799)
</span><span class="lines">@@ -99,6 +99,7 @@
</span><span class="cx"> StylePropertyShorthand webkitColumnRuleShorthand();
</span><span class="cx"> StylePropertyShorthand webkitFlexFlowShorthand();
</span><span class="cx"> StylePropertyShorthand webkitFlexShorthand();
</span><ins>+StylePropertyShorthand webkitGridTemplateShorthand();
</ins><span class="cx"> StylePropertyShorthand webkitGridAreaShorthand();
</span><span class="cx"> StylePropertyShorthand webkitGridColumnShorthand();
</span><span class="cx"> StylePropertyShorthand webkitGridRowShorthand();
</span></span></pre>
</div>
</div>

</body>
</html>