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

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

Issue 2546993002: [css-grid] Fix crash clamping grid lines (Closed)
Patch Set: Use clampTo() 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..ed601721d3060b50648635bb01ba9d65beadd763 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -3021,6 +3021,12 @@ static CSSValue* consumeGridLine(CSSParserTokenRange& range) {
return nullptr; // An <integer> value of zero makes the declaration
// invalid.
+ if (numericValue) {
+ numericValue = CSSPrimitiveValue::create(
+ clampTo(numericValue->getIntValue(), -kGridMaxTracks, 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