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

Side by Side 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 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 unified diff | Download patch
OLDNEW
(Empty)
1 // Copyright 2015 The Chromium Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style license that can be
3 // found in the LICENSE file.
4
5 #ifndef UnderlyingLengthChecker_h
6 #define UnderlyingLengthChecker_h
7
8 #include "core/animation/InterpolableValue.h"
9 #include "core/animation/InterpolationType.h"
10 #include "core/animation/UnderlyingValue.h"
11
12 namespace blink {
13
14 class UnderlyingLengthChecker : public InterpolationType::ConversionChecker {
15 public:
16 static PassOwnPtr<UnderlyingLengthChecker> create(const InterpolationType& t ype, size_t underlyingLength)
17 {
18 return adoptPtr(new UnderlyingLengthChecker(type, underlyingLength));
19 }
20
21 static size_t getUnderlyingLength(const UnderlyingValue& underlyingValue)
22 {
23 if (!underlyingValue)
24 return 0;
25 return toInterpolableList(underlyingValue->interpolableValue()).length() ;
26 }
27
28 bool isValid(const InterpolationEnvironment&, const UnderlyingValue& underly ingValue) const final
29 {
30 return m_underlyingLength == getUnderlyingLength(underlyingValue);
31 }
32
33 private:
34 UnderlyingLengthChecker(const InterpolationType& type, size_t underlyingLeng th)
35 : ConversionChecker(type)
36 , m_underlyingLength(underlyingLength)
37 {}
38
39 size_t m_underlyingLength;
40 };
41
42 } // namespace blink
43
44 #endif // UnderlyingLengthChecker_h
OLDNEW
« 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