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

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

Issue 2382653006: Split CSSPrimitiveValue into CSSPrimitiveValue and CSSIdentifierValue (Closed)
Patch Set: Make check-webkit-style happy 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 a86d7470083f55054bf209d201edf02262121380..10524b5fb2feacc65b2796c4171a8c7f57748f2d 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"
@@ -80,14 +81,12 @@ std::unique_ptr<InterpolableValue>
CSSColorInterpolationType::maybeCreateInterpolableColor(const CSSValue& value) {
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,
@@ -212,8 +211,8 @@ 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 =

Powered by Google App Engine
This is Rietveld 408576698