<!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 <jfernandez@igalia.com> 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 "parsingGridTrackList" was refactored to return a CSSValue and
let the "parseValue" function to assign the property value. The
"forwardSlash" operator is now valid when the track-list clause is
part of a shorthand. The "parseValue" 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 "parseGridTemplateAreas" 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 "parseGirdLineNames" 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 <grid-template-columns> / <grid-template-rows> 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 <jfernandez@igalia.com>
+
+ [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 <graouts@webkit.org>
</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 "PASS" messages, followed by "TEST COMPLETE".
+
+
+Test getting grid-template-areas set through CSS.
+PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateWithNone, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('-webkit-grid-template-rows') is "15px"
+PASS window.getComputedStyle(gridTemplateSimpleForm, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-rows') is "15px"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNoneRows, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithNone, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('-webkit-grid-template-rows') is "15px"
+PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-rows') is "(head) 15px (tail)"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-rows') is "(head) 15px (tail)"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b\""
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-rows') is "(head1) 15px (tail1 head2) 20px (tail2)"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\" \"b\""
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is "(first) 10px (nav nav2) 15px (nav nav2) 15px"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is "100px (nav nav2) 25px (nav nav2) 25px (last)"
+PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b c\" \"d e f\" \"g h i\""
+PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-rows') is "0px"
+PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
+PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-rows') is "0px"
+PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
+
+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 "none"
+PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateMultipleSlash, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormJustColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoRows, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithFitContent, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone1, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone2, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone3, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateSimpleFormWithMisplacedNone4, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithRepeat, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithWrongRepeat, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(griTemplateComplexFormdWithFitAvailable, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormNoColumnSize, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing2, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+
+Test the initial value
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+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 "10px"
+PASS element.style.webkitGridTemplateColumns is "10px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "(line) 20px"
+PASS element.style.webkitGridTemplateRows is "(line) 20px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
+PASS element.style.webkitGridTemplateAreas is "\"a\""
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS element.style.webkitGridTemplateColumns is "none"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS element.style.webkitGridTemplateRows is "none"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS element.style.webkitGridTemplateAreas is "none"
+
+Test getting and setting grid-template shorthand through JS
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "18px"
+PASS element.style.webkitGridTemplateColumns is "18px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "66px"
+PASS element.style.webkitGridTemplateRows is "66px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS element.style.webkitGridTemplateAreas is "none"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
+PASS element.style.webkitGridTemplateColumns is "10px"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "(head) 15px (tail)"
+PASS element.style.webkitGridTemplateRows is "(head) 15px (tail)"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
+PASS element.style.webkitGridTemplateAreas is "\"a\""
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS element.style.webkitGridTemplateColumns is "none"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "0px"
+PASS element.style.webkitGridTemplateRows is "auto"
+PASS getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
+PASS element.style.webkitGridTemplateAreas is "\"a\""
+
+Test setting grid-template shorthand to bad values through JS
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows') is "none"
+PASS window.getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas') is "none"
+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>+<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
+<html>
+<head>
+<script>
+if (window.testRunner)
+ testRunner.overridePreference("WebKitCSSGridLayoutEnabled", 1);
+</script>
+<link href="resources/grid.css" rel="stylesheet">
+<style>
+#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 / "a" 15px;
+}
+#gridTemplateComplexFormWithLineNames {
+ -webkit-grid-template: 10px / (head) "a" 15px (tail);
+}
+#gridTemplateComplexFormWithLineNamesMultipleColumns {
+ -webkit-grid-template: 10px / (head) "a b" 15px (tail)
+}
+#gridTemplateComplexFormWithLineNamesMultipleRows {
+ -webkit-grid-template: 10px / (head1) "a" 15px (tail1)
+ (head2) "b" 20px (tail2);
+}
+#gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns {
+ -webkit-grid-template: (first) 10px repeat(2, (nav nav2) 15px) / "a b c" 100px (nav)
+ (nav2) "d e f" 25px (nav)
+ (nav2) "g h i" 25px (last);
+}
+#gridTemplateComplexFormWithAuto {
+ -webkit-grid-template: 10px / "a";
+}
+#gridTemplateComplexFormOnlyAreas {
+ -webkit-grid-template: "a";
+}
+
+/* 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 / "a" repeat(2, 50% (title));
+}
+#gridTemplateComplexFormWithWrongRepeat {
+ -webkit-grid-template: repeat(2, 50% (title) a) / "a";
+}
+#griTemplateComplexFormdWithFitAvailable {
+ -webkit-grid-template: -webkit-fit-available / "a";
+}
+#gridTemplateComplexFormNoColumnSize {
+ -webkit-grid-template: (line) / "a";
+}
+#gridTemplateComplexFormMisplacedRowsSize1 {
+ -webkit-grid-template: 25px / 10px "a";
+}
+#gridTemplateComplexFormMisplacedRowsSize2 {
+ -webkit-grid-template: 25px / "a" (name) 10px;
+}
+#gridTemplateComplexFormColumnsNotParsing1 {
+ -webkit-grid-template: a / "a" (name) 10px;
+}
+#gridTemplateComplexFormColumnsNotParsing2 {
+ -webkit-grid-template: "B" / "a" (name) 10px;
+}
+#gridTemplateComplexFormWithNoneColumns {
+ -webkit-grid-template: none / "a" (name) 10px;
+}
+
+</style>
+<script src="../../resources/js-test.js"></script>
+</head>
+<body>
+<div class="grid" id="gridTemplateWithNone"></div>
+<div class="grid" id="gridTemplateSimpleForm"></div>
+<div class="grid" id="gridTemplateSimpleFormWithNoneColumns"></div>
+<div class="grid" id="gridTemplateSimpleFormWithNoneRows"></div>
+<div class="grid" id="gridTemplateSimpleFormWithNone"></div>
+<div class="grid" id="gridTemplateComplexForm"></div>
+<div class="grid" id="gridTemplateComplexFormWithLineNames"></div>
+<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleColumns"></div>
+<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRows"></div>
+<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns"></div>
+<div class="grid" id="gridTemplateComplexFormWithAuto"></div>
+<div class="grid" id="gridTemplateComplexFormOnlyAreas"></div>
+<div class="grid" id="gridTemplateMultipleSlash"></div>
+<div class="grid" id="gridTemplateSimpleFormJustColumns"></div>
+<div class="grid" id="gridTemplateSimpleFormNoRows"></div>
+<div class="grid" id="gridTemplateSimpleFormNoColumns"></div>
+<div class="grid" id="gridTemplateSimpleFormNoColumnSize"></div>
+<div class="grid" id="gridTemplateSimpleFormWithFitContent"></div>
+<div class="grid" id="gridTemplateSimpleFormWithWrongRepeat"></div>
+<div class="grid" id="gridTemplateSimpleFormWithMisplacedNone1"></div>
+<div class="grid" id="gridTemplateSimpleFormWithMisplacedNone2"></div>
+<div class="grid" id="gridTemplateSimpleFormWithMisplacedNone3"></div>
+<div class="grid" id="gridTemplateSimpleFormWithMisplacedNone4"></div>
+<div class="grid" id="gridTemplateComplexFormWithRepeat"></div>
+<div class="grid" id="gridTemplateComplexFormWithWrongRepeat"></div>
+<div class="grid" id="griTemplateComplexFormdWithFitAvailable"></div>
+<div class="grid" id="gridTemplateComplexFormNoColumnSize"></div>
+<div class="grid" id="gridTemplateComplexFormMisplacedRowsSize1"></div>
+<div class="grid" id="gridTemplateComplexFormMisplacedRowsSize2"></div>
+<div class="grid" id="gridTemplateComplexFormColumnsNotParsing1"></div>
+<div class="grid" id="gridTemplateComplexFormColumnsNotParsing2"></div>
+<div class="grid" id="gridTemplateComplexFormWithNoneColumns"></div>
+<script src="resources/grid-template-shorthand-parsing-utils.js"></script>
+<script>
+ description("This test checks that the 'grid-template' shorthand is properly parsed and the longhand properties correctly assigned.");
+
+ debug("Test getting grid-template-areas set through CSS.");
+ testGridDefinitionsValues(document.getElementById("gridTemplateWithNone"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleForm"), "10px", "15px", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithNoneColumns"), "none", "15px", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithNoneRows"), "10px", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithNone"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexForm"), "10px", "15px", '"a"');
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNames"), "10px", "(head) 15px (tail)", '"a"');
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleColumns"), "10px", "(head) 15px (tail)", '"a b"');
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleRows"), "10px", "(head1) 15px (tail1 head2) 20px (tail2)", '"a" "b"');
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns"), "(first) 10px (nav nav2) 15px (nav nav2) 15px", "100px (nav nav2) 25px (nav nav2) 25px (last)", '"a b c" "d e f" "g h i"');
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithAuto"), "10px", "0px", '"a"');
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormOnlyAreas"), "none", "0px", '"a"');
+
+ debug("");
+ debug("Test getting wrong values for grid-template shorthand through CSS (they should resolve to the default: 'none')");
+ testGridDefinitionsValues(document.getElementById("gridTemplateMultipleSlash"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormJustColumns"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormNoRows"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormNoColumns"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormNoColumnSize"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithFitContent"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithWrongRepeat"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithMisplacedNone1"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithMisplacedNone2"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithMisplacedNone3"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithMisplacedNone4"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithRepeat"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithWrongRepeat"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("griTemplateComplexFormdWithFitAvailable"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormNoColumnSize"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize1"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize2"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormColumnsNotParsing1"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormColumnsNotParsing2"), "none", "none", "none");
+ testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithNoneColumns"), "none", "none", "none");
+
+ debug("");
+ debug("Test the initial value");
+ var element = document.createElement("div");
+ document.body.appendChild(element);
+ testGridDefinitionsValues(element, "none", "none", "none");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns')", "'none'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows')", "'none'");
+ shouldBe("getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas')", "'none'");
+
+ debug("");
+ debug("Test setting grid-template-columns and grid-template-rows back to 'none' through JS");
+ testGridDefinitionsSetJSValues("10px / (line) 'a' 20px", "10px", "(line) 20px", "\"a\"");
+ testGridDefinitionsSetJSValues("none", "none", "none", "none");
+
+ debug("");
+ debug("Test getting and setting grid-template shorthand through JS");
+ testGridDefinitionsSetJSValues("18px / 66px", "18px", "66px", "none");
+ testGridDefinitionsSetJSValues("10px / (head) 'a' 15px (tail)", "10px", "(head) 15px (tail)", "\"a\"");
+ testGridDefinitionsSetJSValues("'a'", "none", "0px", "\"a\"", "none", "auto");
+
+ debug("");
+ debug("Test setting grid-template shorthand to bad values through JS");
+ testGridDefinitionsSetBadJSValues("none / 'a'");
+ testGridDefinitionsSetBadJSValues("25px / 'a' (name) 10px");
+ testGridDefinitionsSetBadJSValues("'a' / 'b'");
+ testGridDefinitionsSetBadJSValues("15px");
+ testGridDefinitionsSetBadJSValues("15px / 20px none");
+ testGridDefinitionsSetBadJSValues("25px / 10px 'a'");
+
+</script>
+</body>
+</html>
</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 || "element";
+ shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPropertyValue('-webkit-grid-template-columns')", computedColumnsValue);
+ shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPropertyValue('-webkit-grid-template-rows')", computedRowsValue);
+ shouldBeEqualToString("window.getComputedStyle(" + elementID + ", '').getPropertyValue('-webkit-grid-template-areas')", 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("div");
+ document.body.appendChild(element);
+ if (useGrid) {
+ element.style.display = "-webkit-grid";
+ element.style.width = "800px";
+ element.style.height = "600px";
+ }
+
+ element.style.font = "10px Ahem"; // Used to resolve em font consistently.
+ element.style.webkitGridTemplate = shorthandValue;
+ shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-columns')", computedColumnsValue);
+ shouldBeEqualToString("element.style.webkitGridTemplateColumns", jsColumnsValue || computedColumnsValue);
+ shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-rows')", computedRowsValue);
+ shouldBeEqualToString("element.style.webkitGridTemplateRows", jsRowsValue || computedRowsValue);
+ shouldBeEqualToString("getComputedStyle(element, '').getPropertyValue('-webkit-grid-template-areas')", computedAreasValue);
+ shouldBeEqualToString("element.style.webkitGridTemplateAreas", jsAreasValue || computedAreasValue);
+ document.body.removeChild(element);
+
+}
+
+function testGridDefinitionsSetBadJSValues(shorthandValue)
+{
+ window.element = document.createElement("div");
+ document.body.appendChild(element);
+
+ element.style.webkitGridTemplate = shorthandValue;
+ // We can't use testSetJSValues as element.style.webkitGridTemplateRows returns "".
+ testGridDefinitionsValues(element, "none", "none", "none");
+ 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 <jfernandez@igalia.com>
+
+ [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 "parsingGridTrackList" was refactored to return a CSSValue and
+ let the "parseValue" function to assign the property value. The
+ "forwardSlash" operator is now valid when the track-list clause is
+ part of a shorthand. The "parseValue" 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 "parseGridTemplateAreas" 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 "parseGirdLineNames" 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 <grid-template-columns> / <grid-template-rows> 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 <akling@apple.com>
</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->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 "CSSGridLineNamesValue.h"
</span><del>-#include "CSSGridTemplateAreasValue.h"
</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<CSSValue> templateColumns, bool important)
+{
+ // At least template-areas strings must be defined.
+ if (!m_valueList->current())
+ return false;
+
+ NamedGridAreaMap gridAreaMap;
+ unsigned rowCount = 0;
+ unsigned columnCount = 0;
+ bool trailingIdentWasAdded = false;
+ RefPtr<CSSValueList> templateRows = CSSValueList::createSpaceSeparated();
+
+ do {
+ // Handle leading <custom-ident>*.
+ if (m_valueList->current()->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<CSSGridLineNamesValue*>(templateRows->item(templateRows->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->current() && m_valueList->current()->unit != CSSParserValue::ValueList && m_valueList->current()->unit != CSSPrimitiveValue::CSS_STRING) {
+ RefPtr<CSSValue> value = parseGridTrackSize(*m_valueList);
+ if (!value)
+ return false;
+ templateRows->append(value.release());
+ } else
+ templateRows->append(cssValuePool().createIdentifierValue(CSSValueAuto));
+
+ // This will handle the trailing/leading <custom-ident>* in the grammar.
+ trailingIdentWasAdded = false;
+ if (m_valueList->current() && m_valueList->current()->unit == CSSParserValue::ValueList) {
+ parseGridLineNames(*m_valueList, *templateRows);
+ trailingIdentWasAdded = true;
+ }
+ } while (m_valueList->current());
+
+ // [<track-list> /]?
+ if (templateColumns)
+ addProperty(CSSPropertyWebkitGridTemplateColumns, templateColumns, important);
+ else
+ addProperty(CSSPropertyWebkitGridTemplateColumns, cssValuePool().createIdentifierValue(CSSValueNone), important);
+
+ // [<line-names>? <string> [<track-size> <line-names>]? ]+
+ RefPtr<CSSValue> 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 "none" must be defined.
+ if (!m_valueList->current())
+ return false;
+
+ bool firstValueIsNone = m_valueList->current()->id == CSSValueNone;
+
+ // 1- 'none' case.
+ if (firstValueIsNone && !m_valueList->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<CSSValue> columnsValue = firstValueIsNone ? cssValuePool().createIdentifierValue(CSSValueNone) : parseGridTrackList();
+
+ // 2- <grid-template-columns> / <grid-template-columns> syntax.
+ if (columnsValue) {
+ if (!(m_valueList->current() && isForwardSlashOperator(m_valueList->current()) && m_valueList->next()))
+ return false;
+ index = m_valueList->currentIndex();
+ if (RefPtr<CSSValue> rowsValue = parseGridTrackList()) {
+ if (m_valueList->current())
+ return false;
+ addProperty(CSSPropertyWebkitGridTemplateColumns, columnsValue.release(), important);
+ addProperty(CSSPropertyWebkitGridTemplateRows, rowsValue.release(), important);
+ addProperty(CSSPropertyWebkitGridTemplateAreas, cssValuePool().createIdentifierValue(CSSValueNone), important);
+ return true;
+ }
+ }
+
+
+ // 3- [<track-list> /]? [<line-names>? <string> [<track-size> <line-names>]? ]+ syntax.
+ // The template-columns <track-list> can't be 'none'.
+ if (firstValueIsNone)
+ return false;
+ // It requires to rewind parsing due to previous syntax failures.
+ m_valueList->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& inputList, CSSValueList& valueList)
</del><ins>+void CSSParser::parseGridLineNames(CSSParserValueList& inputList, CSSValueList& valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames)
</ins><span class="cx"> {
</span><span class="cx"> ASSERT(inputList.current() && inputList.current()->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<CSSGridLineNamesValue> lineNames = CSSGridLineNamesValue::create();
</del><ins>+ // Need to ensure the identList is at the heading index, since the parserList might have been rewound.
+ identList->setCurrentIndex(0);
+
+ RefPtr<CSSGridLineNamesValue> lineNames = previousNamedAreaTrailingLineNames ? previousNamedAreaTrailingLineNames : CSSGridLineNamesValue::create();
</ins><span class="cx"> while (CSSParserValue* identValue = identList->current()) {
</span><span class="cx"> ASSERT(identValue->unit == CSSPrimitiveValue::CSS_IDENT);
</span><span class="cx"> lineNames->append(createPrimitiveStringValue(identValue));
</span><span class="cx"> identList->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<CSSValue> CSSParser::parseGridTrackList()
</ins><span class="cx"> {
</span><span class="cx"> CSSParserValue* value = m_valueList->current();
</span><span class="cx"> if (value->id == CSSValueNone) {
</span><del>- if (m_valueList->next())
- return false;
-
- addProperty(propId, cssValuePool().createIdentifierValue(value->id), important);
- return true;
</del><ins>+ m_valueList->next();
+ return cssValuePool().createIdentifierValue(CSSValueNone);
</ins><span class="cx"> }
</span><span class="cx">
</span><span class="cx"> RefPtr<CSSValueList> 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->current()) {
</span><ins>+ if (isForwardSlashOperator(currentValue))
+ break;
</ins><span class="cx"> if (currentValue->unit == CSSParserValue::Function && equalIgnoringCase(currentValue->function->name, "repeat(")) {
</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<CSSValue> value = parseGridTrackSize(*m_valueList);
</span><span class="cx"> if (!value)
</span><del>- return false;
</del><ins>+ return nullptr;
</ins><span class="cx"> values->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& 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<CSSValue> CSSParser::parseGridTemplateAreas()
</del><ins>+bool CSSParser::parseGridTemplateAreasRow(NamedGridAreaMap& gridAreaMap, const unsigned rowCount, unsigned& columnCount)
</ins><span class="cx"> {
</span><del>- NamedGridAreaMap gridAreaMap;
- size_t rowCount = 0;
- size_t columnCount = 0;
</del><ins>+ CSSParserValue* currentValue = m_valueList->current();
+ if (!currentValue || currentValue->unit != CSSPrimitiveValue::CSS_STRING)
+ return false;
</ins><span class="cx">
</span><del>- while (CSSParserValue* currentValue = m_valueList->current()) {
- if (currentValue->unit != CSSPrimitiveValue::CSS_STRING)
- return 0;
</del><ins>+ String gridRowNames = currentValue->string;
+ if (gridRowNames.isEmpty())
+ return false;
</ins><span class="cx">
</span><del>- String gridRowNames = currentValue->string;
- if (!gridRowNames.length())
- return 0;
</del><ins>+ Vector<String> columnNames;
+ gridRowNames.split(' ', columnNames);
</ins><span class="cx">
</span><del>- Vector<String> 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 && (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 < columnCount; ++currentColumn) {
+ const String& 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 == ".")
+ continue;
+
+ // We handle several grid areas with the same name at once to simplify the validation code.
+ unsigned lookAheadColumn;
+ for (lookAheadColumn = currentColumn; lookAheadColumn < 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 < columnCount; ++currentColumn) {
- const String& 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& gridCoordinate = gridAreaIterator->value;
</ins><span class="cx">
</span><del>- // Unamed areas are always valid (we consider them to be 1x1).
- if (gridAreaName == ".")
- 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 < (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& gridCoordinate = gridAreaIterator->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->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<CSSValue> 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->current()) {
+ if (!parseGridTemplateAreasRow(gridAreaMap, rowCount, columnCount))
+ return 0;
</ins><span class="cx"> ++rowCount;
</span><del>- m_valueList->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 "WebKitCSSFilterValue.h"
</span><span class="cx"> #endif
</span><span class="cx">
</span><ins>+#if ENABLE(CSS_GRID_LAYOUT)
+#include "CSSGridTemplateAreasValue.h"
+#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<CSSValue> parseGridPosition();
</span><span class="cx"> bool parseGridItemPositionShorthand(CSSPropertyID, bool important);
</span><ins>+ bool parseGridTemplateRowsAndAreas(PassRefPtr<CSSValue>, bool important);
+ bool parseGridTemplateShorthand(bool important);
</ins><span class="cx"> bool parseGridAreaShorthand(bool important);
</span><span class="cx"> bool parseSingleGridAreaLonghand(RefPtr<CSSValue>&);
</span><del>- bool parseGridTrackList(CSSPropertyID, bool important);
</del><ins>+ PassRefPtr<CSSValue> parseGridTrackList();
</ins><span class="cx"> bool parseGridTrackRepeatFunction(CSSValueList&);
</span><span class="cx"> PassRefPtr<CSSValue> parseGridTrackSize(CSSParserValueList& inputList);
</span><span class="cx"> PassRefPtr<CSSPrimitiveValue> parseGridBreadth(CSSParserValue*);
</span><ins>+ bool parseGridTemplateAreasRow(NamedGridAreaMap&, const unsigned, unsigned&);
</ins><span class="cx"> PassRefPtr<CSSValue> parseGridTemplateAreas();
</span><del>- void parseGridLineNames(CSSParserValueList&, CSSValueList&);
</del><ins>+ void parseGridLineNames(CSSParserValueList&, CSSValueList&, 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 < m_values.size());
+ if (index < m_values.size())
+ m_current = index;
+ }
</ins><span class="cx">
</span><span class="cx"> CSSParserValue* valueAt(unsigned i) { return i < m_values.size() ? &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>