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 dc0d3dfa091f986b3cec68434e57e4107398e819..9a6b641e2ff5cfc1ea537e0441e59d087811182d 100644 |
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp |
@@ -4449,6 +4449,30 @@ bool CSSPropertyParser::consumeBackgroundShorthand(const StylePropertyShorthand& |
return true; |
} |
+bool CSSPropertyParser::consumeGridItemPositionShorthand(CSSPropertyID shorthandId, bool important) |
+{ |
+ ASSERT(RuntimeEnabledFeatures::cssGridLayoutEnabled()); |
+ const StylePropertyShorthand& shorthand = shorthandForProperty(shorthandId); |
+ ASSERT(shorthand.length() == 2); |
+ RefPtrWillBeRawPtr<CSSValue> startValue = consumeGridLine(m_range); |
+ if (!startValue) |
+ return false; |
+ |
+ RefPtrWillBeRawPtr<CSSValue> endValue = nullptr; |
+ if (!m_range.atEnd()) { |
Timothy Loh
2016/03/17 23:14:55
I think more regular to do
if (consumeSlash..) {
|
+ if (!consumeSlashIncludingWhitespace(m_range)) |
+ return false; |
+ endValue = consumeGridLine(m_range); |
+ if (!endValue || !m_range.atEnd()) |
+ return false; |
+ } else { |
+ endValue = startValue->isCustomIdentValue() ? startValue : cssValuePool().createIdentifierValue(CSSValueAuto); |
+ } |
+ addProperty(shorthand.properties()[0], startValue, important); |
+ addProperty(shorthand.properties()[1], endValue, important); |
+ return true; |
+} |
+ |
bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool important) |
{ |
CSSPropertyID property = resolveCSSPropertyID(unresolvedProperty); |
@@ -4626,6 +4650,9 @@ bool CSSPropertyParser::parseShorthand(CSSPropertyID unresolvedProperty, bool im |
addProperty(CSSPropertyGridColumnGap, columnGap.release(), important); |
return true; |
} |
+ case CSSPropertyGridColumn: |
+ case CSSPropertyGridRow: |
+ return consumeGridItemPositionShorthand(property, important); |
default: |
m_currentShorthand = oldShorthand; |
CSSParserValueList valueList(m_range); |