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

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

Issue 108303009: Handle "url(...) none" and "url(...) currentColor" SVG paint specs (Closed) Base URL: https://chromium.googlesource.com/chromium/blink.git@master
Patch Set: Added TC for 'none' fallback w/ failing url(...). Created 7 years 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 | « Source/core/css/SVGCSSParser.cpp ('k') | Source/core/svg/SVGPaint.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/rendering/svg/SVGResources.cpp
diff --git a/Source/core/rendering/svg/SVGResources.cpp b/Source/core/rendering/svg/SVGResources.cpp
index 5c42dbcef6942262297a756d6570de19a7b0411b..b9c6f5903d326caebafe9a0c28e0e0cd7079ed65 100644
--- a/Source/core/rendering/svg/SVGResources.cpp
+++ b/Source/core/rendering/svg/SVGResources.cpp
@@ -152,9 +152,24 @@ static inline String targetReferenceFromResource(SVGElement* element)
return SVGURIReference::fragmentIdentifierFromIRIString(target, element->document());
}
+static inline bool svgPaintTypeHasURL(SVGPaint::SVGPaintType paintType)
+{
+ switch (paintType) {
+ case SVGPaint::SVG_PAINTTYPE_URI_NONE:
+ case SVGPaint::SVG_PAINTTYPE_URI_CURRENTCOLOR:
+ case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR:
+ case SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR_ICCCOLOR:
+ case SVGPaint::SVG_PAINTTYPE_URI:
+ return true;
+ default:
+ break;
+ }
+ return false;
+}
+
static inline RenderSVGResourceContainer* paintingResourceFromSVGPaint(Document& document, const SVGPaint::SVGPaintType& paintType, const String& paintUri, AtomicString& id, bool& hasPendingResource)
{
- if (paintType != SVGPaint::SVG_PAINTTYPE_URI && paintType != SVGPaint::SVG_PAINTTYPE_URI_RGBCOLOR)
+ if (!svgPaintTypeHasURL(paintType))
return 0;
id = SVGURIReference::fragmentIdentifierFromIRIString(paintUri, document);
« no previous file with comments | « Source/core/css/SVGCSSParser.cpp ('k') | Source/core/svg/SVGPaint.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698