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

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

Issue 1419733009: Web Animations: Add SVGNumberListInterpolationType (Closed) Base URL: ssh://pony.syd/usr/local/google/home/alancutter/repos/chromium/src@_svgRectInterpolationType
Patch Set: Fix responsive test derp Created 5 years, 1 month 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/SVGPointListInterpolationType.cpp
diff --git a/third_party/WebKit/Source/core/animation/SVGPointListInterpolationType.cpp b/third_party/WebKit/Source/core/animation/SVGPointListInterpolationType.cpp
index de13fb6a8805efe8da117386bec0ebb834afdf68..532a8c3655fdf9b658d07a0bba6af72cd24882f5 100644
--- a/third_party/WebKit/Source/core/animation/SVGPointListInterpolationType.cpp
+++ b/third_party/WebKit/Source/core/animation/SVGPointListInterpolationType.cpp
@@ -6,44 +6,20 @@
#include "core/animation/SVGPointListInterpolationType.h"
#include "core/animation/InterpolationEnvironment.h"
+#include "core/animation/StringKeyframe.h"
+#include "core/animation/UnderlyingLengthChecker.h"
#include "core/svg/SVGPointList.h"
namespace blink {
-static size_t getUnderlyingLength(const UnderlyingValue& underlyingValue)
-{
- if (!underlyingValue)
- return 0;
- return toInterpolableList(underlyingValue->interpolableValue()).length();
-}
-
-class UnderlyingLengthChecker : public InterpolationType::ConversionChecker {
-public:
- static PassOwnPtr<UnderlyingLengthChecker> create(const InterpolationType& type, size_t underlyingLength)
- {
- return adoptPtr(new UnderlyingLengthChecker(type, underlyingLength));
- }
-
- bool isValid(const InterpolationEnvironment&, const UnderlyingValue& underlyingValue) const final
- {
- return m_underlyingLength == getUnderlyingLength(underlyingValue);
- }
-
-private:
- UnderlyingLengthChecker(const InterpolationType& type, size_t underlyingLength)
- : ConversionChecker(type)
- , m_underlyingLength(underlyingLength)
- {}
-
- size_t m_underlyingLength;
-};
-
PassOwnPtr<InterpolationValue> SVGPointListInterpolationType::maybeConvertNeutral(const UnderlyingValue& underlyingValue, ConversionCheckers& conversionCheckers) const
{
- size_t underlyingLength = getUnderlyingLength(underlyingValue);
+ size_t underlyingLength = UnderlyingLengthChecker::getUnderlyingLength(underlyingValue);
conversionCheckers.append(UnderlyingLengthChecker::create(*this, underlyingLength));
+
if (underlyingLength == 0)
return nullptr;
+
OwnPtr<InterpolableList> result = InterpolableList::create(underlyingLength);
for (size_t i = 0; i < underlyingLength; i++)
result->set(i, InterpolableNumber::create(0));

Powered by Google App Engine
This is Rietveld 408576698