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 #include "core/animation/CSSColorInterpolationType.h" | 5 #include "core/animation/CSSColorInterpolationType.h" |
6 | 6 |
7 #include <memory> | 7 #include <memory> |
8 #include "core/animation/ColorPropertyFunctions.h" | 8 #include "core/animation/ColorPropertyFunctions.h" |
9 #include "core/css/CSSColorValue.h" | 9 #include "core/css/CSSColorValue.h" |
10 #include "core/css/CSSIdentifierValue.h" | 10 #include "core/css/CSSIdentifierValue.h" |
(...skipping 152 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
163 const OptionalStyleColor& color) { | 163 const OptionalStyleColor& color) { |
164 return WTF::wrapUnique(new InheritedColorChecker(property, color)); | 164 return WTF::wrapUnique(new InheritedColorChecker(property, color)); |
165 } | 165 } |
166 | 166 |
167 private: | 167 private: |
168 InheritedColorChecker(CSSPropertyID property, const OptionalStyleColor& color) | 168 InheritedColorChecker(CSSPropertyID property, const OptionalStyleColor& color) |
169 : m_property(property), m_color(color) {} | 169 : m_property(property), m_color(color) {} |
170 | 170 |
171 bool isValid(const InterpolationEnvironment& environment, | 171 bool isValid(const InterpolationEnvironment& environment, |
172 const InterpolationValue& underlying) const final { | 172 const InterpolationValue& underlying) const final { |
173 return m_color == ColorPropertyFunctions::getUnvisitedColor( | 173 return m_color == |
174 m_property, *environment.state().parentStyle()); | 174 ColorPropertyFunctions::getUnvisitedColor( |
| 175 m_property, *environment.state().parentStyle()); |
175 } | 176 } |
176 | 177 |
177 const CSSPropertyID m_property; | 178 const CSSPropertyID m_property; |
178 const OptionalStyleColor m_color; | 179 const OptionalStyleColor m_color; |
179 }; | 180 }; |
180 | 181 |
181 InterpolationValue CSSColorInterpolationType::maybeConvertNeutral( | 182 InterpolationValue CSSColorInterpolationType::maybeConvertNeutral( |
182 const InterpolationValue&, | 183 const InterpolationValue&, |
183 ConversionCheckers&) const { | 184 ConversionCheckers&) const { |
184 return convertStyleColorPair(StyleColor(Color::transparent), | 185 return convertStyleColorPair(StyleColor(Color::transparent), |
(...skipping 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
278 const CSSValue* CSSColorInterpolationType::createCSSValue( | 279 const CSSValue* CSSColorInterpolationType::createCSSValue( |
279 const InterpolableValue& interpolableValue, | 280 const InterpolableValue& interpolableValue, |
280 const NonInterpolableValue*, | 281 const NonInterpolableValue*, |
281 const StyleResolverState& state) const { | 282 const StyleResolverState& state) const { |
282 const InterpolableList& colorPair = toInterpolableList(interpolableValue); | 283 const InterpolableList& colorPair = toInterpolableList(interpolableValue); |
283 Color color = resolveInterpolableColor(*colorPair.get(Unvisited), state); | 284 Color color = resolveInterpolableColor(*colorPair.get(Unvisited), state); |
284 return CSSColorValue::create(color.rgb()); | 285 return CSSColorValue::create(color.rgb()); |
285 } | 286 } |
286 | 287 |
287 } // namespace blink | 288 } // namespace blink |
OLD | NEW |