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

Unified Diff: third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp

Issue 1309513008: [css-grid] Implement grid gutters (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Rebased patch for landing Created 5 years, 2 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: 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;
« no previous file with comments | « third_party/WebKit/Source/core/css/parser/CSSPropertyParser.h ('k') | third_party/WebKit/Source/core/frame/UseCounter.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698