OLD | NEW |
1 // Copyright 2016 The Chromium Authors. All rights reserved. | 1 // Copyright 2016 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 #include "core/animation/CSSInterpolationType.h" | 5 #include "core/animation/CSSInterpolationType.h" |
6 | 6 |
7 #include "core/StylePropertyShorthand.h" | 7 #include "core/StylePropertyShorthand.h" |
8 #include "core/animation/StringKeyframe.h" | 8 #include "core/animation/StringKeyframe.h" |
9 #include "core/css/CSSVariableReferenceValue.h" | 9 #include "core/css/CSSVariableReferenceValue.h" |
10 #include "core/css/resolver/CSSVariableResolver.h" | 10 #include "core/css/resolver/CSSVariableResolver.h" |
(...skipping 17 matching lines...) Expand all Loading... |
28 private: | 28 private: |
29 ResolvedVariableChecker(CSSPropertyID property, | 29 ResolvedVariableChecker(CSSPropertyID property, |
30 const CSSValue* variableReference, | 30 const CSSValue* variableReference, |
31 const CSSValue* resolvedValue) | 31 const CSSValue* resolvedValue) |
32 : m_property(property), | 32 : m_property(property), |
33 m_variableReference(variableReference), | 33 m_variableReference(variableReference), |
34 m_resolvedValue(resolvedValue) {} | 34 m_resolvedValue(resolvedValue) {} |
35 | 35 |
36 bool isValid(const InterpolationEnvironment& environment, | 36 bool isValid(const InterpolationEnvironment& environment, |
37 const InterpolationValue& underlying) const final { | 37 const InterpolationValue& underlying) const final { |
38 // TODO(alancutter): Just check the variables referenced instead of doing a
full CSSValue resolve. | 38 // TODO(alancutter): Just check the variables referenced instead of doing a |
| 39 // full CSSValue resolve. |
39 const CSSValue* resolvedValue = | 40 const CSSValue* resolvedValue = |
40 CSSVariableResolver::resolveVariableReferences( | 41 CSSVariableResolver::resolveVariableReferences( |
41 environment.state(), m_property, *m_variableReference); | 42 environment.state(), m_property, *m_variableReference); |
42 return m_resolvedValue->equals(*resolvedValue); | 43 return m_resolvedValue->equals(*resolvedValue); |
43 } | 44 } |
44 | 45 |
45 CSSPropertyID m_property; | 46 CSSPropertyID m_property; |
46 Persistent<const CSSValue> m_variableReference; | 47 Persistent<const CSSValue> m_variableReference; |
47 Persistent<const CSSValue> m_resolvedValue; | 48 Persistent<const CSSValue> m_resolvedValue; |
48 }; | 49 }; |
(...skipping 30 matching lines...) Expand all Loading... |
79 | 80 |
80 if (value->isInheritedValue() || | 81 if (value->isInheritedValue() || |
81 (value->isUnsetValue() && | 82 (value->isUnsetValue() && |
82 CSSPropertyMetadata::isInheritedProperty(cssProperty()))) | 83 CSSPropertyMetadata::isInheritedProperty(cssProperty()))) |
83 return maybeConvertInherit(environment.state(), conversionCheckers); | 84 return maybeConvertInherit(environment.state(), conversionCheckers); |
84 | 85 |
85 return maybeConvertValue(*value, environment.state(), conversionCheckers); | 86 return maybeConvertValue(*value, environment.state(), conversionCheckers); |
86 } | 87 } |
87 | 88 |
88 } // namespace blink | 89 } // namespace blink |
OLD | NEW |