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

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

Issue 333423005: [CSS Grid Layout] Implement 'justify-items' parsing (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Created 6 years, 6 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: Source/core/css/parser/CSSPropertyParser.cpp
diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp
index 4c3d25149345a119e48b66d79f01144bdcbaeba9..980291b196034b1f630b38b07da4947adf693141 100644
--- a/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/Source/core/css/parser/CSSPropertyParser.cpp
@@ -1199,6 +1199,13 @@ bool CSSPropertyParser::parseValue(CSSPropertyID propId, bool important)
return false;
return parseItemPositionOverflowPosition(propId, important);
+
+ case CSSPropertyJustifyItems:
+ if (!RuntimeEnabledFeatures::cssGridLayoutEnabled())
+ return false;
+
+ return parseLegacyPosition(propId, important) || parseItemPositionOverflowPosition(propId, important);
+
case CSSPropertyGridAutoColumns:
case CSSPropertyGridAutoRows:
if (!RuntimeEnabledFeatures::cssGridLayoutEnabled())
@@ -4133,6 +4140,21 @@ static bool isItemPositionKeyword(CSSValueID id)
|| id == CSSValueFlexEnd || id == CSSValueLeft || id == CSSValueRight;
}
+bool CSSPropertyParser::parseLegacyPosition(CSSPropertyID propId, bool important)
+{
+ // [ legacy && [ left | right | center ]
+
+ CSSParserValue* value = m_valueList->current();
+ if (value->id != CSSValueLegacy || !m_valueList->next())
+ return false;
+
+ if (value->id == CSSValueCenter || value->id == CSSValueLeft || value->id == CSSValueRight) {
cbiesinger 2014/06/17 22:53:33 Don't you need an m_valueList->current() call / ke
jfernandez 2014/06/19 15:19:14 Done.
+ addProperty(propId, cssValuePool().createIdentifierValue(value->id), important);
+ }
cbiesinger 2014/06/17 22:53:33 else return false?
jfernandez 2014/06/19 15:19:14 Done.
+
+ return true;
cbiesinger 2014/06/17 22:53:33 Also, I'm not 100% sure but I think you need an "i
jfernandez 2014/06/19 15:19:14 Done.
+}
+
bool CSSPropertyParser::parseItemPositionOverflowPosition(CSSPropertyID propId, bool important)
{
// auto | baseline | stretch | [<item-position> && <overflow-position>? ]

Powered by Google App Engine
This is Rietveld 408576698