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

Unified Diff: third_party/WebKit/Source/core/css/properties/CSSPropertyAlignmentUtils.cpp

Issue 2746453005: [css-align] Adapt self-alignment properties to the new baseline syntax (Closed)
Patch Set: More layout tests fixes. 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/properties/CSSPropertyAlignmentUtils.cpp
diff --git a/third_party/WebKit/Source/core/css/properties/CSSPropertyAlignmentUtils.cpp b/third_party/WebKit/Source/core/css/properties/CSSPropertyAlignmentUtils.cpp
index f66a77cb425fecbf65f65abe6c6172d91538a1d3..10e32355095d27148db7190583abd5bb6caee888 100644
--- a/third_party/WebKit/Source/core/css/properties/CSSPropertyAlignmentUtils.cpp
+++ b/third_party/WebKit/Source/core/css/properties/CSSPropertyAlignmentUtils.cpp
@@ -21,16 +21,37 @@ CSSIdentifierValue* consumeSelfPositionKeyword(CSSParserTokenRange& range) {
return nullptr;
}
+CSSValue* consumeBaselineKeyword(CSSParserTokenRange& range) {
+ CSSValueID id = range.peek().id();
+ if (CSSPropertyParserHelpers::identMatches<CSSValueBaseline>(id))
+ return CSSPropertyParserHelpers::consumeIdent(range);
+
+ if (CSSIdentifierValue* preference =
+ CSSPropertyParserHelpers::consumeIdent<CSSValueFirst, CSSValueLast>(
+ range)) {
+ if (range.peek().id() == CSSValueBaseline) {
+ return CSSValuePair::create(preference,
+ CSSPropertyParserHelpers::consumeIdent(range),
+ CSSValuePair::DropIdenticalValues);
+ }
+ }
+ return nullptr;
+}
+
} // namespace
CSSValue* CSSPropertyAlignmentUtils::consumeSelfPositionOverflowPosition(
CSSParserTokenRange& range) {
if (CSSPropertyParserHelpers::identMatches<CSSValueAuto, CSSValueNormal,
- CSSValueStretch, CSSValueBaseline,
- CSSValueLastBaseline>(
+ CSSValueStretch>(
range.peek().id()))
return CSSPropertyParserHelpers::consumeIdent(range);
+ if (CSSPropertyParserHelpers::identMatches<CSSValueFirst, CSSValueLast,
+ CSSValueBaseline>(
+ range.peek().id()))
+ return consumeBaselineKeyword(range);
+
CSSIdentifierValue* overflowPosition =
CSSPropertyParserHelpers::consumeIdent<CSSValueUnsafe, CSSValueSafe>(
range);

Powered by Google App Engine
This is Rietveld 408576698