Changeset 196934 in webkit
- Timestamp:
- Feb 22, 2016 6:08:41 AM (8 years ago)
- Location:
- trunk
- Files:
-
- 29 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r196906 r196934 1 2016-02-22 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Swap columns and rows in grid-template shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=154472 5 6 Reviewed by Darin Adler. 7 8 The spec was modified past December to change the order of 9 columns and rows in the grid-template shorthand: 10 https://github.com/w3c/csswg-drafts/commit/f6c7691679a519017a80ebae44fd86c3eae5c5f9 11 12 Updated the parsing and modified the tests to follow the new syntax. 13 14 * fast/css-grid-layout/absolute-positioning-definite-sizes.html: 15 * fast/css-grid-layout/flex-content-distribution.html: 16 * fast/css-grid-layout/grid-align-content-vertical-lr.html: 17 * fast/css-grid-layout/grid-align-content-vertical-rl.html: 18 * fast/css-grid-layout/grid-align-content.html: 19 * fast/css-grid-layout/grid-gutters-and-alignment.html: 20 * fast/css-grid-layout/grid-gutters-and-flex-content.html: 21 * fast/css-grid-layout/grid-gutters-and-tracks.html: 22 * fast/css-grid-layout/grid-justify-content-vertical-lr.html: 23 * fast/css-grid-layout/grid-justify-content-vertical-rl.html: 24 * fast/css-grid-layout/grid-justify-content.html: 25 * fast/css-grid-layout/grid-shorthand-get-set.html: 26 * fast/css-grid-layout/grid-template-shorthand-get-set.html: 27 * fast/css-grid-layout/relayout-align-items-changed.html: 28 * fast/css-grid-layout/relayout-align-self-changed.html: 29 * fast/css-grid-layout/relayout-indefinite-heights.html: 30 * fast/css-grid-layout/relayout-justify-items-changed.html: 31 * fast/css-grid-layout/relayout-justify-self-changed.html: 32 * fast/repaint/align-items-overflow-change.html: 33 * fast/repaint/align-self-change.html: 34 * fast/repaint/align-self-overflow-change.html: 35 * fast/repaint/justify-items-change.html: 36 * fast/repaint/justify-items-overflow-change.html: 37 * fast/repaint/justify-self-change.html: 38 * fast/repaint/justify-self-overflow-change.html: 39 1 40 2016-02-22 Manuel Rego Casasnovas <rego@igalia.com> 2 41 -
trunk/LayoutTests/fast/css-grid-layout/absolute-positioning-definite-sizes.html
r192154 r196934 3 3 <style> 4 4 .grid { 5 -webkit-grid-template: 1fr / 50px1fr;5 -webkit-grid-template: 50px 1fr / 1fr; 6 6 7 7 position: absolute; -
trunk/LayoutTests/fast/css-grid-layout/flex-content-distribution.html
r191385 r196934 5 5 <style> 6 6 .freeSpaceForColumnsGrid { 7 -webkit-grid-template: minmax(20px, 0.7fr) / 100%;7 -webkit-grid-template: 100% / minmax(20px, 0.7fr); 8 8 width: 50px; 9 9 height: 100px; … … 11 11 12 12 .freeSpaceForRowsGrid { 13 -webkit-grid-template: 100% / minmax(20px, 0.7fr);13 -webkit-grid-template: minmax(20px, 0.7fr) / 100%; 14 14 width: 50px; 15 15 height: 100px; -
trunk/LayoutTests/fast/css-grid-layout/grid-align-content-vertical-lr.html
r190484 r196934 10 10 11 11 .grid { 12 -webkit-grid: 50px 50px / 100px 100px;12 -webkit-grid: 100px 100px / 50px 50px; 13 13 position: relative; 14 14 width: 300px; -
trunk/LayoutTests/fast/css-grid-layout/grid-align-content-vertical-rl.html
r190484 r196934 10 10 11 11 .grid { 12 -webkit-grid: 50px 50px / 100px 100px;12 -webkit-grid: 100px 100px / 50px 50px; 13 13 position: relative; 14 14 width: 300px; -
trunk/LayoutTests/fast/css-grid-layout/grid-align-content.html
r190663 r196934 11 11 12 12 .grid { 13 -webkit-grid: 50px 50px / 100px 100px;13 -webkit-grid: 100px 100px / 50px 50px; 14 14 position: relative; 15 15 width: 200px; -
trunk/LayoutTests/fast/css-grid-layout/grid-gutters-and-alignment.html
r196819 r196934 15 15 16 16 .grid50And100 { 17 -webkit-grid: 50px 50px / 100px 100px;17 -webkit-grid: 100px 100px / 50px 50px; 18 18 width: 200px; 19 19 height: 300px; -
trunk/LayoutTests/fast/css-grid-layout/grid-gutters-and-flex-content.html
r190663 r196934 6 6 <script src="../../resources/js-test.js"></script> 7 7 <style> 8 .gridMaxFlexContent { -webkit-grid-template: minmax(30px, 2fr) / 50px; }9 .gridTwoDoubleMaxFlexContent { -webkit-grid-template: minmax(10px, 0.5fr) minmax(10px, 2fr) / 50px; }10 .gridIgnoreSecondGridItem { -webkit-grid-template: minmax(300px, 3fr) minmax(150px, 1fr) / 50px; }8 .gridMaxFlexContent { -webkit-grid-template: 50px / minmax(30px, 2fr); } 9 .gridTwoDoubleMaxFlexContent { -webkit-grid-template: 50px / minmax(10px, 0.5fr) minmax(10px, 2fr); } 10 .gridIgnoreSecondGridItem { -webkit-grid-template: 50px / minmax(300px, 3fr) minmax(150px, 1fr); } 11 11 12 .gridRowsMaxFlexContent { -webkit-grid-template: 50px / minmax(30px, 2fr); }13 .gridRowsTwoMaxFlexContent { -webkit-grid-template: 50px / minmax(10px, 1fr) minmax(10px, 2fr); }14 .gridRowsTwoDoubleMaxFlexContent { -webkit-grid-template: 50px / minmax(10px, 0.5fr) minmax(10px, 2fr); }12 .gridRowsMaxFlexContent { -webkit-grid-template: minmax(30px, 2fr) / 50px; } 13 .gridRowsTwoMaxFlexContent { -webkit-grid-template: minmax(10px, 1fr) minmax(10px, 2fr) / 50px; } 14 .gridRowsTwoDoubleMaxFlexContent { -webkit-grid-template: minmax(10px, 0.5fr) minmax(10px, 2fr) / 50px; } 15 15 16 16 .gridMinMaxFlexFixedAndMinContentAndFixed { -webkit-grid-template-columns: minmax(0.5fr, 35px) -webkit-min-content 25px; } -
trunk/LayoutTests/fast/css-grid-layout/grid-gutters-and-tracks.html
r190663 r196934 19 19 .gridMultipleRows { -webkit-grid-template-rows: 90px 70px -webkit-min-content; } 20 20 .gridAutoAuto { -webkit-grid-template: auto auto / auto auto; } 21 .gridMultipleFixed { -webkit-grid-template: [first] 15px [foo] 25px [bar] 35px [last] / [first] 37px [foo] 57px [bar] 77px [last]; }21 .gridMultipleFixed { -webkit-grid-template: [first] 37px [foo] 57px [bar] 77px [last] / [first] 15px [foo] 25px [bar] 35px [last]; } 22 22 .gridFixed100 { -webkit-grid-template: repeat(2, 100px) / repeat(2, 100px); } 23 23 -
trunk/LayoutTests/fast/css-grid-layout/grid-justify-content-vertical-lr.html
r196819 r196934 11 11 12 12 .grid { 13 -webkit-grid: 50px 50px / 100px 100px;13 -webkit-grid: 100px 100px / 50px 50px; 14 14 position: relative; 15 15 width: 300px; -
trunk/LayoutTests/fast/css-grid-layout/grid-justify-content-vertical-rl.html
r196819 r196934 11 11 12 12 .grid { 13 -webkit-grid: 50px 50px / 100px 100px;13 -webkit-grid: 100px 100px / 50px 50px; 14 14 position: relative; 15 15 width: 300px; -
trunk/LayoutTests/fast/css-grid-layout/grid-justify-content.html
r190663 r196934 11 11 12 12 .grid { 13 -webkit-grid: 50px 50px / 100px 100px;13 -webkit-grid: 100px 100px / 50px 50px; 14 14 position: relative; 15 15 width: 200px; -
trunk/LayoutTests/fast/css-grid-layout/grid-shorthand-get-set.html
r196906 r196934 8 8 } 9 9 #gridWithTemplate { 10 -webkit-grid: 1 5px / 10px;10 -webkit-grid: 10px / 15px; 11 11 } 12 12 #gridWithTemplate1 { 13 -webkit-grid: none / 10px;13 -webkit-grid: 10px / none; 14 14 } 15 15 #gridWithTemplateNone { 16 -webkit-grid: none / 10px;16 -webkit-grid: 10px / none; 17 17 } 18 18 #gridWithAutoFlowDenseAndRowsAndColumns { … … 157 157 debug(""); 158 158 debug("Test getting and setting 'grid' shorthand through JS"); 159 testGridDefinitionsSetJSValues(" 10px / 20px", "10px", "20px", "none", "row", "auto", "auto", "10px", "20px", "none", "initial", "initial", "initial");160 testGridDefinitionsSetJSValues(" 10px / [line] 'a' 20px", "10px", "[line] 20px", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "initial", "initial", "initial");159 testGridDefinitionsSetJSValues("20px / 10px", "10px", "20px", "none", "row", "auto", "auto", "10px", "20px", "none", "initial", "initial", "initial"); 160 testGridDefinitionsSetJSValues("[line] 'a' 20px / 10px", "10px", "[line] 20px", "\"a\"", "row", "auto", "auto", "10px", "[line] 20px", "\"a\"", "initial", "initial", "initial"); 161 161 testGridDefinitionsSetJSValues("row dense 20px", "none", "none", "none", "row dense", "20px", "20px", "initial", "initial", "initial", "row dense", "20px", "20px"); 162 162 testGridDefinitionsSetJSValues("column 20px / 10px", "none", "none", "none", "column", "10px", "20px", "initial", "initial", "initial", "column", "10px", "20px"); -
trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html
r185147 r196934 8 8 } 9 9 #gridTemplateSimpleForm { 10 -webkit-grid-template: 1 0px / 15px;10 -webkit-grid-template: 15px / 10px; 11 11 } 12 12 #gridTemplateSimpleFormWithNoneColumns { 13 -webkit-grid-template: none / 15px;13 -webkit-grid-template: 15px / none; 14 14 } 15 15 #gridTemplateSimpleFormWithNoneRows { 16 -webkit-grid-template: 10px / none;16 -webkit-grid-template: none / 10px; 17 17 } 18 18 #gridTemplateSimpleFormWithNone { … … 20 20 } 21 21 #gridTemplateComplexForm { 22 -webkit-grid-template: 10px / "a" 15px;22 -webkit-grid-template: "a" 15px / 10px; 23 23 } 24 24 #gridTemplateComplexFormWithLineNames { 25 -webkit-grid-template: 10px / [head] "a" 15px [tail];25 -webkit-grid-template: [head] "a" 15px [tail] / 10px; 26 26 } 27 27 #gridTemplateComplexFormWithLineNamesMultipleColumns { 28 -webkit-grid-template: 10px / [head] "a b" 15px [tail]28 -webkit-grid-template: [head] "a b" 15px [tail] / 10px; 29 29 } 30 30 #gridTemplateComplexFormWithLineNamesMultipleRows { 31 -webkit-grid-template: 10px /[head1] "a" 15px [tail1]32 [head2] "b" 20px [tail2];31 -webkit-grid-template: [head1] "a" 15px [tail1] 32 [head2] "b" 20px [tail2] / 10px; 33 33 } 34 34 #gridTemplateComplexFormWithLineNamesMultipleRowsAndColumns { 35 -webkit-grid-template: [first] 10px repeat(2, [nav nav2] 15px) /"a b c" 100px [nav]36 37 [nav2] "g h i" 25px [last];35 -webkit-grid-template: "a b c" 100px [nav] 36 [nav2] "d e f" 25px [nav] 37 [nav2] "g h i" 25px [last] / [first] 10px repeat(2, [nav nav2] 15px); 38 38 } 39 39 #gridTemplateComplexFormWithAuto { 40 -webkit-grid-template: 10px / "a";40 -webkit-grid-template: "a" / 10px; 41 41 } 42 42 #gridTemplateComplexFormOnlyAreas { … … 56 56 } 57 57 #gridTemplateSimpleFormNoRows { 58 -webkit-grid-template: / 10px; 59 } 60 #gridTemplateSimpleFormNoColumns { 58 61 -webkit-grid-template: 10px /; 59 62 } 60 #gridTemplateSimpleFormNoColumns {61 -webkit-grid-template: / 10px;62 }63 63 #gridTemplateSimpleFormNoColumnSize { 64 -webkit-grid-template: [line] / 10px;64 -webkit-grid-template: 10px / [line]; 65 65 } 66 66 #gridTemplateSimpleFormWithFitContent { 67 -webkit-grid-template: -webkit-fit-content / 10px;67 -webkit-grid-template: 10px / -webkit-fit-content; 68 68 } 69 69 #gridTemplateSimpleFormWithWrongRepeat { 70 -webkit-grid-template: repeat(2, 50% [title] a) / 10px;70 -webkit-grid-template: 10px / repeat(2, 50% [title] a); 71 71 } 72 72 #gridTemplateSimpleFormWithMisplacedNone1 { 73 -webkit-grid-template: 10px / none 20px;73 -webkit-grid-template: none 20px / 10px; 74 74 } 75 75 #gridTemplateSimpleFormWithMisplacedNone2 { 76 -webkit-grid-template: 10px / 20px none;76 -webkit-grid-template: 20px none / 10px; 77 77 } 78 78 #gridTemplateSimpleFormWithMisplacedNone3 { 79 -webkit-grid-template: none 10px / 20px;79 -webkit-grid-template: 20px / none 10px; 80 80 } 81 81 #gridTemplateSimpleFormWithMisplacedNone4 { 82 -webkit-grid-template: 10px none / 20px;82 -webkit-grid-template: 20px / 10px none; 83 83 } 84 84 #gridTemplateComplexFormWithRepeat { 85 -webkit-grid-template: 10px / "a" repeat(2, 50% [title]);85 -webkit-grid-template: "a" repeat(2, 50% [title]) / 10px; 86 86 } 87 87 #gridTemplateComplexFormWithWrongRepeat { 88 -webkit-grid-template: repeat(2, 50% [title] a) / "a";88 -webkit-grid-template: "a" / repeat(2, 50% [title] a); 89 89 } 90 90 #griTemplateComplexFormdWithFitAvailable { 91 -webkit-grid-template: -webkit-fit-available / "a";91 -webkit-grid-template: "a" / -webkit-fit-available; 92 92 } 93 93 #gridTemplateComplexFormNoColumnSize { 94 -webkit-grid-template: [line] / "a";94 -webkit-grid-template: "a" / [line]; 95 95 } 96 96 #gridTemplateComplexFormMisplacedRowsSize1 { 97 -webkit-grid-template: 25px / 10px "a";97 -webkit-grid-template: 10px "a" / 25px; 98 98 } 99 99 #gridTemplateComplexFormMisplacedRowsSize2 { 100 -webkit-grid-template: 25px / "a" [name] 10px;100 -webkit-grid-template: "a" [name] 10px / 25px; 101 101 } 102 102 #gridTemplateComplexFormColumnsNotParsing1 { 103 -webkit-grid-template: a / "a" [name] 10px;103 -webkit-grid-template: "a" [name] 10px / a; 104 104 } 105 105 #gridTemplateComplexFormColumnsNotParsing2 { 106 -webkit-grid-template: " B" / "a" [name] 10px;106 -webkit-grid-template: "a" [name] 10px / "B"; 107 107 } 108 108 #gridTemplateComplexFormWithNoneColumns { 109 -webkit-grid-template: none / "a" [name] 10px;109 -webkit-grid-template: "a" [name] 10px / none; 110 110 } 111 111 #gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames { … … 211 211 debug(""); 212 212 debug("Test setting grid-template-columns and grid-template-rows back to 'none' through JS"); 213 testGridDefinitionsSetJSValues(" 10px / [line] 'a' 20px", "10px", "[line] 20px", "\"a\"");213 testGridDefinitionsSetJSValues("[line] 'a' 20px / 10px", "10px", "[line] 20px", "\"a\""); 214 214 testGridDefinitionsSetJSValues("none", "none", "none", "none"); 215 215 216 216 debug(""); 217 217 debug("Test getting and setting grid-template shorthand through JS"); 218 testGridDefinitionsSetJSValues(" 18px / 66px", "18px", "66px", "none");219 testGridDefinitionsSetJSValues(" 10px / [head] 'a' 15px [tail]", "10px", "[head] 15px [tail]", "\"a\"");218 testGridDefinitionsSetJSValues("66px / 18px", "18px", "66px", "none"); 219 testGridDefinitionsSetJSValues("[head] 'a' 15px [tail] / 10px", "10px", "[head] 15px [tail]", "\"a\""); 220 220 testGridDefinitionsSetJSValues("'a'", "none", "0px", "\"a\"", "none", "auto"); 221 221 222 222 debug(""); 223 223 debug("Test setting grid-template shorthand to bad values through JS"); 224 testGridDefinitionsSetBadJSValues(" none / 'a'");225 testGridDefinitionsSetBadJSValues(" 25px / 'a' [name] 10px");226 testGridDefinitionsSetBadJSValues("' a' / 'b'");224 testGridDefinitionsSetBadJSValues("'a' / none"); 225 testGridDefinitionsSetBadJSValues("'a' [name] 10px / 25px"); 226 testGridDefinitionsSetBadJSValues("'b' / 'a'"); 227 227 testGridDefinitionsSetBadJSValues("15px"); 228 testGridDefinitionsSetBadJSValues(" 15px / 20px none");229 testGridDefinitionsSetBadJSValues(" 25px / 10px 'a'");228 testGridDefinitionsSetBadJSValues("20px none / 15px"); 229 testGridDefinitionsSetBadJSValues("10px 'a' / 25px"); 230 230 231 231 </script> -
trunk/LayoutTests/fast/css-grid-layout/relayout-align-items-changed.html
r189910 r196934 3 3 <style> 4 4 .grid { 5 -webkit-grid: 1 00px 100px / 150px;5 -webkit-grid: 150px / 100px 100px; 6 6 position: relative; 7 7 } -
trunk/LayoutTests/fast/css-grid-layout/relayout-align-self-changed.html
r189910 r196934 3 3 <style> 4 4 .grid { 5 -webkit-grid: 1 00px 100px / 150px;5 -webkit-grid: 150px / 100px 100px; 6 6 width: 200px; 7 7 position: relative; -
trunk/LayoutTests/fast/css-grid-layout/relayout-indefinite-heights.html
r191879 r196934 3 3 <style> 4 4 .grid { 5 -webkit-grid: 50px / minmax(5px, 1fr) minmax(5px, 2fr);5 -webkit-grid: minmax(5px, 1fr) minmax(5px, 2fr) / 50px; 6 6 } 7 7 -
trunk/LayoutTests/fast/css-grid-layout/relayout-justify-items-changed.html
r189910 r196934 3 3 <style> 4 4 .grid { 5 -webkit-grid: 1 50px / 100px 100px;5 -webkit-grid: 100px 100px / 150px; 6 6 width: 150px; 7 7 position: relative; -
trunk/LayoutTests/fast/css-grid-layout/relayout-justify-self-changed.html
r189910 r196934 3 3 <style> 4 4 .grid { 5 -webkit-grid: 1 50px / 100px 100px;5 -webkit-grid: 100px 100px / 150px; 6 6 width: 150px; 7 7 position: relative; -
trunk/LayoutTests/fast/repaint/align-items-overflow-change.html
r194104 r196934 13 13 #container { 14 14 display: -webkit-grid; 15 -webkit-grid: 200px / 150px 150px;15 -webkit-grid: 150px 150px / 200px; 16 16 align-items: end unsafe; 17 17 width: 200px; -
trunk/LayoutTests/fast/repaint/align-self-change.html
r189910 r196934 14 14 #container { 15 15 display: -webkit-grid; 16 -webkit-grid: 100px 100px / 300px;16 -webkit-grid: 300px / 100px 100px; 17 17 width: 200px; 18 18 height: 300px; -
trunk/LayoutTests/fast/repaint/align-self-overflow-change.html
r194104 r196934 14 14 #container { 15 15 display: -webkit-grid; 16 -webkit-grid: 200px / 150px 150px;16 -webkit-grid: 150px 150px / 200px; 17 17 width: 200px; 18 18 height: 300px; -
trunk/LayoutTests/fast/repaint/justify-items-change.html
r189910 r196934 13 13 #container { 14 14 display: -webkit-grid; 15 -webkit-grid: 200px / 300px;15 -webkit-grid: 300px / 200px; 16 16 justify-items: end; 17 17 width: 200px; -
trunk/LayoutTests/fast/repaint/justify-items-overflow-change.html
r194104 r196934 13 13 #container { 14 14 display: -webkit-grid; 15 -webkit-grid: 100px 100px / 300px;15 -webkit-grid: 300px / 100px 100px; 16 16 justify-items: end unsafe; 17 17 width: 200px; -
trunk/LayoutTests/fast/repaint/justify-self-change.html
r189910 r196934 14 14 #container { 15 15 display: -webkit-grid; 16 -webkit-grid: 100px 100px / 300px;16 -webkit-grid: 300px / 100px 100px; 17 17 justify-items: center; 18 18 width: 200px; -
trunk/LayoutTests/fast/repaint/justify-self-overflow-change.html
r194104 r196934 14 14 #container { 15 15 display: -webkit-grid; 16 -webkit-grid: 100px 100px / 300px;16 -webkit-grid: 300px / 100px 100px; 17 17 width: 200px; 18 18 height: 300px; -
trunk/Source/WebCore/ChangeLog
r196906 r196934 1 2016-02-22 Manuel Rego Casasnovas <rego@igalia.com> 2 3 [css-grid] Swap columns and rows in grid-template shorthand 4 https://bugs.webkit.org/show_bug.cgi?id=154472 5 6 Reviewed by Darin Adler. 7 8 The spec was modified past December to change the order of 9 columns and rows in the grid-template shorthand: 10 https://github.com/w3c/csswg-drafts/commit/f6c7691679a519017a80ebae44fd86c3eae5c5f9 11 12 Updated the parsing and modified the tests to follow the new syntax. 13 14 * css/CSSParser.cpp: 15 (WebCore::CSSParser::parseGridTemplateColumns): 16 (WebCore::CSSParser::parseGridTemplateRowsAndAreasAndColumns): 17 (WebCore::CSSParser::parseGridTemplateShorthand): 18 (WebCore::CSSParser::parseGridTemplateRowsAndAreas): Renamed to 19 parseGridTemplateRowsAndAreasAndColumns(). 20 * css/CSSParser.h: 21 1 22 2016-02-22 Manuel Rego Casasnovas <rego@igalia.com> 2 23 -
trunk/Source/WebCore/css/CSSParser.cpp
r196906 r196934 5566 5566 } 5567 5567 5568 bool CSSParser::parseGridTemplateRowsAndAreas(PassRefPtr<CSSValue> templateColumns, bool important) 5568 RefPtr<CSSValue> CSSParser::parseGridTemplateColumns() 5569 { 5570 if (!(m_valueList->current() && isForwardSlashOperator(*m_valueList->current()) && m_valueList->next())) 5571 return nullptr; 5572 if (auto columnsValue = parseGridTrackList()) { 5573 if (m_valueList->current()) 5574 return nullptr; 5575 return columnsValue; 5576 } 5577 5578 return nullptr; 5579 } 5580 5581 bool CSSParser::parseGridTemplateRowsAndAreasAndColumns(bool important) 5569 5582 { 5570 5583 // At least template-areas strings must be defined. 5571 if (!m_valueList->current() )5584 if (!m_valueList->current() || isForwardSlashOperator(*m_valueList->current())) 5572 5585 return false; 5573 5586 … … 5578 5591 RefPtr<CSSValueList> templateRows = CSSValueList::createSpaceSeparated(); 5579 5592 5580 do{5593 while (m_valueList->current() && !isForwardSlashOperator(*m_valueList->current())) { 5581 5594 // Handle leading <custom-ident>*. 5582 5595 if (m_valueList->current()->unit == CSSParserValue::ValueList) { … … 5594 5607 5595 5608 // Handle template-rows's track-size. 5596 if (m_valueList->current() && m_valueList->current()->unit != CSSParserValue::ValueList && m_valueList->current()->unit != CSSPrimitiveValue::CSS_STRING) {5609 if (m_valueList->current() && !isForwardSlashOperator(*m_valueList->current()) && m_valueList->current()->unit != CSSParserValue::ValueList && m_valueList->current()->unit != CSSPrimitiveValue::CSS_STRING) { 5597 5610 RefPtr<CSSValue> value = parseGridTrackSize(*m_valueList); 5598 5611 if (!value) … … 5606 5619 if (m_valueList->current() && m_valueList->current()->unit == CSSParserValue::ValueList) 5607 5620 trailingIdentWasAdded = parseGridLineNames(*m_valueList, *templateRows); 5608 } while (m_valueList->current());5621 } 5609 5622 5610 5623 // [<track-list> /]? 5611 if (templateColumns) 5612 addProperty(CSSPropertyWebkitGridTemplateColumns, templateColumns, important); 5613 else 5614 addProperty(CSSPropertyWebkitGridTemplateColumns, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important); 5615 5616 // [<line-names>? <string> [<track-size> <line-names>]? ]+ 5624 RefPtr<CSSValue> templateColumns = nullptr; 5625 if (m_valueList->current()) { 5626 ASSERT(isForwardSlashOperator(*m_valueList->current())); 5627 templateColumns = parseGridTemplateColumns(); 5628 if (!templateColumns) 5629 return false; 5630 // The template-columns <track-list> can't be 'none'. 5631 if (templateColumns->isPrimitiveValue() && downcast<CSSPrimitiveValue>(*templateColumns).getValueID() == CSSValueNone) 5632 return false; 5633 } 5634 5635 addProperty(CSSPropertyWebkitGridTemplateRows, templateRows.release(), important); 5636 addProperty(CSSPropertyWebkitGridTemplateColumns, templateColumns ? templateColumns.release() : CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important); 5637 5617 5638 RefPtr<CSSValue> templateAreas = CSSGridTemplateAreasValue::create(gridAreaMap, rowCount, columnCount); 5618 5639 addProperty(CSSPropertyWebkitGridTemplateAreas, templateAreas.release(), important); 5619 addProperty(CSSPropertyWebkitGridTemplateRows, templateRows.release(), important);5620 5640 5621 5641 return true; … … 5641 5661 } 5642 5662 5643 unsigned index = 0; 5644 RefPtr<CSSValue> columnsValue = firstValueIsNone ? CSSValuePool::singleton().createIdentifierValue(CSSValueNone) : parseGridTrackList(); 5645 5646 // 2- <grid-template-columns> / <grid-template-columns> syntax. 5647 if (columnsValue) { 5648 if (!(m_valueList->current() && isForwardSlashOperator(*m_valueList->current()) && m_valueList->next())) 5663 // 2- <grid-template-rows> / <grid-template-columns> syntax. 5664 RefPtr<CSSValue> rowsValue; 5665 if (firstValueIsNone) 5666 rowsValue = CSSValuePool::singleton().createIdentifierValue(CSSValueNone); 5667 else 5668 rowsValue = parseGridTrackList(); 5669 5670 if (rowsValue) { 5671 auto columnsValue = parseGridTemplateColumns(); 5672 if (!columnsValue) 5649 5673 return false; 5650 index = m_valueList->currentIndex(); 5651 if (RefPtr<CSSValue> rowsValue = parseGridTrackList()) { 5652 if (m_valueList->current()) 5653 return false; 5654 addProperty(CSSPropertyWebkitGridTemplateColumns, columnsValue.release(), important); 5655 addProperty(CSSPropertyWebkitGridTemplateRows, rowsValue.release(), important); 5656 addProperty(CSSPropertyWebkitGridTemplateAreas, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important); 5657 return true; 5658 } 5659 } 5660 5661 5662 // 3- [<track-list> /]? [<line-names>? <string> [<track-size> <line-names>]? ]+ syntax. 5663 // The template-columns <track-list> can't be 'none'. 5664 if (firstValueIsNone) 5665 return false; 5674 5675 addProperty(CSSPropertyWebkitGridTemplateColumns, columnsValue.release(), important); 5676 addProperty(CSSPropertyWebkitGridTemplateRows, rowsValue.release(), important); 5677 addProperty(CSSPropertyWebkitGridTemplateAreas, CSSValuePool::singleton().createIdentifierValue(CSSValueNone), important); 5678 return true; 5679 } 5680 5681 5682 // 3- [<line-names>? <string> [<track-size> <line-names>]? ]+ syntax. 5666 5683 // It requires to rewind parsing due to previous syntax failures. 5667 m_valueList->setCurrentIndex( index);5668 return parseGridTemplateRowsAndAreas (columnsValue,important);5684 m_valueList->setCurrentIndex(0); 5685 return parseGridTemplateRowsAndAreasAndColumns(important); 5669 5686 } 5670 5687 -
trunk/Source/WebCore/css/CSSParser.h
r196851 r196934 211 211 RefPtr<CSSValue> parseGridPosition(); 212 212 bool parseGridItemPositionShorthand(CSSPropertyID, bool important); 213 bool parseGridTemplateRowsAndAreas(PassRefPtr<CSSValue>, bool important); 213 RefPtr<CSSValue> parseGridTemplateColumns(); 214 bool parseGridTemplateRowsAndAreasAndColumns(bool important); 214 215 bool parseGridTemplateShorthand(bool important); 215 216 bool parseGridShorthand(bool important);
Note: See TracChangeset
for help on using the changeset viewer.