OLD | NEW |
1 #include "config.h" | 1 #include "config.h" |
2 #include "core/animation/VisibilityStyleInterpolation.h" | 2 #include "core/animation/VisibilityStyleInterpolation.h" |
3 | 3 |
4 #include "core/css/CSSPrimitiveValue.h" | 4 #include "core/css/CSSPrimitiveValue.h" |
5 #include "core/css/resolver/StyleBuilder.h" | 5 #include "core/css/resolver/StyleBuilder.h" |
6 | 6 |
7 namespace blink { | 7 namespace blink { |
8 | 8 |
9 bool VisibilityStyleInterpolation::canCreateFrom(const CSSValue& value) | 9 bool VisibilityStyleInterpolation::canCreateFrom(const CSSValue& value) |
10 { | 10 { |
(...skipping 17 matching lines...) Expand all Loading... |
28 } | 28 } |
29 return InterpolableNumber::create(0.0); | 29 return InterpolableNumber::create(0.0); |
30 } | 30 } |
31 | 31 |
32 PassRefPtrWillBeRawPtr<CSSValue> VisibilityStyleInterpolation::interpolableValue
ToVisibility(InterpolableValue* value, CSSValueID notVisible) | 32 PassRefPtrWillBeRawPtr<CSSValue> VisibilityStyleInterpolation::interpolableValue
ToVisibility(InterpolableValue* value, CSSValueID notVisible) |
33 { | 33 { |
34 ASSERT(value->isNumber()); | 34 ASSERT(value->isNumber()); |
35 InterpolableNumber* number = toInterpolableNumber(value); | 35 InterpolableNumber* number = toInterpolableNumber(value); |
36 | 36 |
37 if (number->value() > 0) | 37 if (number->value() > 0) |
38 return CSSPrimitiveValue::createIdentifier(CSSValueVisible); | 38 return CSSPrimitiveValue::create(CSSValueVisible); |
39 return CSSPrimitiveValue::createIdentifier(notVisible); | 39 return CSSPrimitiveValue::create(notVisible); |
40 } | 40 } |
41 | 41 |
42 void VisibilityStyleInterpolation::apply(StyleResolverState& state) const | 42 void VisibilityStyleInterpolation::apply(StyleResolverState& state) const |
43 { | 43 { |
44 StyleBuilder::applyProperty(m_id, state, interpolableValueToVisibility(m_cac
hedValue.get(), m_notVisible).get()); | 44 StyleBuilder::applyProperty(m_id, state, interpolableValueToVisibility(m_cac
hedValue.get(), m_notVisible).get()); |
45 } | 45 } |
46 | 46 |
47 DEFINE_TRACE(VisibilityStyleInterpolation) | 47 DEFINE_TRACE(VisibilityStyleInterpolation) |
48 { | 48 { |
49 StyleInterpolation::trace(visitor); | 49 StyleInterpolation::trace(visitor); |
50 } | 50 } |
51 } | 51 } |
OLD | NEW |