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

Unified Diff: third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp

Issue 1455153003: Fix animation of 'color' w/ currentColor for SVG 'fill' and 'stroke' (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Draft3 Created 5 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
Index: third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
index dde8e17743f67a8c20026d210dda62fe83e42953..286ae2b279b4ac93210c8e4015c9f9c1a35ef2dc 100644
--- a/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/AnimatedStyleBuilder.cpp
@@ -374,8 +374,20 @@ void AnimatedStyleBuilder::applyProperty(CSSPropertyID property, StyleResolverSt
style->setClip(animatableValueToLengthBox(value, state));
return;
case CSSPropertyColor:
- style->setColor(toAnimatableColor(value)->color());
- style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor());
+ {
+ style->setColor(toAnimatableColor(value)->color());
+ style->setVisitedLinkColor(toAnimatableColor(value)->visitedLinkColor());
+ if (state.element()->isSVGElement()) {
fs 2015/11/20 16:27:14 I think it might be a better idea to just resolve
hyunjunekim2 2015/11/24 08:07:36 fs, Hi, I have a question and want a advice. I tri
+ SVGComputedStyle& svgStyle = style->accessSVGStyle();
+ if (svgStyle.isFillColorCurrentColor()) {
+ svgStyle.setFillPaint(svgStyle.fillPaintType(), toAnimatableColor(value)->color(), svgStyle.fillPaintUri(), true, false);
+ svgStyle.setFillPaint(svgStyle.visitedLinkFillPaintType(), toAnimatableColor(value)->visitedLinkColor(), svgStyle.visitedLinkFillPaintUri(), false, true);
+ } else if (svgStyle.isStrokeColorCurrentColor()) {
+ svgStyle.setStrokePaint(svgStyle.strokePaintType(), toAnimatableColor(value)->color(), svgStyle.strokePaintUri(), true, false);
+ svgStyle.setStrokePaint(svgStyle.visitedLinkStrokePaintType(), toAnimatableColor(value)->visitedLinkColor(), svgStyle.visitedLinkStrokePaintUri(), false, true);
+ }
+ }
+ }
return;
case CSSPropertyFillOpacity:
style->setFillOpacity(clampTo<float>(toAnimatableDouble(value)->toDouble(), 0, 1));

Powered by Google App Engine
This is Rietveld 408576698