Changeset 196978 in webkit
- Timestamp:
- Feb 23, 2016 8:49:54 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 5 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196977 r196978 1 2016-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 Sergio Villar Senin. 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 1 19 2016-02-23 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> 2 20 -
trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt
r185147 r196978 26 26 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 15px [tail]" 27 27 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNames, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\"" 28 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesWithoutRowSize, '').getPropertyValue('-webkit-grid-template-columns') is "10px" 29 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesWithoutRowSize, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 0px [tail]" 30 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesWithoutRowSize, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\"" 28 31 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-columns') is "10px" 29 32 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 15px [tail]" 30 33 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumns, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b\"" 34 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize, '').getPropertyValue('-webkit-grid-template-columns') is "10px" 35 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize, '').getPropertyValue('-webkit-grid-template-rows') is "[head] 0px [tail]" 36 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b\"" 31 37 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-columns') is "10px" 32 38 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-rows') is "[head1] 15px [tail1 head2] 20px [tail2]" 33 39 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRows, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\" \"b\"" 40 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-columns') is "10px" 41 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-rows') is "[head1] 0px [tail1 head2] 0px [tail2]" 42 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\" \"b\"" 34 43 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-columns') is "[first] 10px [nav nav2] 15px [nav nav2] 15px" 35 44 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-rows') is "100px [nav nav2] 25px [nav nav2] 25px [last]" 36 45 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b c\" \"d e f\" \"g h i\"" 46 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-columns') is "[first] 10px [nav nav2] 15px [nav nav2] 15px" 47 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-rows') is "0px [nav nav2] 0px [nav nav2] 0px [last]" 48 PASS window.getComputedStyle(gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes, '').getPropertyValue('-webkit-grid-template-areas') is "\"a b c\" \"d e f\" \"g h i\"" 37 49 PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-columns') is "10px" 38 50 PASS window.getComputedStyle(gridTemplateComplexFormWithAuto, '').getPropertyValue('-webkit-grid-template-rows') is "0px" … … 97 109 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-rows') is "none" 98 110 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize2, '').getPropertyValue('-webkit-grid-template-areas') is "none" 111 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize3, '').getPropertyValue('-webkit-grid-template-columns') is "none" 112 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize3, '').getPropertyValue('-webkit-grid-template-rows') is "none" 113 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize3, '').getPropertyValue('-webkit-grid-template-areas') is "none" 114 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize4, '').getPropertyValue('-webkit-grid-template-columns') is "none" 115 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize4, '').getPropertyValue('-webkit-grid-template-rows') is "none" 116 PASS window.getComputedStyle(gridTemplateComplexFormMisplacedRowsSize4, '').getPropertyValue('-webkit-grid-template-areas') is "none" 99 117 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-columns') is "none" 100 118 PASS window.getComputedStyle(gridTemplateComplexFormColumnsNotParsing1, '').getPropertyValue('-webkit-grid-template-rows') is "none" -
trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html
r196934 r196978 25 25 -webkit-grid-template: [head] "a" 15px [tail] / 10px; 26 26 } 27 #gridTemplateComplexFormWithLineNamesWithoutRowSize { 28 -webkit-grid-template: [head] "a" [tail] / 10px; 29 } 27 30 #gridTemplateComplexFormWithLineNamesMultipleColumns { 28 31 -webkit-grid-template: [head] "a b" 15px [tail] / 10px; 32 } 33 #gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize { 34 -webkit-grid-template: [head] "a b" [tail] / 10px; 29 35 } 30 36 #gridTemplateComplexFormWithLineNamesMultipleRows { 31 37 -webkit-grid-template: [head1] "a" 15px [tail1] 32 38 [head2] "b" 20px [tail2] / 10px; 39 } 40 #gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes { 41 -webkit-grid-template: [head1] "a" [tail1] 42 [head2] "b" [tail2] / 10px; 33 43 } 34 44 #gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns { … … 37 47 [nav2] "g h i" 25px [last] / [first] 10px repeat(2, [nav nav2] 15px); 38 48 } 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 } 39 54 #gridTemplateComplexFormWithAuto { 40 55 -webkit-grid-template: "a" / 10px; … … 99 114 #gridTemplateComplexFormMisplacedRowsSize2 { 100 115 -webkit-grid-template: "a" [name] 10px / 25px; 116 } 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; 101 123 } 102 124 #gridTemplateComplexFormColumnsNotParsing1 { … … 127 149 <div class="grid" id="gridTemplateComplexForm"></div> 128 150 <div class="grid" id="gridTemplateComplexFormWithLineNames"></div> 151 <div class="grid" id="gridTemplateComplexFormWithLineNamesWithoutRowSize"></div> 129 152 <div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleColumns"></div> 153 <div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize"></div> 130 154 <div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRows"></div> 155 <div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRowsWithoutRowsSizes"></div> 131 156 <div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns"></div> 157 <div class="grid" id="gridTemplateComplexFormWithLineNamesMultipleRowsAndColumnsWithoutRowsSizes"></div> 132 158 <div class="grid" id="gridTemplateComplexFormWithAuto"></div> 133 159 <div class="grid" id="gridTemplateComplexFormOnlyAreas"></div> … … 152 178 <div class="grid" id="gridTemplateComplexFormMisplacedRowsSize1"></div> 153 179 <div class="grid" id="gridTemplateComplexFormMisplacedRowsSize2"></div> 180 <div class="grid" id="gridTemplateComplexFormMisplacedRowsSize3"></div> 181 <div class="grid" id="gridTemplateComplexFormMisplacedRowsSize4"></div> 154 182 <div class="grid" id="gridTemplateComplexFormColumnsNotParsing1"></div> 155 183 <div class="grid" id="gridTemplateComplexFormColumnsNotParsing2"></div> … … 168 196 testGridDefinitionsValues(document.getElementById("gridTemplateComplexForm"), "10px", "15px", '"a"'); 169 197 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNames"), "10px", "[head] 15px [tail]", '"a"'); 198 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesWithoutRowSize"), "10px", "[head] 0px [tail]", '"a"'); 170 199 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleColumns"), "10px", "[head] 15px [tail]", '"a b"'); 200 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithLineNamesMultipleColumnsWithoutRowSize"), "10px", "[head] 0px [tail]", '"a b"'); 171 201 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"'); 172 203 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"'); 173 205 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithAuto"), "10px", "0px", '"a"'); 174 206 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormOnlyAreas"), "none", "0px", '"a"'); … … 194 226 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize1"), "none", "none", "none"); 195 227 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize2"), "none", "none", "none"); 228 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize3"), "none", "none", "none"); 229 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormMisplacedRowsSize4"), "none", "none", "none"); 196 230 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormColumnsNotParsing1"), "none", "none", "none"); 197 231 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormColumnsNotParsing2"), "none", "none", "none"); -
trunk/Source/WebCore/ChangeLog
r196977 r196978 1 2016-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 Sergio Villar Senin. 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 1 23 2016-02-23 Nikos Andronikos <nikos.andronikos-webkit@cisra.canon.com.au> 2 24 -
trunk/Source/WebCore/css/CSSParser.cpp
r196934 r196978 5607 5607 5608 5608 // 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) { 5610 5610 RefPtr<CSSValue> value = parseGridTrackSize(*m_valueList); 5611 5611 if (!value) … … 5680 5680 5681 5681 5682 // 3- [<line-names>? <string> [<track-size> <line-names>]? ]+ syntax.5682 // 3- [<line-names>? <string> <track-size>? <line-names>? ]+ syntax. 5683 5683 // It requires to rewind parsing due to previous syntax failures. 5684 5684 m_valueList->setCurrentIndex(0);
Note: See TracChangeset
for help on using the changeset viewer.