| OLD | NEW |
| 1 // Copyright 2015 The Chromium Authors. All rights reserved. | 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 | 2 // Use of this source code is governed by a BSD-style license that can be |
| 3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
| 4 | 4 |
| 5 #ifndef CSSInterpolationType_h | 5 #ifndef CSSInterpolationType_h |
| 6 #define CSSInterpolationType_h | 6 #define CSSInterpolationType_h |
| 7 | 7 |
| 8 #include "core/animation/InterpolationEnvironment.h" | 8 #include "core/animation/InterpolationEnvironment.h" |
| 9 #include "core/animation/InterpolationType.h" | 9 #include "core/animation/InterpolationType.h" |
| 10 | 10 |
| 11 namespace blink { | 11 namespace blink { |
| 12 | 12 |
| 13 class CSSCustomPropertyDeclaration; | 13 class CSSCustomPropertyDeclaration; |
| 14 class PropertyRegistration; | 14 class PropertyRegistration; |
| 15 | 15 |
| 16 class CSSInterpolationType : public InterpolationType { | 16 class CSSInterpolationType : public InterpolationType { |
| 17 public: | 17 public: |
| 18 void SetCustomPropertyRegistration(const PropertyRegistration&); | 18 void SetCustomPropertyRegistration(const PropertyRegistration&); |
| 19 | 19 |
| 20 class CSSConversionChecker : public ConversionChecker { |
| 21 public: |
| 22 bool IsValid(const InterpolationEnvironment& environment, |
| 23 const InterpolationValue& underlying) const final { |
| 24 return IsValid(environment.GetState(), underlying); |
| 25 } |
| 26 |
| 27 protected: |
| 28 virtual bool IsValid(const StyleResolverState&, |
| 29 const InterpolationValue& underlying) const = 0; |
| 30 }; |
| 31 |
| 20 protected: | 32 protected: |
| 21 CSSInterpolationType(PropertyHandle); | 33 CSSInterpolationType(PropertyHandle); |
| 22 | 34 |
| 23 CSSPropertyID CssProperty() const { return GetProperty().CssProperty(); } | 35 CSSPropertyID CssProperty() const { return GetProperty().CssProperty(); } |
| 24 | 36 |
| 25 InterpolationValue MaybeConvertSingle(const PropertySpecificKeyframe&, | 37 InterpolationValue MaybeConvertSingle(const PropertySpecificKeyframe&, |
| 26 const InterpolationEnvironment&, | 38 const InterpolationEnvironment&, |
| 27 const InterpolationValue& underlying, | 39 const InterpolationValue& underlying, |
| 28 ConversionCheckers&) const final; | 40 ConversionCheckers&) const final; |
| 29 virtual InterpolationValue MaybeConvertNeutral( | 41 virtual InterpolationValue MaybeConvertNeutral( |
| (...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 79 void ApplyCustomPropertyValue(const InterpolableValue&, | 91 void ApplyCustomPropertyValue(const InterpolableValue&, |
| 80 const NonInterpolableValue*, | 92 const NonInterpolableValue*, |
| 81 StyleResolverState&) const; | 93 StyleResolverState&) const; |
| 82 | 94 |
| 83 WeakPersistent<const PropertyRegistration> registration_; | 95 WeakPersistent<const PropertyRegistration> registration_; |
| 84 }; | 96 }; |
| 85 | 97 |
| 86 } // namespace blink | 98 } // namespace blink |
| 87 | 99 |
| 88 #endif // CSSInterpolationType_h | 100 #endif // CSSInterpolationType_h |
| OLD | NEW |