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

Unified Diff: third_party/WebKit/Source/core/animation/UnderlyingLengthChecker.h

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/UnderlyingLengthChecker.h
diff --git a/third_party/WebKit/Source/core/animation/UnderlyingLengthChecker.h b/third_party/WebKit/Source/core/animation/UnderlyingLengthChecker.h
new file mode 100644
index 0000000000000000000000000000000000000000..2ded6d49df1ccc2aef521acfcfa8c8d21b241b4a
--- /dev/null
+++ b/third_party/WebKit/Source/core/animation/UnderlyingLengthChecker.h
@@ -0,0 +1,44 @@
+// Copyright 2015 The Chromium Authors. All rights reserved.
+// Use of this source code is governed by a BSD-style license that can be
+// found in the LICENSE file.
+
+#ifndef UnderlyingLengthChecker_h
+#define UnderlyingLengthChecker_h
+
+#include "core/animation/InterpolableValue.h"
+#include "core/animation/InterpolationType.h"
+#include "core/animation/UnderlyingValue.h"
+
+namespace blink {
+
+class UnderlyingLengthChecker : public InterpolationType::ConversionChecker {
+public:
+ static PassOwnPtr<UnderlyingLengthChecker> create(const InterpolationType& type, size_t underlyingLength)
+ {
+ return adoptPtr(new UnderlyingLengthChecker(type, underlyingLength));
+ }
+
+ static size_t getUnderlyingLength(const UnderlyingValue& underlyingValue)
+ {
+ if (!underlyingValue)
+ return 0;
+ return toInterpolableList(underlyingValue->interpolableValue()).length();
+ }
+
+ 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;
+};
+
+} // namespace blink
+
+#endif // UnderlyingLengthChecker_h
« no previous file with comments | « third_party/WebKit/Source/core/animation/StringKeyframe.cpp ('k') | third_party/WebKit/Source/core/core.gypi » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698