Source/WebCore/ChangeLog

 12016-02-23 Manuel Rego Casasnovas <rego@igalia.com>
 2
 3 [css-grid] Rows track sizes are optional in grid-template shorthand
 4 https://bugs.webkit.org/show_bug.cgi?id=154586
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 You can omit the size of the rows in grid-template shorthand,
 9 even if you specify a named grid line for the end of the row,
 10 due to a change in the spec back in 2014:
 11 https://github.com/w3c/csswg-drafts/commit/9f660c4183c73c1f5279c46904dc6cb314f76194
 12
 13 Before if you want to specify a named grid line,
 14 you need to set the row size.
 15
 16 Update parsing, so it nows accepts things like:
 17 grid-template: 100px / "a" [bottom];
 18
 19 * css/CSSParser.cpp:
 20 (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns):
 21 (WebCore::CSSParser::parseGridTemplateShorthand):
 22
1232016-02-23 Youenn Fablet <youenn.fablet@crf.canon.fr>
224
325 Refactor DOM Iterator next signature

Source/WebCore/css/CSSParser.cpp

@@bool CSSParser::parseGridTemplateRowsAndAreasAndColumns(bool important)
56065606 ++rowCount;
56075607
56085608 // Handle template-rows's track-size.
5609  if (m_valueList->current() && !isForwardSlashOperator(*m_valueList->current()) && m_valueList->current()->unit != CSSParserValue::ValueList && m_valueList->current()->unit != CSSPrimitiveValue::CSS_STRING) {
 5609 if (m_valueList->current() && m_valueList->current()->unit != CSSParserValue::Operator && m_valueList->current()->unit != CSSParserValue::ValueList && m_valueList->current()->unit != CSSPrimitiveValue::CSS_STRING) {
56105610 RefPtr<CSSValue> value = parseGridTrackSize(*m_valueList);
56115611 if (!value)
56125612 return false;

@@bool CSSParser::parseGridTemplateShorthand(bool important)
56795679 }
56805680
56815681
5682  // 3- [<line-names>? <string> [<track-size> <line-names>]? ]+ syntax.
 5682 // 3- [<line-names>? <string> <track-size>? <line-names>? ]+ syntax.
56835683 // It requires to rewind parsing due to previous syntax failures.
56845684 m_valueList->setCurrentIndex(0);
56855685 return parseGridTemplateRowsAndAreasAndColumns(important);

LayoutTests/ChangeLog

 12016-02-23 Manuel Rego Casasnovas <rego@igalia.com>
 2
 3 [css-grid] Rows track sizes are optional in grid-template shorthand
 4 https://bugs.webkit.org/show_bug.cgi?id=154586
 5
 6 Reviewed by NOBODY (OOPS!).
 7
 8 You can omit the size of the rows in grid-template shorthand,
 9 even if you specify a named grid line for the end of the row,
 10 due to a change in the spec back in 2014:
 11 https://github.com/w3c/csswg-drafts/commit/9f660c4183c73c1f5279c46904dc6cb314f76194
 12
 13 Before if you want to specify a named grid line,
 14 you need to set the row size.
 15
 16 Update parsing, so it nows accepts things like:
 17 grid-template: 100px / "a" [bottom];
 18
1192016-02-22 Myles C. Maxfield <mmaxfield@apple.com>
220
321 Font features specified in @font-face blocks don't apply to local() families

LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt

@@PASS window.getComputedStyle(gridTemplateComplexForm, '').getPropertyValue('-web
2525PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
2626PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 15px [tail]"
2727PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
 28PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesWithoutRowSize, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
 29PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesWithoutRowSize, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 0px [tail]"
 30PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesWithoutRowSize, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""
2831PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
2932PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 15px [tail]"
3033PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b\""
 34PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
 35PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 0px [tail]"
 36PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b\""
3137PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
3238PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-rows') is "[head1] 15px [tail1 head2] 20px [tail2]"
3339PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\" \"b\""
 40PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
 41PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-rows') is "[head1] 0px [tail1 head2] 0px [tail2]"
 42PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\" \"b\""
3443PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is "[first] 10px [nav nav2] 15px [nav nav2] 15px"
3544PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is "100px [nav nav2] 25px [nav nav2] 25px [last]"
3645PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b c\" \"d e f\" \"g h i\""
 46PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-columns') is "[first] 10px [nav nav2] 15px [nav nav2] 15px"
 47PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-rows') is "0px [nav nav2] 0px [nav nav2] 0px [last]"
 48PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b c\" \"d e f\" \"g h i\""
3749PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-columns') is "10px"
3850PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-rows') is "0px"
3951PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\""

@@PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize1, '').getP
96108PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-columns') is "none"
97109PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-rows') is "none"
98110PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-areas') is "none"
 111PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize3, '').getPropertyValue('-webkit-grid-template-columns') is "none"
 112PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize3, '').getPropertyValue('-webkit-grid-template-rows') is "none"
 113PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize3, '').getPropertyValue('-webkit-grid-template-areas') is "none"
 114PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize4, '').getPropertyValue('-webkit-grid-template-columns') is "none"
 115PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize4, '').getPropertyValue('-webkit-grid-template-rows') is "none"
 116PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize4, '').getPropertyValue('-webkit-grid-template-areas') is "none"
99117PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-columns') is "none"
100118PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-rows') is "none"
101119PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-areas') is "none"

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

