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

Unified Diff: third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp

Issue 1457623003: Clamp animated numbers according to ComputedStyle data type (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Update test Created 5 years, 1 month 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/animations/big-number-clamping.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/animation/NumberPropertyFunctions.cpp
diff --git a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp
index 89c4c8ec56336a3cf9eae4112f1ea53291bdbcac..c6728e57b50a082bc0807a79e78e01f6b38c2e0b 100644
--- a/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp
+++ b/third_party/WebKit/Source/core/animation/NumberPropertyFunctions.cpp
@@ -89,32 +89,34 @@ double NumberPropertyFunctions::clampNumber(CSSPropertyID property, double value
{
switch (property) {
case CSSPropertyOrphans:
- case CSSPropertyWebkitColumnCount:
case CSSPropertyWidows:
- return clampTo<double>(round(value), 1);
+ return clampTo<short>(round(value), 1);
+
+ case CSSPropertyWebkitColumnCount:
+ return clampTo<unsigned short>(round(value), 1);
case CSSPropertyStrokeMiterlimit:
- return clampTo<double>(value, 1);
+ return clampTo<float>(value, 1);
case CSSPropertyFloodOpacity:
case CSSPropertyStopOpacity:
case CSSPropertyStrokeOpacity:
case CSSPropertyShapeImageThreshold:
- return clampTo<double>(value, 0, 1);
+ return clampTo<float>(value, 0, 1);
case CSSPropertyFillOpacity:
case CSSPropertyOpacity:
- return clampTo<double>(value, 0, nextafterf(1, 0));
+ return clampTo<float>(value, 0, nextafterf(1, 0));
case CSSPropertyFlexGrow:
case CSSPropertyFlexShrink:
case CSSPropertyFontSizeAdjust:
case CSSPropertyLineHeight:
- return clampTo<double>(value, 0);
+ return clampTo<float>(value, 0);
case CSSPropertyWebkitColumnRuleWidth:
Eric Willigers 2015/11/18 00:18:54 AnimatedStyleBuilder::applyProperty and ComputedSt
alancutter (OOO until 2018) 2015/11/18 00:33:28 Updated, also fixed AnimatedStyleBuilder calls to
case CSSPropertyZIndex:
- return round(value);
+ return clampTo<int>(round(value));
default:
ASSERT_NOT_REACHED();
« no previous file with comments | « third_party/WebKit/LayoutTests/animations/big-number-clamping.html ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698