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

Unified Diff: third_party/WebKit/Source/core/animation/CSSPositionAxisListInterpolationType.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/CSSPositionAxisListInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/CSSPositionAxisListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/CSSPositionAxisListInterpolationType.cpp
index cf8fb28bcc0e6af1fd3b36f9397d76136fa5db18..5050c5479a6d3ac36f15c36ef9ac6374ee67b838 100644
--- a/third_party/WebKit/Source/core/animation/CSSPositionAxisListInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/CSSPositionAxisListInterpolationType.cpp
@@ -6,7 +6,7 @@
#include "core/animation/LengthInterpolationFunctions.h"
#include "core/animation/ListInterpolationFunctions.h"
-#include "core/css/CSSPrimitiveValue.h"
+#include "core/css/CSSIdentifierValue.h"
#include "core/css/CSSValueList.h"
#include "core/css/CSSValuePair.h"
@@ -17,20 +17,20 @@ InterpolationValue CSSPositionAxisListInterpolationType::convertPositionAxisCSSV
if (value.isValuePair()) {
const CSSValuePair& pair = toCSSValuePair(value);
InterpolationValue result = LengthInterpolationFunctions::maybeConvertCSSValue(pair.second());
- CSSValueID side = toCSSPrimitiveValue(pair.first()).getValueID();
+ CSSValueID side = toCSSIdentifierValue(pair.first()).getValueID();
if (side == CSSValueRight || side == CSSValueBottom)
LengthInterpolationFunctions::subtractFromOneHundredPercent(result);
return result;
}
- if (!value.isPrimitiveValue())
- return nullptr;
-
- const CSSPrimitiveValue& primitveValue = toCSSPrimitiveValue(value);
- if (!primitveValue.isValueID())
+ if (value.isPrimitiveValue())
return LengthInterpolationFunctions::maybeConvertCSSValue(value);
- switch (primitveValue.getValueID()) {
+ if (!value.isIdentifierValue())
+ return nullptr;
+
+ const CSSIdentifierValue& ident = toCSSIdentifierValue(value);
+ switch (ident.getValueID()) {
case CSSValueLeft:
case CSSValueTop:
return LengthInterpolationFunctions::createInterpolablePercent(0);

Powered by Google App Engine
This is Rietveld 408576698