| Index: Source/core/css/CSSParser.cpp
|
| diff --git a/Source/core/css/CSSParser.cpp b/Source/core/css/CSSParser.cpp
|
| index d5986b7312f64ce49759eb68bd6df02d68bff85b..a5a69cedf7529d7500d5f712aed6612261782e4b 100644
|
| --- a/Source/core/css/CSSParser.cpp
|
| +++ b/Source/core/css/CSSParser.cpp
|
| @@ -2549,7 +2549,7 @@ bool CSSParser::parseValue(CSSPropertyID propId, bool important)
|
| if (!cssGridLayoutEnabled())
|
| return false;
|
|
|
| - validPrimitive = id == CSSValueAuto || (validUnit(value, FInteger) && value->fValue);
|
| + parsedValue = parseGridPosition();
|
| break;
|
|
|
| case CSSPropertyWebkitGridColumn:
|
| @@ -4609,6 +4609,50 @@ bool CSSParser::parseAnimationProperty(CSSPropertyID propId, RefPtr<CSSValue>& r
|
| return false;
|
| }
|
|
|
| +PassRefPtr<CSSValue> CSSParser::parseGridPosition()
|
| +{
|
| + CSSParserValue* value = m_valueList->current();
|
| + if (value->id == CSSValueAuto) {
|
| + m_valueList->next();
|
| + return cssValuePool().createIdentifierValue(CSSValueAuto);
|
| + }
|
| +
|
| + RefPtr<CSSPrimitiveValue> numericValue;
|
| + bool hasSeenSpanKeyword = false;
|
| +
|
| + if (validUnit(value, FInteger) && value->fValue) {
|
| + numericValue = createPrimitiveNumericValue(value);
|
| + value = m_valueList->next();
|
| + if (value && value->id == CSSValueSpan) {
|
| + hasSeenSpanKeyword = true;
|
| + m_valueList->next();
|
| + }
|
| + } else if (value->id == CSSValueSpan) {
|
| + hasSeenSpanKeyword = true;
|
| + value = m_valueList->next();
|
| + if (value && (validUnit(value, FInteger) && value->fValue)) {
|
| + numericValue = createPrimitiveNumericValue(value);
|
| + m_valueList->next();
|
| + }
|
| + }
|
| +
|
| + if (!hasSeenSpanKeyword)
|
| + return numericValue.release();
|
| +
|
| + if (!numericValue && hasSeenSpanKeyword)
|
| + return cssValuePool().createIdentifierValue(CSSValueSpan);
|
| +
|
| + // Negative numbers are not allowed for span (but are for <integer>).
|
| + if (numericValue && numericValue->getIntValue() < 0)
|
| + return 0;
|
| +
|
| + RefPtr<CSSValueList> values = CSSValueList::createSpaceSeparated();
|
| + values->append(cssValuePool().createIdentifierValue(CSSValueSpan));
|
| + if (numericValue)
|
| + values->append(numericValue.release());
|
| + return values.release();
|
| +}
|
| +
|
| bool CSSParser::parseGridItemPositionShorthand(CSSPropertyID shorthandId, bool important)
|
| {
|
| ShorthandScope scope(this, shorthandId);
|
|
|