Index: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
diff --git a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
index 267de532af62206e4160625e1694c8a17423c30b..603263f289696a1f322bfb45f52a8878532e9517 100644 |
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
@@ -1146,6 +1146,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()); |
@@ -3167,6 +3177,39 @@ bool CSSPropertyParser::parseGridItemPositionShorthand(CSSPropertyID shorthandId |
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 (!validUnit(value, FLength | FNonNeg)) |
+ return false; |
+ |
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> columnGap = createPrimitiveNumericValue(value); |
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> rowGap = nullptr; |
+ |
+ value = m_valueList->next(); |
+ if (value) { |
+ if (!validUnit(value, FLength | FNonNeg)) |
+ return false; |
+ |
+ rowGap = createPrimitiveNumericValue(value); |
+ if (m_valueList->next()) |
+ return false; |
+ } else { |
+ rowGap = columnGap; |
+ } |
+ |
+ addProperty(CSSPropertyGridColumnGap, columnGap, important); |
+ addProperty(CSSPropertyGridRowGap, rowGap, important); |
+ |
+ return true; |
+} |
+ |
bool CSSPropertyParser::parseGridTemplateRowsAndAreas(PassRefPtrWillBeRawPtr<CSSValue> templateColumns, bool important) |
{ |
NamedGridAreaMap gridAreaMap; |