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

Unified Diff: Source/WebCore/rendering/svg/RenderSVGResource.cpp

Issue 7002001: Revert 79985 - 2011-03-01 Nikolas Zimmermann <nzimmermann@rim.com> (Closed) Base URL: http://svn.webkit.org/repository/webkit/branches/chromium/742/
Patch Set: Created 9 years, 7 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 side-by-side diff with in-line comments
Download patch
Index: Source/WebCore/rendering/svg/RenderSVGResource.cpp
===================================================================
--- Source/WebCore/rendering/svg/RenderSVGResource.cpp (revision 86165)
+++ Source/WebCore/rendering/svg/RenderSVGResource.cpp (working copy)
@@ -51,36 +51,33 @@
return 0;
}
- bool applyToFill = mode == ApplyToFillMode;
- SVGPaint::SVGPaintType paintType = applyToFill ? svgStyle->fillPaintType() : svgStyle->strokePaintType();
+ SVGPaint* paint = mode == ApplyToFillMode ? svgStyle->fillPaint() : svgStyle->strokePaint();
+ ASSERT(paint);
+
+ SVGPaint::SVGPaintType paintType = paint->paintType();
if (paintType == SVGPaint::SVG_PAINTTYPE_NONE)
return 0;
Color color;
- switch (paintType) {
- case SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR:
- case SVGPaint::SVG_PAINTTYPE_RGBCOLOR:
- case SVGPaint::SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR:
- case SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR:
- case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR:
- case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR:
- color = applyToFill ? svgStyle->fillPaintColor() : svgStyle->strokePaintColor();
- default:
- break;
- }
+ if (paintType == SVGPaint::SVG_PAINTTYPE_RGBCOLOR
+ || paintType == SVGPaint::SVG_PAINTTYPE_RGBCOLOR_ICCCOLOR
+ || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR
+ || paintType == SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR)
+ color = paint->color();
+ else if (paintType == SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR || paintType == SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR)
+ color = style->visitedDependentColor(CSSPropertyColor);
if (style->insideLink() == InsideVisitedLink) {
RenderStyle* visitedStyle = style->getCachedPseudoStyle(VISITED_LINK);
ASSERT(visitedStyle);
- const SVGRenderStyle* svgVisitedStyle = visitedStyle->svgStyle();
- SVGPaint::SVGPaintType visitedPaintType = applyToFill ? svgVisitedStyle->fillPaintType() : svgVisitedStyle->strokePaintType();
-
- // For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'.
- if (visitedPaintType < SVGPaint::SVG_PAINTTYPE_URI_NONE && visitedPaintType != SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR) {
- const Color& visitedColor = applyToFill ? svgVisitedStyle->fillPaintColor() : svgVisitedStyle->strokePaintColor();
- if (visitedColor.isValid())
- color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
+ if (SVGPaint* visitedPaint = mode == ApplyToFillMode ? visitedStyle->svgStyle()->fillPaint() : visitedStyle->svgStyle()->strokePaint()) {
+ // For SVG_PAINTTYPE_CURRENTCOLOR, 'color' already contains the 'visitedColor'.
+ if (visitedPaint->paintType() < SVGPaint::SVG_PAINTTYPE_URI_NONE && visitedPaint->paintType() != SVGPaint::SVG_PAINTTYPE_CURRENTCOLOR) {
+ const Color& visitedColor = visitedPaint->color();
+ if (visitedColor.isValid())
+ color = Color(visitedColor.red(), visitedColor.green(), visitedColor.blue(), color.alpha());
+ }
}
}
« no previous file with comments | « Source/WebCore/rendering/style/SVGRenderStyleDefs.cpp ('k') | Source/WebCore/rendering/svg/RenderSVGResourceClipper.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698