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

Unified Diff: Source/core/animation/LengthBoxStyleInterpolation.cpp

Issue 851633002: Animation: Add template for ListStyleInterpolation (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Add else to shadowToInterpolableValue Created 5 years, 11 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: Source/core/animation/LengthBoxStyleInterpolation.cpp
diff --git a/Source/core/animation/LengthBoxStyleInterpolation.cpp b/Source/core/animation/LengthBoxStyleInterpolation.cpp
index 08778ab378f9cd347ef5a4f98c3ea138324e6400..9ff212a14c78ed7047f50d8254ae616eac2637ff 100644
--- a/Source/core/animation/LengthBoxStyleInterpolation.cpp
+++ b/Source/core/animation/LengthBoxStyleInterpolation.cpp
@@ -23,7 +23,7 @@ PassOwnPtrWillBeRawPtr<InterpolableValue> LengthBoxStyleInterpolation::lengthBox
CSSPrimitiveValue* side[numberOfSides] = { rect->left(), rect->right(), rect->top(), rect->bottom() };
for (size_t i = 0; i < numberOfSides; i++) {
- result->set(i, LengthStyleInterpolation::lengthToInterpolableValue(*side[i]));
+ result->set(i, LengthStyleInterpolation::toInterpolableValue(*side[i]));
}
return result.release();
}
@@ -33,10 +33,10 @@ PassRefPtrWillBeRawPtr<CSSValue> LengthBoxStyleInterpolation::interpolableValueT
InterpolableList* lengthBox = toInterpolableList(value);
RefPtrWillBeRawPtr<Rect> result = Rect::create();
- result->setLeft(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(0), RangeNonNegative));
- result->setRight(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(1), RangeNonNegative));
- result->setTop(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(2), RangeNonNegative));
- result->setBottom(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(3), RangeNonNegative));
+ result->setLeft(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(0), RangeNonNegative));
+ result->setRight(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(1), RangeNonNegative));
+ result->setTop(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(2), RangeNonNegative));
+ result->setBottom(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(3), RangeNonNegative));
return CSSPrimitiveValue::create(result.release());
}
@@ -72,7 +72,7 @@ PassOwnPtrWillBeRawPtr<InterpolableValue> LengthBoxStyleInterpolation::borderIma
CSSPrimitiveValue* side[numberOfSides] = { quad->left(), quad->right(), quad->top(), quad->bottom() };
for (size_t i = 0; i < numberOfSides; i++) {
- result->set(i, LengthStyleInterpolation::lengthToInterpolableValue(*side[i]));
+ result->set(i, LengthStyleInterpolation::toInterpolableValue(*side[i]));
}
return result.release();
}
@@ -87,10 +87,10 @@ PassRefPtrWillBeRawPtr<CSSValue> LengthBoxStyleInterpolation::interpolableValueT
InterpolableList* lengthBox = toInterpolableList(value);
RefPtrWillBeRawPtr<Quad> quad = Quad::create();
- quad->setLeft(toPrimitiveValue(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(0), RangeNonNegative)));
- quad->setRight(toPrimitiveValue(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(1), RangeNonNegative)));
- quad->setTop(toPrimitiveValue(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(2), RangeNonNegative)));
- quad->setBottom(toPrimitiveValue(LengthStyleInterpolation::interpolableValueToLength(lengthBox->get(3), RangeNonNegative)));
+ quad->setLeft(toPrimitiveValue(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(0), RangeNonNegative)));
+ quad->setRight(toPrimitiveValue(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(1), RangeNonNegative)));
+ quad->setTop(toPrimitiveValue(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(2), RangeNonNegative)));
+ quad->setBottom(toPrimitiveValue(LengthStyleInterpolation::fromInterpolableValue(*lengthBox->get(3), RangeNonNegative)));
return CSSBorderImageSliceValue::create(CSSPrimitiveValue::create(quad.release()), fill);
}

Powered by Google App Engine
This is Rietveld 408576698