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

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: Changes after rune's review 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 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;
« 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