Chromium Code Reviews| Index: Source/core/css/parser/CSSPropertyParser.cpp |
| diff --git a/Source/core/css/parser/CSSPropertyParser.cpp b/Source/core/css/parser/CSSPropertyParser.cpp |
| index 81f39eeb9d516d0674b378673fb105cdf2c220d9..6fc1ee5f66daa0ef9f03509a72c847dd8210bd24 100644 |
| --- a/Source/core/css/parser/CSSPropertyParser.cpp |
| +++ b/Source/core/css/parser/CSSPropertyParser.cpp |
| @@ -85,7 +85,7 @@ |
| namespace blink { |
| static const double MAX_SCALE = 1000000; |
| -static const unsigned minRepetitions = 10000; |
| +static const size_t maxRepetitions = 10000; |
|
alancutter (OOO until 2018)
2014/08/15 05:06:42
Can this constant live inside parseGridTrackRepeat
Timothy Loh
2014/08/15 05:29:10
Done.
|
| template <unsigned N> |
| static bool equal(const CSSParserString& a, const char (&b)[N]) |
| @@ -3769,10 +3769,9 @@ bool CSSPropertyParser::parseGridTrackRepeatFunction(CSSValueList& list) |
| ASSERT_WITH_SECURITY_IMPLICATION(arguments->valueAt(0)->fValue > 0); |
| size_t repetitions = arguments->valueAt(0)->fValue; |
| - // Clamp repetitions at minRepetitions. |
| - // http://www.w3.org/TR/css-grid-1/#repeat-notation |
| - if (repetitions > minRepetitions) |
| - repetitions = minRepetitions; |
| + // The spec allows us to clamp the number of repetitions: http://www.w3.org/TR/css-grid-1/#repeat-notation |
| + repetitions = std::min(repetitions, maxRepetitions); |
| + |
| RefPtrWillBeRawPtr<CSSValueList> repeatedValues = CSSValueList::createSpaceSeparated(); |
| arguments->next(); // Skip the repetition count. |
| arguments->next(); // Skip the comma. |