Index: Source/core/css/parser/CSSPropertyParser.cpp |
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp |
index 415f1c423d1ebccb836c0fb79e4af934945a7574..5623554ca25e7177a51952961f63e5ce72168c4a 100644 |
--- a/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -1260,6 +1260,16 @@ bool CSSPropertyParser::parseValue(CSSPropertyID unresolvedProperty, bool import |
parsedValue = parseGridPosition(); |
break; |
+ case CSSPropertyGridColumnGap: |
+ case CSSPropertyGridRowGap: |
+ ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
+ validPrimitive = validUnit(value, FLength | FNonNeg); |
+ break; |
+ |
+ case CSSPropertyGridGap: |
+ ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
+ return parseGridGapShorthand(important); |
+ |
case CSSPropertyGridColumn: |
case CSSPropertyGridRow: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
@@ -3416,6 +3426,49 @@ bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSS |
return true; |
} |
+bool CSSPropertyParser::parseGridGapShorthand(bool important) |
+{ |
+ ShorthandScope scope(this, CSSPropertyGridGap); |
+ ASSERT(shorthandForProperty(CSSPropertyGridGap).length() == 2); |
+ |
+ CSSParserValue* value = m_valueList->current(); |
+ if (!value) |
+ return false; |
+ |
+ if (value->id == CSSValueNormal) { |
+ if (m_valueList->next()) |
+ return false; |
+ addProperty(CSSPropertyGridColumnGap, cssValuePool().createImplicitInitialValue(), important); |
+ addProperty(CSSPropertyGridRowGap, cssValuePool().createImplicitInitialValue(), important); |
+ return true; |
+ } |
+ |
+ if (!validUnit(value, FLength | FNonNeg)) |
+ return false; |
+ |
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> columnGap = createPrimitiveNumericValue(value); |
+ |
+ value = m_valueList->next(); |
+ if (!value) { |
+ addProperty(CSSPropertyGridColumnGap, columnGap, important); |
+ addProperty(CSSPropertyGridRowGap, columnGap, important); |
+ return true; |
+ } |
+ |
+ if (!validUnit(value, FLength | FNonNeg)) |
+ return false; |
+ |
+ if (m_valueList->next()) |
+ return false; |
+ |
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> rowGap = createPrimitiveNumericValue(value); |
+ |
+ addProperty(CSSPropertyGridColumnGap, columnGap, important); |
+ addProperty(CSSPropertyGridRowGap, rowGap, important); |
+ |
+ return true; |
+} |
+ |
bool CSSPropertyParser::parseGridTemplateShorthand(bool important) |
{ |