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 c9c995bc63ba21fde79a60f8bb4d30c005a7ed7d..e782d607a2ffed2ecf58e73e50890065966e9fd2 100644 |
| --- a/Source/core/css/parser/CSSPropertyParser.cpp |
| +++ b/Source/core/css/parser/CSSPropertyParser.cpp |
| @@ -90,6 +90,8 @@ namespace WebCore { |
| static const double MAX_SCALE = 1000000; |
| +#define MAX_REPETITIONS 10000 |
|
Julien - ping for review
2014/04/25 15:50:34
Let's use a static constant.
|
| + |
| template <unsigned N> |
| static bool equal(const CSSParserString& a, const char (&b)[N]) |
| { |
| @@ -3797,6 +3799,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 MAX_REPETITIONS. |
| + if (repetitions > MAX_REPETITIONS) |
| + repetitions = MAX_REPETITIONS; |
|
Julien - ping for review
2014/04/25 15:50:34
Let's use min as this is our preferred way to do c
|
| RefPtrWillBeRawPtr<CSSValueList> repeatedValues = CSSValueList::createSpaceSeparated(); |
| arguments->next(); // Skip the repetition count. |
| arguments->next(); // Skip the comma. |