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

Unified Diff: Source/core/animation/css/CSSAnimatableValueFactory.cpp

Issue 767593002: Handle interpolation of SVG <paint> 'currentColor' w/ Web/CSS Animations (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 1 month 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 side-by-side diff with in-line comments
Download patch
« no previous file with comments | « LayoutTests/animations/interpolation/svg-stroke-interpolation-expected.txt ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/animation/css/CSSAnimatableValueFactory.cpp
diff --git a/Source/core/animation/css/CSSAnimatableValueFactory.cpp b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
index fd3f8f58a42450e6a5755064afa70f137f754a5b..a88968bfce052d9273560ad7c9e74ca69c0389fd 100644
--- a/Source/core/animation/css/CSSAnimatableValueFactory.cpp
+++ b/Source/core/animation/css/CSSAnimatableValueFactory.cpp
@@ -275,6 +275,13 @@ static PassRefPtrWillBeRawPtr<AnimatableValue> createFromFontWeight(FontWeight f
return createFromDouble(fontWeightToDouble(fontWeight));
}
+static SVGPaintType normalizeSVGPaintType(SVGPaintType paintType)
+{
+ // If the <paint> is 'currentColor', then create an AnimatableSVGPaint with
+ // a <rgbcolor> type. This is similar in vein to the handling of colors.
+ return paintType == SVG_PAINTTYPE_CURRENTCOLOR ? SVG_PAINTTYPE_RGBCOLOR : paintType;
+}
+
// FIXME: Generate this function.
PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPropertyID property, const RenderStyle& style)
{
@@ -340,7 +347,7 @@ PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPro
return createFromDouble(style.fillOpacity());
case CSSPropertyFill:
return AnimatableSVGPaint::create(
- style.svgStyle().fillPaintType(), style.svgStyle().visitedLinkFillPaintType(),
+ normalizeSVGPaintType(style.svgStyle().fillPaintType()), normalizeSVGPaintType(style.svgStyle().visitedLinkFillPaintType()),
style.svgStyle().fillPaintColor(), style.svgStyle().visitedLinkFillPaintColor(),
style.svgStyle().fillPaintUri(), style.svgStyle().visitedLinkFillPaintUri());
case CSSPropertyFlexGrow:
@@ -429,7 +436,7 @@ PassRefPtrWillBeRawPtr<AnimatableValue> CSSAnimatableValueFactory::create(CSSPro
return createFromDouble(style.strokeOpacity());
case CSSPropertyStroke:
return AnimatableSVGPaint::create(
- style.svgStyle().strokePaintType(), style.svgStyle().visitedLinkStrokePaintType(),
+ normalizeSVGPaintType(style.svgStyle().strokePaintType()), normalizeSVGPaintType(style.svgStyle().visitedLinkStrokePaintType()),
style.svgStyle().strokePaintColor(), style.svgStyle().visitedLinkStrokePaintColor(),
style.svgStyle().strokePaintUri(), style.svgStyle().visitedLinkStrokePaintUri());
case CSSPropertyTextDecorationColor:
« no previous file with comments | « LayoutTests/animations/interpolation/svg-stroke-interpolation-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698