| Index: Source/core/css/parser/CSSPropertyParser.cpp
|
| diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
|
| index 4c3d25149345a119e48b66d79f01144bdcbaeba9..d0ba6240a22e1ddd685fbbdd92387b5e645f1179 100644
|
| --- a/Source/core/css/parser/CSSPropertyParser.cpp
|
| +++ b/Source/core/css/parser/CSSPropertyParser.cpp
|
| @@ -1199,6 +1199,18 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
|
| return false;
|
|
|
| return parseItemPositionOverflowPosition(propId, important);
|
| +
|
| + case CSSPropertyJustifyItems:
|
| + if (!RuntimeEnabledFeatures::cssGridLayoutEnabled())
|
| + return false;
|
| +
|
| + if (!parseLegacyPosition(propId, important)) {
|
| + m_valueList->setCurrentIndex(0);
|
| + return parseItemPositionOverflowPosition(propId, important);
|
| + }
|
| +
|
| + return true;
|
| +
|
| case CSSPropertyGridAutoColumns:
|
| case CSSPropertyGridAutoRows:
|
| if (!RuntimeEnabledFeatures::cssGridLayoutEnabled())
|
| @@ -4133,6 +4145,25 @@ static bool isItemPositionKeyword(CSSValueID id)
|
| || id == CSSValueFlexEnd || id == CSSValueLeft || id == CSSValueRight;
|
| }
|
|
|
| +bool CSSPropertyParser::parseLegacyPosition(CSSPropertyID propId, bool important)
|
| +{
|
| + // [ legacy && [ left | right | center ]
|
| +
|
| + CSSParserValue* value = m_valueList->current();
|
| + if (!value || value->id != CSSValueLegacy || !(value = m_valueList->next()))
|
| + return false;
|
| +
|
| + if (value->id == CSSValueCenter || value->id == CSSValueLeft || value->id == CSSValueRight) {
|
| + if (m_valueList->next())
|
| + return false;
|
| +
|
| + addProperty(propId, createPrimitiveValuePair(cssValuePool().createIdentifierValue(CSSValueLegacy), cssValuePool().createIdentifierValue(value->id)), important);
|
| + return true;
|
| + }
|
| +
|
| + return false;
|
| +}
|
| +
|
| bool CSSPropertyParser::parseItemPositionOverflowPosition(CSSPropertyID propId, bool important)
|
| {
|
| // auto | baseline | stretch | [<item-position> && <overflow-position>? ]
|
| @@ -4140,6 +4171,8 @@ bool CSSPropertyParser::parseItemPositionOverflowPosition(CSSPropertyID propId,
|
| // <overflow-position> = true | safe
|
|
|
| CSSParserValue* value = m_valueList->current();
|
| + if (!value)
|
| + return false;
|
|
|
| if (value->id == CSSValueAuto || value->id == CSSValueBaseline || value->id == CSSValueStretch) {
|
| if (m_valueList->next())
|
|
|