2424#gridTemplateComplexFormWithLineNames {
2525 -webkit-grid-template: [head] "a" 15px [tail] / 10px;
2626}
 27#gridTemplateComplexFormWithLineNamesWithoutRowSize {
 28 -webkit-grid-template: [head] "a" [tail] / 10px;
 29}
2730#gridTemplateComplexFormWithLineNamesMultipleColumns {
2831 -webkit-grid-template: [head] "a b" 15px [tail] / 10px;
2932}
 33#gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize {
 34 -webkit-grid-template: [head] "a b" [tail] / 10px;
 35}
3036#gridTemplateComplexFormWithLineNamesMultipleRows {
3137 -webkit-grid-template: [head1] "a" 15px [tail1]
3238 [head2] "b" 20px [tail2] / 10px;
3339}
 40#gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes {
 41 -webkit-grid-template: [head1] "a" [tail1]
 42 [head2] "b" [tail2] / 10px;
 43}
3444#gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns {
3545 -webkit-grid-template: "a b c" 100px [nav]
3646 [nav2] "d e f" 25px [nav]
3747 [nav2] "g h i" 25px [last] / [first] 10px repeat(2, [nav nav2] 15px);
3848}
 49#gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes {
 50 -webkit-grid-template: "a b c" [nav]
 51 [nav2] "d e f" [nav]
 52 [nav2] "g h i" [last] / [first] 10px repeat(2, [nav nav2] 15px);
 53}
3954#gridTemplateComplexFormWithAuto {
4055 -webkit-grid-template: "a" / 10px;
4156}

99114#gridTemplateComplexFormMisplacedRowsSize2 {
100115 -webkit-grid-template: "a" [name] 10px / 25px;
101116}
 117#gridTemplateComplexFormMisplacedRowsSize3 {
 118 -webkit-grid-template: [head] "a" [tail] 10px / 10px;
 119}
 120#gridTemplateComplexFormMisplacedRowsSize4 {
 121 -webkit-grid-template: [head1] "a" [tail1]
 122 [head2] "a" [tail2] 100px / 10px;
 123}
102124#gridTemplateComplexFormColumnsNotParsing1 {
103125 -webkit-grid-template: "a" [name] 10px / a;
104126}

126148<div class="grid" id="gridTemplateSimpleFormWithNone"></div>
127149<div class="grid" id="gridTemplateComplexForm"></div>
128150<div class="grid" id="gridTemplateComplexFormWithLineNames"></div>
 151<div class="grid" id="gridTemplateComplexFormWithLineNamesWithoutRowSize"></div>
129152<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleColumns"></div>
 153<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize"></div>
130154<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRows"></div>
 155<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes"></div>
131156<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns"></div>
 157<div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes"></div>
132158<div class="grid" id="gridTemplateComplexFormWithAuto"></div>
133159<div class="grid" id="gridTemplateComplexFormOnlyAreas"></div>
134160<div class="grid" id="gridTemplateNoColumnsRowWithEmptyTrailingLineNames"></div>

151177<div class="grid" id="gridTemplateComplexFormNoColumnSize"></div>
152178<div class="grid" id="gridTemplateComplexFormMisplacedRowsSize1"></div>
153179<div class="grid" id="gridTemplateComplexFormMisplacedRowsSize2"></div>
 180<div class="grid" id="gridTemplateComplexFormMisplacedRowsSize3"></div>
 181<div class="grid" id="gridTemplateComplexFormMisplacedRowsSize4"></div>
154182<div class="grid" id="gridTemplateComplexFormColumnsNotParsing1"></div>
155183<div class="grid" id="gridTemplateComplexFormColumnsNotParsing2"></div>
156184<div class="grid" id="gridTemplateComplexFormWithNoneColumns"></div>

167195 testGridDefinitionsValues(document.getElementById("gridTemplateSimpleFormWithNone"), "none", "none", "none");
168196 testGridDefinitionsValues(document.getElementById("gridTemplateComplexForm"), "10px", "15px", '"a"');
169197 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNames"), "10px", "[head] 15px [tail]", '"a"');
 198 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesWithoutRowSize"), "10px", "[head] 0px [tail]", '"a"');
170199 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleColumns"), "10px", "[head] 15px [tail]", '"a b"');
 200 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize"), "10px", "[head] 0px [tail]", '"a b"');
171201 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleRows"), "10px", "[head1] 15px [tail1 head2] 20px [tail2]", '"a" "b"');
 202 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes"), "10px", "[head1] 0px [tail1 head2] 0px [tail2]", '"a" "b"');
172203 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"');
 204 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes"), "[first] 10px [nav nav2] 15px [nav nav2] 15px", "0px [nav nav2] 0px [nav nav2] 0px [last]", '"a b c" "d e f" "g h i"');
173205 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithAuto"), "10px", "0px", '"a"');
174206 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormOnlyAreas"), "none", "0px", '"a"');
175207 testGridDefinitionsValues(document.getElementById("gridTemplateNoColumnsRowWithEmptyTrailingLineNames"), "none", "[first] 0px", '"a"');

193225 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormNoColumnSize"), "none", "none", "none");
194226 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize1"), "none", "none", "none");
195227 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize2"), "none", "none", "none");
 228 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize3"), "none", "none", "none");
 229 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize4"), "none", "none", "none");
196230 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormColumnsNotParsing1"), "none", "none", "none");
197231 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormColumnsNotParsing2"), "none", "none", "none");
198232 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithNoneColumns"), "none", "none", "none");