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

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

Issue 1709963002: [css-align] New CSS Value 'normal' for Self Alignment (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New test for alignment and anonymous boxes. Created 4 years, 6 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/CSSPropertyParser.cpp
diff --git a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
index cdfe75ff20c5f27efd7768bba1cde486d66d1067..f4df648bca5ec0508153b436c68607b4917707b2 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3155,7 +3155,7 @@ static CSSPrimitiveValue* consumeSelfPositionKeyword(CSSParserTokenRange& range)
static CSSValue* consumeSelfPositionOverflowPosition(CSSParserTokenRange& range)
{
- if (identMatches<CSSValueAuto, CSSValueStretch, CSSValueBaseline, CSSValueLastBaseline>(range.peek().id()))
+ if (identMatches<CSSValueAuto, CSSValueNormal, CSSValueStretch, CSSValueBaseline, CSSValueLastBaseline>(range.peek().id()))
return consumeIdent(range);
CSSPrimitiveValue* overflowPosition = consumeIdent<CSSValueUnsafe, CSSValueSafe>(range);
@@ -3169,6 +3169,14 @@ static CSSValue* consumeSelfPositionOverflowPosition(CSSParserTokenRange& range)
return selfPosition;
}
+static CSSValue* consumeAlignItems(CSSParserTokenRange& range)
+{
+ // align-items property does not allow the 'auto' value.
+ if (identMatches<CSSValueAuto>(range.peek().id()))
+ return nullptr;
+ return consumeSelfPositionOverflowPosition(range);
+}
+
static CSSValue* consumeJustifyItems(CSSParserTokenRange& range)
{
CSSParserTokenRange rangeCopy = range;
@@ -3918,9 +3926,11 @@ CSSValue* CSSPropertyParser::parseSingleValue(CSSPropertyID unresolvedProperty,
case CSSPropertyWebkitMaskRepeatX:
case CSSPropertyWebkitMaskRepeatY:
return nullptr;
+ case CSSPropertyAlignItems:
+ DCHECK(RuntimeEnabledFeatures::cssGridLayoutEnabled());
+ return consumeAlignItems(m_range);
case CSSPropertyJustifySelf:
case CSSPropertyAlignSelf:
- case CSSPropertyAlignItems:
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled());
return consumeSelfPositionOverflowPosition(m_range);
case CSSPropertyJustifyItems:

Powered by Google App Engine
This is Rietveld 408576698