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

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

Issue 2346193002: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Rebase please work Created 4 years, 3 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/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..0ee2b2096d383150c22d11b6852a44489e3ab6bf 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& identifierValue = toCSSIdentifierValue(value);
+ if (!StyleColor::isColorKeyword(identifierValue.getValueID()))
return nullptr;
- if (!StyleColor::isColorKeyword(primitive.getValueID()))
- return nullptr;
- return createInterpolableColor(primitive.getValueID());
+ return createInterpolableColor(identifierValue.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);

Powered by Google App Engine
This is Rietveld 408576698