Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(713)

Unified Diff: Source/core/css/parser/CSSPropertyParser.cpp

Issue 1309513008: [css-grid] Implement grid gutters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Removed two tests which were not testing gutters code Created 5 years, 3 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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)
{

Powered by Google App Engine
This is Rietveld 408576698