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

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

Issue 593173002: Change SVG paint server fallback for a non-existent URL (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Adjust tests. Created 6 years, 3 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
« no previous file with comments | « LayoutTests/svg/hixie/error/003-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/rendering/svg/RenderSVGResource.cpp
diff --git a/Source/core/rendering/svg/RenderSVGResource.cpp b/Source/core/rendering/svg/RenderSVGResource.cpp
index fb7d25932527025f895d0385d5dd5c1acc070db0..8c79eceabcc4560860947244970facf39c6dd3b1 100644
--- a/Source/core/rendering/svg/RenderSVGResource.cpp
+++ b/Source/core/rendering/svg/RenderSVGResource.cpp
@@ -35,18 +35,6 @@
namespace blink {
-static inline bool inheritColorFromParentStyle(RenderObject* object, bool applyToFill, Color& color)
-{
- if (!object->parent() || !object->parent()->style())
- return false;
- const SVGRenderStyle& parentSVGStyle = object->parent()->style()->svgStyle();
- SVGPaintType paintType = applyToFill ? parentSVGStyle.fillPaintType() : parentSVGStyle.strokePaintType();
- if (paintType != SVG_PAINTTYPE_RGBCOLOR)
- return false;
- color = applyToFill ? parentSVGStyle.fillPaintColor() : parentSVGStyle.strokePaintColor();
- return true;
-}
-
RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceMode mode, RenderObject* object, const RenderStyle* style, bool& hasFallback)
{
ASSERT(object);
@@ -121,12 +109,8 @@ RenderSVGResource* RenderSVGResource::requestPaintingResource(RenderSVGResourceM
// 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))
+ // The fallback is 'none'. (SVG2 say 'none' is implied when no fallback is specified.)
+ if (paintType == SVG_PAINTTYPE_URI_NONE || !hasColor)
return 0;
colorResource->setColor(color);
« no previous file with comments | « LayoutTests/svg/hixie/error/003-expected.txt ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698