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

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

Issue 1979603002: [css-grid] Fix behavior of flexible track breadths (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: New version fixing comment Created 4 years, 7 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 565127705adba3e30bfe5e08269ffabb5055a199..6c9a2503a7e8c7f2441804dcacf2e3144c327fa9 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3281,16 +3281,16 @@ static bool parseGridTemplateAreasRow(const String& gridRowNames, NamedGridAreaM
return true;
}
-enum TrackSizeRestriction { FixedSizeOnly, AllowAll };
+enum TrackSizeRestriction { FixedSizeOnly, InflexibleSizeOnly, AllowAll };
static CSSPrimitiveValue* consumeGridBreadth(CSSParserTokenRange& range, CSSParserMode cssParserMode, TrackSizeRestriction restriction = AllowAll)
{
- if (restriction == AllowAll) {
+ if (restriction != FixedSizeOnly) {
const CSSParserToken& token = range.peek();
if (identMatches<CSSValueMinContent, CSSValueMaxContent, CSSValueAuto>(token.id()))
return consumeIdent(range);
if (token.type() == DimensionToken && token.unitType() == CSSPrimitiveValue::UnitType::Fraction) {
- if (range.peek().numericValue() < 0)
+ if (restriction == InflexibleSizeOnly || range.peek().numericValue() < 0)
return nullptr;
return cssValuePool().createValue(range.consumeIncludingWhitespace().numericValue(), CSSPrimitiveValue::UnitType::Fraction);
}
@@ -3308,7 +3308,8 @@ static CSSValue* consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode
if (token.functionId() == CSSValueMinmax) {
CSSParserTokenRange rangeCopy = range;
CSSParserTokenRange args = consumeFunction(rangeCopy);
- CSSPrimitiveValue* minTrackBreadth = consumeGridBreadth(args, cssParserMode, restriction);
+ TrackSizeRestriction minTrackBreadthRestriction = restriction == AllowAll ? InflexibleSizeOnly : restriction;
+ CSSPrimitiveValue* minTrackBreadth = consumeGridBreadth(args, cssParserMode, minTrackBreadthRestriction);
if (!minTrackBreadth || !consumeCommaIncludingWhitespace(args))
return nullptr;
CSSPrimitiveValue* maxTrackBreadth = consumeGridBreadth(args, cssParserMode);

Powered by Google App Engine
This is Rietveld 408576698