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

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: Rebase 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 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);

Powered by Google App Engine
This is Rietveld 408576698