Chromium Code Reviews| Index: third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp |
| diff --git a/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp |
| index 018a6821534df630fc239fa04035b19310b75991..202508c0946d4599ecefda164b63d6679b8ce8c3 100644 |
| --- a/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp |
| +++ b/third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp |
| @@ -6,6 +6,7 @@ |
| #include "core/animation/ColorPropertyFunctions.h" |
| #include "core/css/CSSColorValue.h" |
| +#include "core/css/CSSIdentifierValue.h" |
| #include "core/css/resolver/StyleResolverState.h" |
| #include "core/layout/LayoutTheme.h" |
| #include "wtf/PtrUtil.h" |
| @@ -78,14 +79,12 @@ std::unique_ptr<InterpolableValue> CSSColorInterpolationType::maybeCreateInterpo |
| { |
| if (value.isColorValue()) |
| return createInterpolableColor(toCSSColorValue(value).value()); |
| - if (!value.isPrimitiveValue()) |
| + if (!value.isIdentifierValue()) |
| return nullptr; |
| - const CSSPrimitiveValue& primitive = toCSSPrimitiveValue(value); |
| - if (!primitive.isValueID()) |
| + const CSSIdentifierValue& ident = toCSSIdentifierValue(value); |
|
rjwright
2016/09/22 01:29:55
Avoid abbreviated variable names. You've used "ide
|
| + if (!StyleColor::isColorKeyword(ident.getValueID())) |
| return nullptr; |
| - if (!StyleColor::isColorKeyword(primitive.getValueID())) |
| - return nullptr; |
| - return createInterpolableColor(primitive.getValueID()); |
| + return createInterpolableColor(ident.getValueID()); |
| } |
| static void addPremultipliedColor(double& red, double& green, double& blue, double& alpha, double fraction, const Color& color) |
| @@ -186,7 +185,7 @@ enum InterpolableColorPairIndex : unsigned { |
| InterpolationValue CSSColorInterpolationType::maybeConvertValue(const CSSValue& value, const StyleResolverState& state, ConversionCheckers& conversionCheckers) const |
| { |
| - if (cssProperty() == CSSPropertyColor && value.isPrimitiveValue() && toCSSPrimitiveValue(value).getValueID() == CSSValueCurrentcolor) |
| + if (cssProperty() == CSSPropertyColor && value.isIdentifierValue() && toCSSIdentifierValue(value).getValueID() == CSSValueCurrentcolor) |
| return maybeConvertInherit(state, conversionCheckers); |
| std::unique_ptr<InterpolableValue> interpolableColor = maybeCreateInterpolableColor(value); |