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

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

Issue 2546993002: [css-grid] Fix crash clamping grid lines (Closed)
Patch Set: Created 4 years 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 | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp » ('j') | 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 39ac942aad9b8ce76275ccacdd4eb1b6a9b68713..4392c4060e9ae92e461cf991b0e24cf991d7717f 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3021,6 +3021,16 @@ static CSSValue* consumeGridLine(CSSParserTokenRange& range) {
return nullptr; // An <integer> value of zero makes the declaration
// invalid.
+ if (numericValue) {
jfernandez 2016/12/02 12:28:03 Wouldn't be better to define new CSSPrimitiveValue
Manuel Rego 2016/12/15 16:51:22 Uploaded new version following this approach.
+ if (numericValue->getIntValue() > kGridMaxTracks) {
+ numericValue = CSSPrimitiveValue::create(
+ kGridMaxTracks, CSSPrimitiveValue::UnitType::Integer);
+ } else if (numericValue->getIntValue() < -kGridMaxTracks) {
+ numericValue = CSSPrimitiveValue::create(
+ -kGridMaxTracks, CSSPrimitiveValue::UnitType::Integer);
+ }
+ }
+
CSSValueList* values = CSSValueList::createSpaceSeparated();
if (spanValue)
values->append(*spanValue);
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/css/parser/CSSPropertyParserTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698