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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp

Issue 2597103002: Prevent floating point overflow when using calc() with large values (Closed)
Patch Set: Remove layout affected test case Created 3 years, 12 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/Source/core/css/CSSCalculationValue.cpp ('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/resolver/StyleBuilderConverter.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
index 3aa55be0cbd2530e75488a0a4e5ad97f7edb2cee..e551eeee99f61d940a30ad413d34fdd96999a913 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderConverter.cpp
@@ -850,8 +850,10 @@ Length StyleBuilderConverter::convertLineHeight(StyleResolverState& state,
100.0,
Fixed);
}
- if (primitiveValue.isNumber())
- return Length(primitiveValue.getDoubleValue() * 100.0, Percent);
+ if (primitiveValue.isNumber()) {
+ return Length(clampTo<float>(primitiveValue.getDoubleValue() * 100.0),
+ Percent);
+ }
if (primitiveValue.isCalculated()) {
Length zoomedLength = Length(primitiveValue.cssCalcValue()->toCalcValue(
lineHeightToLengthConversionData(state)));
« no previous file with comments | « third_party/WebKit/Source/core/css/CSSCalculationValue.cpp ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698