| 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 1e5b59d5b980953f2e0921d528a5f1f094512a83..9f6856f951b452817706a573dade2ab96e77e282 100644
|
| --- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
|
| +++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
|
| @@ -3493,6 +3493,53 @@ bool CSSPropertyParser::consumeGridShorthand(bool important) {
|
| return true;
|
| }
|
|
|
| +static CSSValue* consumeSimplifiedContentPosition(CSSParserTokenRange& range) {
|
| + CSSValueID id = range.peek().id();
|
| + if (identMatches<CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline>(
|
| + id)) {
|
| + return CSSContentDistributionValue::create(
|
| + CSSValueInvalid, range.consumeIncludingWhitespace().id(),
|
| + CSSValueInvalid);
|
| + }
|
| + if (identMatches<CSSValueSpaceBetween, CSSValueSpaceAround,
|
| + CSSValueSpaceEvenly, CSSValueStretch>(id)) {
|
| + return CSSContentDistributionValue::create(
|
| + range.consumeIncludingWhitespace().id(), CSSValueInvalid,
|
| + CSSValueInvalid);
|
| + }
|
| + if (identMatches<CSSValueStart, CSSValueEnd, CSSValueCenter,
|
| + CSSValueFlexStart, CSSValueFlexEnd, CSSValueLeft,
|
| + CSSValueRight>(id)) {
|
| + return CSSContentDistributionValue::create(
|
| + CSSValueInvalid, range.consumeIncludingWhitespace().id(),
|
| + CSSValueInvalid);
|
| + }
|
| + return nullptr;
|
| +}
|
| +
|
| +bool CSSPropertyParser::consumePlaceContentShorthand(bool important) {
|
| + DCHECK(RuntimeEnabledFeatures::cssGridLayoutEnabled());
|
| + DCHECK_EQ(shorthandForProperty(CSSPropertyPlaceContent).length(),
|
| + static_cast<unsigned>(2));
|
| +
|
| + CSSValue* alignContentValue = consumeSimplifiedContentPosition(m_range);
|
| + if (!alignContentValue)
|
| + return false;
|
| + CSSValue* justifyContentValue =
|
| + m_range.atEnd() ? alignContentValue
|
| + : consumeSimplifiedContentPosition(m_range);
|
| + if (!justifyContentValue)
|
| + return false;
|
| + if (!m_range.atEnd())
|
| + return false;
|
| +
|
| + addProperty(CSSPropertyAlignContent, CSSPropertyPlaceContent,
|
| + *alignContentValue, important);
|
| + addProperty(CSSPropertyJustifyContent, CSSPropertyPlaceContent,
|
| + *justifyContentValue, important);
|
| + return true;
|
| +}
|
| +
|
| bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty,
|
| bool important) {
|
| CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty);
|
| @@ -3752,6 +3799,8 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty,
|
| return consumeGridTemplateShorthand(CSSPropertyGridTemplate, important);
|
| case CSSPropertyGrid:
|
| return consumeGridShorthand(important);
|
| + case CSSPropertyPlaceContent:
|
| + return consumePlaceContentShorthand(important);
|
| default:
|
| return false;
|
| }
|
|
|