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

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

Issue 1225553002: CSSValue Immediates: Make CSSPrimitiveValue a container (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@cssvalue_patch_1
Patch Set: Rebase Created 5 years, 5 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/ShadowStyleInterpolation.cpp
diff --git a/Source/core/animation/ShadowStyleInterpolation.cpp b/Source/core/animation/ShadowStyleInterpolation.cpp
index 7026b9dbd35b2799f09bef9030f5991a566040d5..adf267e4beaffaba402b1f72f1db82382fa49495 100644
--- a/Source/core/animation/ShadowStyleInterpolation.cpp
+++ b/Source/core/animation/ShadowStyleInterpolation.cpp
@@ -21,10 +21,10 @@ bool ShadowStyleInterpolation::canCreateFrom(const CSSValue& start, const CSSVal
&& toCSSShadowValue(start).color && toCSSShadowValue(end).color;
}
-PassOwnPtrWillBeRawPtr<InterpolableValue> ShadowStyleInterpolation::lengthToInterpolableValue(PassRefPtrWillBeRawPtr<CSSPrimitiveValue> value)
+PassOwnPtrWillBeRawPtr<InterpolableValue> ShadowStyleInterpolation::lengthToInterpolableValue(NullableCSSValue value)
{
if (value)
- return LengthStyleInterpolation::toInterpolableValue(value);
+ return LengthStyleInterpolation::toInterpolableValue(*value);
return LengthStyleInterpolation::toInterpolableValue(CSSPrimitiveValue::create(0, CSSPrimitiveValue::CSS_PX));
}
@@ -42,7 +42,7 @@ PassOwnPtrWillBeRawPtr<InterpolableValue> ShadowStyleInterpolation::toInterpolab
result->set(4, ColorStyleInterpolation::colorToInterpolableValue(CSSValue(*shadowValue.color.get())));
if (shadowValue.style)
- nonInterpolableData = (shadowValue.style->getValueID() == CSSValueInset);
+ nonInterpolableData = (toCSSPrimitiveValue(*shadowValue.style).getValueID() == CSSValueInset);
else
nonInterpolableData = false;
@@ -52,13 +52,13 @@ PassOwnPtrWillBeRawPtr<InterpolableValue> ShadowStyleInterpolation::toInterpolab
CSSValue ShadowStyleInterpolation::fromInterpolableValue(const InterpolableValue& value, NonInterpolableType nonInterpolableData, InterpolationRange range)
{
const InterpolableList* shadow = toInterpolableList(&value);
- RefPtrWillBeRawPtr<CSSPrimitiveValue> x = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(0), RangeAll);
- RefPtrWillBeRawPtr<CSSPrimitiveValue> y = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(1), RangeAll);
- RefPtrWillBeRawPtr<CSSPrimitiveValue> blur = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(2), RangeNonNegative);
- RefPtrWillBeRawPtr<CSSPrimitiveValue> spread = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(3), RangeAll);
+ CSSPrimitiveValue x = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(0), RangeAll);
+ CSSPrimitiveValue y = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(1), RangeAll);
+ CSSPrimitiveValue blur = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(2), RangeNonNegative);
+ CSSPrimitiveValue spread = LengthStyleInterpolation::fromInterpolableValue(*shadow->get(3), RangeAll);
- RefPtrWillBeRawPtr<CSSPrimitiveValue> color = ColorStyleInterpolation::interpolableValueToColor(*shadow->get(4));
- RefPtrWillBeRawPtr<CSSPrimitiveValue> style = nonInterpolableData ? CSSPrimitiveValue::createIdentifier(CSSValueInset) : CSSPrimitiveValue::createIdentifier(CSSValueNone);
+ CSSPrimitiveValue color = ColorStyleInterpolation::interpolableValueToColor(*shadow->get(4));
+ CSSPrimitiveValue style = nonInterpolableData ? CSSPrimitiveValue::createIdentifier(CSSValueInset) : CSSPrimitiveValue::createIdentifier(CSSValueNone);
RefPtrWillBeRawPtr<CSSShadowValue> result = CSSShadowValue::create(x, y, blur, spread, style, color);
return result.release();
« no previous file with comments | « Source/core/animation/ShadowStyleInterpolation.h ('k') | Source/core/animation/ShadowStyleInterpolationTest.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698