Changeset 173615 in webkit
- Timestamp:
- Sep 15, 2014 2:12:18 AM (10 years ago)
- Location:
- trunk
- Files:
-
- 6 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/LayoutTests/ChangeLog
r173596 r173615 1 2014-09-12 Sergio Villar Senin <svillar@igalia.com> 2 3 [CSS Grid Layout] Crash at CSSParser::parseGridTemplateRowsAndAreas 4 https://bugs.webkit.org/show_bug.cgi?id=136778 5 6 Reviewed by Darin Adler. 7 8 Added some new test cases to verify that we properly handle empty 9 lists of grid line names. 10 11 * fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt: 12 * fast/css-grid-layout/grid-template-shorthand-get-set.html: 13 1 14 2014-09-10 Jon Honeycutt <jhoneycutt@apple.com> 2 15 -
trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt
r167799 r173615 41 41 PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-rows') is "0px" 42 42 PASS window.getComputedStyle(gridTemplateComplexFormOnlyAreas, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\"" 43 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNames, '').getPropertyValue('-webkit-grid-template-columns') is "none" 44 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNames, '').getPropertyValue('-webkit-grid-template-rows') is "(first) 0px" 45 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNames, '').getPropertyValue('-webkit-grid-template-areas') is "\"a\"" 43 46 44 47 Test getting wrong values for grid-template shorthand through CSS (they should resolve to the default: 'none') … … 103 106 PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-rows') is "none" 104 107 PASS window.getComputedStyle(gridTemplateComplexFormWithNoneColumns, '').getPropertyValue('-webkit-grid-template-areas') is "none" 108 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames, '').getPropertyValue('-webkit-grid-template-columns') is "none" 109 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames, '').getPropertyValue('-webkit-grid-template-rows') is "none" 110 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames, '').getPropertyValue('-webkit-grid-template-areas') is "none" 111 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames, '').getPropertyValue('-webkit-grid-template-columns') is "none" 112 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames, '').getPropertyValue('-webkit-grid-template-rows') is "none" 113 PASS window.getComputedStyle(gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames, '').getPropertyValue('-webkit-grid-template-areas') is "none" 105 114 106 115 Test the initial value -
trunk/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set.html
r168416 r173615 43 43 -webkit-grid-template: "a"; 44 44 } 45 #gridTemplateNoColumnsRowWithEmptyTrailingLineNames { 46 -webkit-grid-template: (first) "a" auto (); 47 } 45 48 46 49 /* Bad values. */ … … 105 108 #gridTemplateComplexFormWithNoneColumns { 106 109 -webkit-grid-template: none / "a" (name) 10px; 110 } 111 #gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames { 112 -webkit-grid-template: (first) "a" auto () (); 113 } 114 #gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames { 115 -webkit-grid-template: (first) "a" auto () (tail); 107 116 } 108 117 … … 123 132 <div class="grid" id="gridTemplateComplexFormWithAuto"></div> 124 133 <div class="grid" id="gridTemplateComplexFormOnlyAreas"></div> 134 <div class="grid" id="gridTemplateNoColumnsRowWithEmptyTrailingLineNames"></div> 135 <div class="grid" id="gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames"></div> 136 <div class="grid" id="gridTemplateNoColumnsRowWithNonEmptyLeadingLineNamesAndEmptyTrailingLineNames"></div> 125 137 <div class="grid" id="gridTemplateMultipleSlash"></div> 126 138 <div class="grid" id="gridTemplateSimpleFormJustColumns"></div> … … 143 155 <div class="grid" id="gridTemplateComplexFormColumnsNotParsing2"></div> 144 156 <div class="grid" id="gridTemplateComplexFormWithNoneColumns"></div> 157 <div class="grid" id="gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames"></div> 145 158 <script src="resources/grid-template-shorthand-parsing-utils.js"></script> 146 159 <script> … … 160 173 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithAuto"), "10px", "0px", '"a"'); 161 174 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormOnlyAreas"), "none", "0px", '"a"'); 175 testGridDefinitionsValues(document.getElementById("gridTemplateNoColumnsRowWithEmptyTrailingLineNames"), "none", "(first) 0px", '"a"'); 162 176 163 177 debug(""); … … 183 197 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormColumnsNotParsing2"), "none", "none", "none"); 184 198 testGridDefinitionsValues(document.getElementById("gridTemplateComplexFormWithNoneColumns"), "none", "none", "none"); 199 testGridDefinitionsValues(document.getElementById("gridTemplateNoColumnsRowWithTwoEmptyTrailingLineNames"), "none", "none", "none"); 200 testGridDefinitionsValues(document.getElementById("gridTemplateNoColumnsRowWithEmptyTrailingLineNamesAndNonEmptyLeadingLineNames"), "none", "none", "none"); 185 201 186 202 debug(""); -
trunk/Source/WebCore/ChangeLog
r173614 r173615 1 2014-09-12 Sergio Villar Senin <svillar@igalia.com> 2 3 [CSS Grid Layout] Crash at CSSParser::parseGridTemplateRowsAndAreas 4 https://bugs.webkit.org/show_bug.cgi?id=136778 5 6 Reviewed by Darin Adler. 7 8 An empty list of grid line names (represented by "()") does not 9 add anything to the list of parsed values. That's why trying to 10 concatenate an adjacent list of grid line names was failing, 11 because we were trying to concatenate a list with the last parsed 12 CSSValue which was not the expected grid line names list. 13 14 * css/CSSParser.cpp: 15 (WebCore::CSSParser::parseGridTemplateRowsAndAreas): 16 (WebCore::CSSParser::parseGridLineNames): 17 * css/CSSParser.h: 18 1 19 2014-09-15 Andres Gomez <agomez@igalia.com> 2 20 -
trunk/Source/WebCore/css/CSSParser.cpp
r173579 r173615 5016 5016 // This will handle the trailing/leading <custom-ident>* in the grammar. 5017 5017 trailingIdentWasAdded = false; 5018 if (m_valueList->current() && m_valueList->current()->unit == CSSParserValue::ValueList) { 5019 parseGridLineNames(*m_valueList, *templateRows); 5020 trailingIdentWasAdded = true; 5021 } 5018 if (m_valueList->current() && m_valueList->current()->unit == CSSParserValue::ValueList) 5019 trailingIdentWasAdded = parseGridLineNames(*m_valueList, *templateRows); 5022 5020 } while (m_valueList->current()); 5023 5021 … … 5195 5193 } 5196 5194 5197 voidCSSParser::parseGridLineNames(CSSParserValueList& inputList, CSSValueList& valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames)5195 bool CSSParser::parseGridLineNames(CSSParserValueList& inputList, CSSValueList& valueList, CSSGridLineNamesValue* previousNamedAreaTrailingLineNames) 5198 5196 { 5199 5197 ASSERT(inputList.current() && inputList.current()->unit == CSSParserValue::ValueList); … … 5202 5200 if (!identList->size()) { 5203 5201 inputList.next(); 5204 return ;5202 return false; 5205 5203 } 5206 5204 … … 5218 5216 5219 5217 inputList.next(); 5218 return true; 5220 5219 } 5221 5220 -
trunk/Source/WebCore/css/CSSParser.h
r173268 r173615 172 172 bool parseGridTemplateAreasRow(NamedGridAreaMap&, const unsigned, unsigned&); 173 173 PassRefPtr<CSSValue> parseGridTemplateAreas(); 174 voidparseGridLineNames(CSSParserValueList&, CSSValueList&, CSSGridLineNamesValue* = nullptr);174 bool parseGridLineNames(CSSParserValueList&, CSSValueList&, CSSGridLineNamesValue* = nullptr); 175 175 PassRefPtr<CSSValue> parseGridAutoFlow(CSSParserValueList&); 176 176 #endif
Note: See TracChangeset
for help on using the changeset viewer.