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/resolver/StyleResolverState.h" | 9 #include "core/css/resolver/StyleResolverState.h" |
10 #include "core/layout/LayoutTheme.h" | 10 #include "core/layout/LayoutTheme.h" |
(...skipping 191 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
202 { | 202 { |
203 std::unique_ptr<InterpolableList> colorPair = InterpolableList::create(Inter
polableColorPairIndexCount); | 203 std::unique_ptr<InterpolableList> colorPair = InterpolableList::create(Inter
polableColorPairIndexCount); |
204 colorPair->set(Unvisited, createInterpolableColor(unvisitedColor)); | 204 colorPair->set(Unvisited, createInterpolableColor(unvisitedColor)); |
205 colorPair->set(Visited, createInterpolableColor(visitedColor)); | 205 colorPair->set(Visited, createInterpolableColor(visitedColor)); |
206 return InterpolationValue(std::move(colorPair)); | 206 return InterpolationValue(std::move(colorPair)); |
207 } | 207 } |
208 | 208 |
209 InterpolationValue CSSColorInterpolationType::maybeConvertUnderlyingValue(const
InterpolationEnvironment& environment) const | 209 InterpolationValue CSSColorInterpolationType::maybeConvertUnderlyingValue(const
InterpolationEnvironment& environment) const |
210 { | 210 { |
211 return convertStyleColorPair( | 211 return convertStyleColorPair( |
212 ColorPropertyFunctions::getUnvisitedColor(cssProperty(), *environment.st
ate().style()), | 212 ColorPropertyFunctions::getUnvisitedColor(cssProperty(), environment.sty
le()), |
213 ColorPropertyFunctions::getVisitedColor(cssProperty(), *environment.stat
e().style())); | 213 ColorPropertyFunctions::getVisitedColor(cssProperty(), environment.style
())); |
214 } | 214 } |
215 | 215 |
216 void CSSColorInterpolationType::apply(const InterpolableValue& interpolableValue
, const NonInterpolableValue*, InterpolationEnvironment& environment) const | 216 void CSSColorInterpolationType::apply(const InterpolableValue& interpolableValue
, const NonInterpolableValue*, InterpolationEnvironment& environment) const |
217 { | 217 { |
218 const InterpolableList& colorPair = toInterpolableList(interpolableValue); | 218 const InterpolableList& colorPair = toInterpolableList(interpolableValue); |
219 ASSERT(colorPair.length() == InterpolableColorPairIndexCount); | 219 ASSERT(colorPair.length() == InterpolableColorPairIndexCount); |
220 ColorPropertyFunctions::setUnvisitedColor(cssProperty(), *environment.state(
).style(), | 220 ColorPropertyFunctions::setUnvisitedColor(cssProperty(), environment.style()
, |
221 resolveInterpolableColor(*colorPair.get(Unvisited), environment.state(),
false, cssProperty() == CSSPropertyTextDecorationColor)); | 221 resolveInterpolableColor(*colorPair.get(Unvisited), environment.state(),
false, cssProperty() == CSSPropertyTextDecorationColor)); |
222 ColorPropertyFunctions::setVisitedColor(cssProperty(), *environment.state().
style(), | 222 ColorPropertyFunctions::setVisitedColor(cssProperty(), environment.style(), |
223 resolveInterpolableColor(*colorPair.get(Visited), environment.state(), t
rue, cssProperty() == CSSPropertyTextDecorationColor)); | 223 resolveInterpolableColor(*colorPair.get(Visited), environment.state(), t
rue, cssProperty() == CSSPropertyTextDecorationColor)); |
224 } | 224 } |
225 | 225 |
226 } // namespace blink | 226 } // namespace blink |
OLD | NEW |