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

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

Issue 2314443002: Code health: Add type checks to CSSLengthInterpolationType::nonInterpolableValuesAreCompatible() (Closed)
Patch Set: Simplify macro 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/NonInterpolableValue.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
index e40e294ac45cb45a2d73d3c31a4086c30ef2a584..1a858ab6f4b428a7a356a1992a49ce562af5a204 100644
--- a/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/CSSLengthInterpolationType.cpp
@@ -29,11 +29,7 @@ public:
{
return create(hasPercentage(a) || hasPercentage(b));
}
- static bool hasPercentage(const NonInterpolableValue* nonInterpolableValue)
- {
- DCHECK(!nonInterpolableValue || nonInterpolableValue->getType() == CSSLengthNonInterpolableValue::staticType);
- return static_cast<bool>(nonInterpolableValue);
- }
+ static bool hasPercentage(const NonInterpolableValue*);
DECLARE_NON_INTERPOLABLE_VALUE_TYPE();
@@ -44,6 +40,12 @@ private:
DEFINE_NON_INTERPOLABLE_VALUE_TYPE(CSSLengthNonInterpolableValue);
DEFINE_NON_INTERPOLABLE_VALUE_TYPE_CASTS(CSSLengthNonInterpolableValue);
+bool CSSLengthNonInterpolableValue::hasPercentage(const NonInterpolableValue* nonInterpolableValue)
+{
+ DCHECK(isCSSLengthNonInterpolableValue(nonInterpolableValue));
+ return static_cast<bool>(nonInterpolableValue);
+}
+
CSSLengthInterpolationType::CSSLengthInterpolationType(CSSPropertyID property)
: CSSInterpolationType(property)
, m_valueRange(LengthPropertyFunctions::getValueRange(property))
@@ -98,8 +100,10 @@ PairwiseInterpolationValue CSSLengthInterpolationType::staticMergeSingleConversi
CSSLengthNonInterpolableValue::merge(start.nonInterpolableValue.get(), end.nonInterpolableValue.get()));
}
-bool CSSLengthInterpolationType::nonInterpolableValuesAreCompatible(const NonInterpolableValue*, const NonInterpolableValue*)
+bool CSSLengthInterpolationType::nonInterpolableValuesAreCompatible(const NonInterpolableValue* a, const NonInterpolableValue* b)
{
+ DCHECK(isCSSLengthNonInterpolableValue(a));
+ DCHECK(isCSSLengthNonInterpolableValue(b));
return true;
}
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/animation/NonInterpolableValue.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698