Index: Source/core/rendering/svg/RenderSVGResource.cpp |
diff --git a/Source/core/rendering/svg/RenderSVGResource.cpp b/Source/core/rendering/svg/RenderSVGResource.cpp |
index abbbede9694e7d0c18c726253397d22a67112410..fb7d25932527025f895d0385d5dd5c1acc070db0 100644 |
--- a/Source/core/rendering/svg/RenderSVGResource.cpp |
+++ b/Source/core/rendering/svg/RenderSVGResource.cpp |
@@ -115,19 +115,17 @@ RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceM |
return colorResource; |
} |
- // If no resources are associated with the given renderer, return the color resource. |
- SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object); |
- if (!resources) { |
- if (paintType == SVG_PAINTTYPE_URI_NONE || (!hasColor && !inheritColorFromParentStyle(object, applyToFill, color))) |
- return 0; |
- |
- colorResource->setColor(color); |
- return colorResource; |
- } |
+ RenderSVGResource* uriResource = 0; |
+ if (SVGResources* resources = SVGResourcesCache::cachedResourcesForRenderObject(object)) |
+ uriResource = applyToFill ? resources->fill() : resources->stroke(); |
- // If the requested resource is not available, return the color resource. |
- RenderSVGResource* uriResource = mode == ApplyToFillMode ? resources->fill() : resources->stroke(); |
+ // If the requested resource is not available, return the color resource or 'none'. |
if (!uriResource) { |
+ // The fallback is 'none'. |
+ if (paintType == SVG_PAINTTYPE_URI_NONE) |
+ return 0; |
+ // If there's no fallback color, attempt to use the the parents paint |
+ // server if it's a simple <color>. |
if (!hasColor && !inheritColorFromParentStyle(object, applyToFill, color)) |
return 0; |