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

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

Issue 1935173002: Reject calcs with both lengths and percentages in radial-gradient (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: 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/radial-gradient-calc-percentage-pixels.html ('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 9747909d190c672e8e721bb393c7087fed298746..199002ba26900add3c16777b503e180bdda07e81 100644
--- a/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
+++ b/third_party/WebKit/Source/core/css/parser/CSSPropertyParser.cpp
@@ -2286,9 +2286,11 @@ static CSSValue* consumeRadialGradient(CSSParserTokenRange& args, CSSParserMode
if (shape && shape->getValueID() == CSSValueEllipse && horizontalSize && !verticalSize)
return nullptr;
// If there's only one size, it must be a length.
- // TODO(timloh): Calcs with both lengths and percentages should be rejected.
if (!verticalSize && horizontalSize && horizontalSize->isPercentage())
return nullptr;
+ if ((horizontalSize && horizontalSize->isCalculatedPercentageWithLength())
+ || (verticalSize && verticalSize->isCalculatedPercentageWithLength()))
+ return nullptr;
result->setShape(shape);
result->setSizingBehavior(sizeKeyword);
« no previous file with comments | « third_party/WebKit/LayoutTests/fast/css/radial-gradient-calc-percentage-pixels.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698