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 f9359994090209a2ccb411fdeee4995e4d15494e..41a7679fbca9ac9aed6bac0314df7a0d76461456 100644 |
--- a/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/LegacyCSSPropertyParser.cpp |
@@ -308,7 +308,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSProperty |
} |
case CSSPropertyJustifySelf: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
- parsedValue = parseItemPositionOverflowPosition(); |
+ parsedValue = parseItemPositionOverflowPosition(propId); |
break; |
case CSSPropertyJustifyItems: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
@@ -317,7 +317,7 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSProperty |
break; |
m_valueList->setCurrentIndex(0); |
- parsedValue = parseItemPositionOverflowPosition(); |
+ parsedValue = parseItemPositionOverflowPosition(propId); |
break; |
case CSSPropertyGridAutoFlow: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
@@ -352,12 +352,12 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::legacyParseValue(CSSProperty |
case CSSPropertyAlignSelf: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
- parsedValue = parseItemPositionOverflowPosition(); |
+ parsedValue = parseItemPositionOverflowPosition(propId); |
break; |
case CSSPropertyAlignItems: |
ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
- parsedValue = parseItemPositionOverflowPosition(); |
+ parsedValue = parseItemPositionOverflowPosition(propId); |
break; |
// Everything else is handled in CSSPropertyParser.cpp |
@@ -2099,9 +2099,9 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseLegacyPosition() |
return CSSValuePair::create(cssValuePool().createIdentifierValue(CSSValueLegacy), cssValuePool().createIdentifierValue(value->id), CSSValuePair::DropIdenticalValues); |
} |
-PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseItemPositionOverflowPosition() |
+PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseItemPositionOverflowPosition(CSSPropertyID propId) |
{ |
- // auto | stretch | <baseline-position> | [<item-position> && <overflow-position>? ] |
+ // auto | normal | stretch | <baseline-position> | [<item-position> && <overflow-position>? ] |
// <baseline-position> = baseline | last-baseline; |
// <item-position> = center | start | end | self-start | self-end | flex-start | flex-end | left | right; |
// <overflow-position> = unsafe | safe |
@@ -2109,7 +2109,10 @@ PassRefPtrWillBeRawPtr<CSSValue> CSSPropertyParser::parseItemPositionOverflowPos |
CSSParserValue* value = m_valueList->current(); |
ASSERT(value); |
- if (value->id == CSSValueAuto || value->id == CSSValueStretch || isBaselinePositionKeyword(value->id)) { |
+ if (value->id == CSSValueAuto || value->id == CSSValueNormal || value->id == CSSValueStretch || isBaselinePositionKeyword(value->id)) { |
+ // align-items property does not allow the 'auto' value. |
+ if (value->id == CSSValueAuto && propId == CSSPropertyAlignItems) |
+ return nullptr; |
m_valueList->next(); |
return cssValuePool().createIdentifierValue(value->id); |
} |