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

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

Issue 2762623002: [css-align] Adapt the place-content shorthand to the new baseline syntax (Closed)
Patch Set: Additional refactoring to deal with baseline value ID Created 3 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 6fe47f228470057c49d82480d02fdb3d9e35ff00..a74e71a1f3c502bd2b36c779cdbc3948500e91ff 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3301,21 +3301,29 @@ bool CSSPropertyParser::consumeGridShorthand(bool important) {
static CSSValue* consumeSimplifiedContentPosition(CSSParserTokenRange& range) {
CSSValueID id = range.peek().id();
- if (identMatches<CSSValueNormal, CSSValueBaseline, CSSValueLastBaseline>(
Bugs Nash 2017/03/29 02:01:01 should CSSValueLastBaseline be removed? it's not c
jfernandez 2017/03/29 10:43:10 Actually not. It's debatable whether we need a dif
- id)) {
+ if (identMatches<CSSValueNormal>(id)) {
return CSSContentDistributionValue::create(
CSSValueInvalid, range.consumeIncludingWhitespace().id(),
CSSValueInvalid);
}
- if (identMatches<CSSValueSpaceBetween, CSSValueSpaceAround,
- CSSValueSpaceEvenly, CSSValueStretch>(id)) {
+
+ if (CSSPropertyAlignmentUtils::isBaselineKeyword(id)) {
+ CSSValue* baseline =
+ CSSPropertyAlignmentUtils::consumeBaselineKeyword(range);
Bugs Nash 2017/03/29 02:01:01 consumeBaselineKeyword doesn't consume whitespace,
jfernandez 2017/03/29 10:43:10 I'm not sure I understand this comment. consumeBas
Bugs Nash 2017/03/29 21:52:11 cool np
+ if (!baseline)
+ return nullptr;
+ return CSSContentDistributionValue::create(
+ CSSValueInvalid,
+ CSSPropertyAlignmentUtils::getBaselineKeyword(*baseline),
+ CSSValueInvalid);
+ }
+
+ if (CSSPropertyAlignmentUtils::isContentDistributionKeyword(id)) {
return CSSContentDistributionValue::create(
range.consumeIncludingWhitespace().id(), CSSValueInvalid,
CSSValueInvalid);
}
- if (identMatches<CSSValueStart, CSSValueEnd, CSSValueCenter,
- CSSValueFlexStart, CSSValueFlexEnd, CSSValueLeft,
- CSSValueRight>(id)) {
+ if (CSSPropertyAlignmentUtils::isContentPositionKeyword(id)) {
Bugs Nash 2017/03/29 02:01:01 this should be combined with the if block above th
jfernandez 2017/03/29 10:43:10 Done.
return CSSContentDistributionValue::create(
CSSValueInvalid, range.consumeIncludingWhitespace().id(),
CSSValueInvalid);

Powered by Google App Engine
This is Rietveld 408576698