| OLD | NEW |
| 1 #ifndef VisibilityStyleInterpolation_h | 1 #ifndef VisibilityStyleInterpolation_h |
| 2 #define VisibilityStyleInterpolation_h | 2 #define VisibilityStyleInterpolation_h |
| 3 | 3 |
| 4 #include "core/CSSValueKeywords.h" | 4 #include "core/CSSValueKeywords.h" |
| 5 #include "core/CoreExport.h" | 5 #include "core/CoreExport.h" |
| 6 #include "core/animation/StyleInterpolation.h" | 6 #include "core/animation/StyleInterpolation.h" |
| 7 #include "core/css/CSSPrimitiveValue.h" | 7 #include "core/css/CSSPrimitiveValue.h" |
| 8 | 8 |
| 9 namespace blink { | 9 namespace blink { |
| 10 | 10 |
| 11 class CORE_EXPORT VisibilityStyleInterpolation : public StyleInterpolation { | 11 class CORE_EXPORT VisibilityStyleInterpolation : public StyleInterpolation { |
| 12 public: | 12 public: |
| 13 static PassRefPtrWillBeRawPtr<VisibilityStyleInterpolation> create(const CSS
Value& start, const CSSValue& end, CSSPropertyID id) | 13 static VisibilityStyleInterpolation* create(const CSSValue& start, const CSS
Value& end, CSSPropertyID id) |
| 14 { | 14 { |
| 15 RefPtrWillBeRawPtr<VisibilityStyleInterpolation> interpolation = adoptRe
fWillBeNoop(new VisibilityStyleInterpolation( | 15 VisibilityStyleInterpolation* interpolation = new VisibilityStyleInterpo
lation(visibilityToInterpolableValue(start), visibilityToInterpolableValue(end),
id); |
| 16 visibilityToInterpolableValue(start), visibilityToInterpolableValue(
end), id)); | |
| 17 if (!isVisible(start)) { | 16 if (!isVisible(start)) { |
| 18 interpolation->m_notVisible = toCSSPrimitiveValue(start).getValueID(
); | 17 interpolation->m_notVisible = toCSSPrimitiveValue(start).getValueID(
); |
| 19 } else if (!isVisible(end)) { | 18 } else if (!isVisible(end)) { |
| 20 interpolation->m_notVisible = toCSSPrimitiveValue(end).getValueID(); | 19 interpolation->m_notVisible = toCSSPrimitiveValue(end).getValueID(); |
| 21 } | 20 } |
| 22 | 21 |
| 23 return interpolation.release(); | 22 return interpolation; |
| 24 } | 23 } |
| 25 | 24 |
| 26 static bool canCreateFrom(const CSSValue&); | 25 static bool canCreateFrom(const CSSValue&); |
| 27 static bool isVisible(const CSSValue&); | 26 static bool isVisible(const CSSValue&); |
| 28 | 27 |
| 29 void apply(StyleResolverState&) const override; | 28 void apply(StyleResolverState&) const override; |
| 30 DECLARE_VIRTUAL_TRACE(); | 29 DECLARE_VIRTUAL_TRACE(); |
| 31 | 30 |
| 32 private: | 31 private: |
| 33 VisibilityStyleInterpolation(PassOwnPtrWillBeRawPtr<InterpolableValue> start
, PassOwnPtrWillBeRawPtr<InterpolableValue> end, CSSPropertyID id) | 32 VisibilityStyleInterpolation(InterpolableValue* start, InterpolableValue* en
d, CSSPropertyID id) |
| 34 : StyleInterpolation(start, end, id) | 33 : StyleInterpolation(start, end, id) |
| 35 , m_notVisible(CSSValueVisible) | 34 , m_notVisible(CSSValueVisible) |
| 36 { | 35 { |
| 37 } | 36 } |
| 38 | 37 |
| 39 static PassOwnPtrWillBeRawPtr<InterpolableValue> visibilityToInterpolableVal
ue(const CSSValue&); | 38 static InterpolableValue* visibilityToInterpolableValue(const CSSValue&); |
| 40 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToVisibility(Interp
olableValue*, CSSValueID); | 39 static PassRefPtrWillBeRawPtr<CSSValue> interpolableValueToVisibility(Interp
olableValue*, CSSValueID); |
| 41 | 40 |
| 42 CSSValueID m_notVisible; | 41 CSSValueID m_notVisible; |
| 43 | 42 |
| 44 friend class AnimationVisibilityStyleInterpolationTest; | 43 friend class AnimationVisibilityStyleInterpolationTest; |
| 45 }; | 44 }; |
| 46 } | 45 } |
| 47 | 46 |
| 48 #endif | 47 #endif |
| OLD | NEW |