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

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

Issue 2002063004: [css-grid] Disallow repeat() in grid-template shorthand (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rebased patch for landing Created 4 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
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
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 70b4a404fbd6b5c3877d3b75e19d12722e6bffc0..4df46a6f007a27b271e510df4f93617cd9694f38 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3365,7 +3365,6 @@ static CSSPrimitiveValue* consumeGridBreadth(CSSParserTokenRange& range, CSSPars
return consumeLengthOrPercent(range, cssParserMode, ValueRangeNonNegative, UnitlessQuirk::Allow);
}
-// TODO(rob.buis): This needs a bool parameter so we can disallow <auto-track-list> for the grid shorthand.
static CSSValue* consumeGridTrackSize(CSSParserTokenRange& range, CSSParserMode cssParserMode)
{
const CSSParserToken& token = range.peek();
@@ -3462,7 +3461,7 @@ static bool consumeGridTrackRepeatFunction(CSSParserTokenRange& range, CSSParser
return true;
}
-static CSSValue* consumeGridTrackList(CSSParserTokenRange& range, CSSParserMode cssParserMode)
+static CSSValue* consumeGridTrackList(CSSParserTokenRange& range, CSSParserMode cssParserMode, bool allowRepeat = true)
{
CSSValueList* values = CSSValueList::createSpaceSeparated();
CSSGridLineNamesValue* lineNames = consumeGridLineNames(range);
@@ -3474,6 +3473,8 @@ static CSSValue* consumeGridTrackList(CSSParserTokenRange& range, CSSParserMode
do {
bool isAutoRepeat;
if (range.peek().functionId() == CSSValueRepeat) {
+ if (!allowRepeat)
+ return nullptr;
if (!consumeGridTrackRepeatFunction(range, cssParserMode, *values, isAutoRepeat, allTracksAreFixedSized))
return nullptr;
if (isAutoRepeat && seenAutoRepeat)
@@ -4861,7 +4862,7 @@ bool CSSPropertyParser::consumeGridTemplateRowsAndAreasAndColumns(CSSPropertyID
if (!m_range.atEnd()) {
if (!consumeSlashIncludingWhitespace(m_range))
return false;
- columnsValue = consumeGridTrackList(m_range, m_context.mode());
+ columnsValue = consumeGridTrackList(m_range, m_context.mode(), false);
if (!columnsValue || !m_range.atEnd())
return false;
} else {
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css-grid-layout/grid-template-shorthand-get-set-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698