| 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 "core/animation/ColorPropertyFunctions.h" | 7 #include "core/animation/ColorPropertyFunctions.h" |
| 8 #include "core/css/CSSColorValue.h" | 8 #include "core/css/CSSColorValue.h" |
| 9 #include "core/css/CSSIdentifierValue.h" | 9 #include "core/css/CSSIdentifierValue.h" |
| 10 #include "core/css/resolver/StyleResolverState.h" | 10 #include "core/css/resolver/StyleResolverState.h" |
| (...skipping 166 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 177 InterpolationValue CSSColorInterpolationType::maybeConvertNeutral( | 177 InterpolationValue CSSColorInterpolationType::maybeConvertNeutral( |
| 178 const InterpolationValue&, | 178 const InterpolationValue&, |
| 179 ConversionCheckers&) const { | 179 ConversionCheckers&) const { |
| 180 return convertStyleColorPair(StyleColor(Color::transparent), | 180 return convertStyleColorPair(StyleColor(Color::transparent), |
| 181 StyleColor(Color::transparent)); | 181 StyleColor(Color::transparent)); |
| 182 } | 182 } |
| 183 | 183 |
| 184 InterpolationValue CSSColorInterpolationType::maybeConvertInitial( | 184 InterpolationValue CSSColorInterpolationType::maybeConvertInitial( |
| 185 const StyleResolverState&, | 185 const StyleResolverState&, |
| 186 ConversionCheckers& conversionCheckers) const { | 186 ConversionCheckers& conversionCheckers) const { |
| 187 const StyleColor initialColor = | 187 StyleColor initialColor; |
| 188 ColorPropertyFunctions::getInitialColor(cssProperty()); | 188 if (ColorPropertyFunctions::getInitialColor(cssProperty(), initialColor)) |
| 189 return convertStyleColorPair(initialColor, initialColor); | 189 return convertStyleColorPair(initialColor, initialColor); |
| 190 return nullptr; |
| 190 } | 191 } |
| 191 | 192 |
| 192 InterpolationValue CSSColorInterpolationType::maybeConvertInherit( | 193 InterpolationValue CSSColorInterpolationType::maybeConvertInherit( |
| 193 const StyleResolverState& state, | 194 const StyleResolverState& state, |
| 194 ConversionCheckers& conversionCheckers) const { | 195 ConversionCheckers& conversionCheckers) const { |
| 195 if (!state.parentStyle()) | 196 if (!state.parentStyle()) |
| 196 return nullptr; | 197 return nullptr; |
| 197 // Visited color can never explicitly inherit from parent visited color so | 198 // Visited color can never explicitly inherit from parent visited color so |
| 198 // only use the unvisited color. | 199 // only use the unvisited color. |
| 199 const StyleColor inheritedColor = ColorPropertyFunctions::getUnvisitedColor( | 200 const StyleColor inheritedColor = ColorPropertyFunctions::getUnvisitedColor( |
| (...skipping 59 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 259 *colorPair.get(Unvisited), environment.state(), false, | 260 *colorPair.get(Unvisited), environment.state(), false, |
| 260 cssProperty() == CSSPropertyTextDecorationColor)); | 261 cssProperty() == CSSPropertyTextDecorationColor)); |
| 261 ColorPropertyFunctions::setVisitedColor( | 262 ColorPropertyFunctions::setVisitedColor( |
| 262 cssProperty(), *environment.state().style(), | 263 cssProperty(), *environment.state().style(), |
| 263 resolveInterpolableColor( | 264 resolveInterpolableColor( |
| 264 *colorPair.get(Visited), environment.state(), true, | 265 *colorPair.get(Visited), environment.state(), true, |
| 265 cssProperty() == CSSPropertyTextDecorationColor)); | 266 cssProperty() == CSSPropertyTextDecorationColor)); |
| 266 } | 267 } |
| 267 | 268 |
| 268 } // namespace blink | 269 } // namespace blink |
| OLD | NEW |