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

Unified Diff: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.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: 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
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
diff --git a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
index de1b88ab94adc02521bf8571a43feb6f6f5f4aaf..c341b31cbe84bbbac916c4ea38c93299e300977d 100644
--- a/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
+++ b/third_party/WebKit/Source/core/css/resolver/StyleBuilderCustom.cpp
@@ -168,10 +168,28 @@ void StyleBuilderFunctions::applyValueCSSPropertyColor(StyleResolverState& state
return;
}
- if (state.applyPropertyToRegularStyle())
- state.style()->setColor(StyleBuilderConverter::convertColor(state, *value));
- if (state.applyPropertyToVisitedLinkStyle())
- state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(state, *value, true));
+ bool isFillCurrentColor = state.style()->svgStyle().isFillColorCurrentColor();
+ bool isStrokeCurrentColor = state.style()->svgStyle().isStrokeColorCurrentColor();
+
+ if (state.applyPropertyToRegularStyle()) {
+ if (!isFillCurrentColor && !isStrokeCurrentColor)
+ state.style()->setColor(StyleBuilderConverter::convertColor(state, *value));
+
+ if (isFillCurrentColor)
+ state.style()->setColor(state.style()->svgStyle().fillPaintColor());
fs 2015/11/27 08:50:25 You shouldn't be overriding the value of 'color' l
+ if (isStrokeCurrentColor)
+ state.style()->setColor(state.style()->svgStyle().strokePaintColor());
+ }
+
+ if (state.applyPropertyToVisitedLinkStyle()) {
+ if (!isFillCurrentColor && !isStrokeCurrentColor)
+ state.style()->setVisitedLinkColor(StyleBuilderConverter::convertColor(state, *value, true));
+
+ if (isFillCurrentColor)
+ state.style()->setColor(state.style()->svgStyle().visitedLinkFillPaintColor());
+ if (isStrokeCurrentColor)
+ state.style()->setColor(state.style()->svgStyle().visitedLinkStrokePaintColor());
+ }
}
void StyleBuilderFunctions::applyInitialCSSPropertyCursor(StyleResolverState& state)
« no previous file with comments | « no previous file | third_party/WebKit/Source/core/layout/LayoutObject.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698