Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(363)

Unified Diff: third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp

Issue 1807603002: Move the grid-column/grid-row shorthands into CSSPropertyParser (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Patch for landing Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
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 1d3232c2f6586c6acb5f4b5aaa0b283d8f9b9118..3fd81406fd2c62285fd53822d4d9d94ebbcec537 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -4189,6 +4189,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 (consumeSlashIncludingWhitespace(m_range)) {
+ endValue = consumeGridLine(m_range);
+ if (!endValue)
+ return false;
+ } else {
+ endValue = startValue->isCustomIdentValue() ? startValue : cssValuePool().createIdentifierValue(CSSValueAuto);
+ }
+ if (!m_range.atEnd())
+ return false;
+ 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);
@@ -4366,6 +4390,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);

Powered by Google App Engine
This is Rietveld 408576698