Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(517)

Side by Side Diff: third_party/WebKit/Source/core/animation/CSSColorInterpolationType.cpp

Issue 2564793002: Add smooth interpolation support for <color> custom properties (Closed)
Patch Set: Rebase Created 3 years, 10 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View unified diff | Download patch
OLDNEW
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 247 matching lines...) Expand 10 before | Expand all | Expand 10 after
258 resolveInterpolableColor( 258 resolveInterpolableColor(
259 *colorPair.get(Unvisited), state, false, 259 *colorPair.get(Unvisited), state, false,
260 cssProperty() == CSSPropertyTextDecorationColor)); 260 cssProperty() == CSSPropertyTextDecorationColor));
261 ColorPropertyFunctions::setVisitedColor( 261 ColorPropertyFunctions::setVisitedColor(
262 cssProperty(), *state.style(), 262 cssProperty(), *state.style(),
263 resolveInterpolableColor( 263 resolveInterpolableColor(
264 *colorPair.get(Visited), state, true, 264 *colorPair.get(Visited), state, true,
265 cssProperty() == CSSPropertyTextDecorationColor)); 265 cssProperty() == CSSPropertyTextDecorationColor));
266 } 266 }
267 267
268 const CSSValue* CSSColorInterpolationType::createCSSValue(
269 const InterpolableValue& interpolableValue,
270 const NonInterpolableValue*,
271 const StyleResolverState& state) const {
272 const InterpolableList& colorPair = toInterpolableList(interpolableValue);
273 Color color = resolveInterpolableColor(*colorPair.get(Unvisited), state);
274 return CSSColorValue::create(color.rgb());
275 }
276
268 } // namespace blink 277 } // namespace blink
OLDNEW

Powered by Google App Engine
This is Rietveld 408576698