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 d23f9a0d730630f9196c543fd6d5371a524537da..c8eec3b7b2b6c24adc62aba41053fa5b28c77d1f 100644 |
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
@@ -1144,6 +1144,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()); |
@@ -3171,6 +3181,41 @@ 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; |
+ |
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> columnGap = nullptr; |
fs
2015/10/07 10:25:19
Nit: With this new structure, I'd propose that the
|
+ RefPtrWillBeRawPtr<CSSPrimitiveValue> rowGap = nullptr; |
+ |
+ if (!validUnit(value, FLength | FNonNeg)) |
+ return false; |
+ |
+ columnGap = createPrimitiveNumericValue(value); |
+ |
+ 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; |