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

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

Issue 1574933002: Changed type of border-width longhands from unsigned to float. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Added trivial tests safe to rebaseline to TestExpectations Created 4 years, 10 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
Index: third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index ef9d7145afca6bc040bb3210fda0089bd630156e..a8ea7e23937d818664e4c1e73e58890876bbae5c 100644
--- a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -96,7 +96,6 @@ BorderImageLength animatableValueToBorderImageLength(const AnimatableValue* valu
template<typename T> T animatableValueClampTo(const AnimatableValue* value, T min = defaultMinimumForClamp<T>(), T max = defaultMaximumForClamp<T>())
{
- static_assert(std::is_integral<T>::value, "should use integral type T when rounding values");
return clampTo<T>(roundForImpreciseConversion<T>(toAnimatableDouble(value)->toDouble()), min, max);
}
@@ -104,7 +103,7 @@ template<typename T> T animatableLineWidthClamp(const AnimatableValue* value)
{
double doubleValue = toAnimatableDouble(value)->toDouble();
// This matches StyleBuilderConverter::convertLineWidth().
- return (doubleValue > 0 && doubleValue < 1) ? 1 : animatableValueClampTo<T>(value);
+ return (doubleValue > 0 && doubleValue < 1) ? 1 : animatableValueClampTo<T>(value, 0);
}
LengthBox animatableValueToLengthBox(const AnimatableValue* value, const StyleResolverState& state, ValueRange range = ValueRangeAll)
@@ -323,7 +322,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setBorderBottomRightRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
return;
case CSSPropertyBorderBottomWidth:
- style->setBorderBottomWidth(animatableLineWidthClamp<unsigned>(value));
+ style->setBorderBottomWidth(animatableLineWidthClamp<float>(value));
return;
case CSSPropertyBorderImageOutset:
style->setBorderImageOutset(animatableValueToBorderImageLengthBox(value, state));
@@ -343,14 +342,14 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setVisitedLinkBorderLeftColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyBorderLeftWidth:
- style->setBorderLeftWidth(animatableLineWidthClamp<unsigned>(value));
+ style->setBorderLeftWidth(animatableLineWidthClamp<float>(value));
return;
case CSSPropertyBorderRightColor:
style->setBorderRightColor(toAnimatableColor(value)->color());
style->setVisitedLinkBorderRightColor(toAnimatableColor(value)->visitedLinkColor());
return;
case CSSPropertyBorderRightWidth:
- style->setBorderRightWidth(animatableLineWidthClamp<unsigned>(value));
+ style->setBorderRightWidth(animatableLineWidthClamp<float>(value));
return;
case CSSPropertyBorderTopColor:
style->setBorderTopColor(toAnimatableColor(value)->color());
@@ -363,7 +362,7 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setBorderTopRightRadius(animatableValueToLengthSize(value, state, ValueRangeNonNegative));
return;
case CSSPropertyBorderTopWidth:
- style->setBorderTopWidth(animatableLineWidthClamp<unsigned>(value));
+ style->setBorderTopWidth(animatableLineWidthClamp<float>(value));
return;
case CSSPropertyBottom:
style->setBottom(animatableValueToLength(value, state));

Powered by Google App Engine
This is Rietveld 408576698