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

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

Issue 191003007: Use isSVG*Element() helpers more in SVG code (Part 3) (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: Created 6 years, 9 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 | « Source/core/rendering/svg/SVGRenderTreeAsText.cpp ('k') | Source/core/rendering/svg/SVGRootInlineBox.cpp » ('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 2ffeee1c35fb9610b518c9697d7f12ada807f7bd..f59ad854bb75e8a014276dfaed8e044e4a491694 100644
--- a/Source/core/rendering/svg/SVGResources.cpp
+++ b/Source/core/rendering/svg/SVGResources.cpp
@@ -137,19 +137,19 @@ static HashSet<AtomicString>& chainableResourceTags()
return s_tagList;
}
-static inline AtomicString targetReferenceFromResource(SVGElement* element)
+static inline AtomicString targetReferenceFromResource(SVGElement& element)
{
String target;
- if (element->hasTagName(SVGNames::patternTag))
- target = toSVGPatternElement(element)->href()->currentValue()->value();
- else if (element->hasTagName(SVGNames::linearGradientTag) || element->hasTagName(SVGNames::radialGradientTag))
- target = toSVGGradientElement(element)->href()->currentValue()->value();
- else if (element->hasTagName(SVGNames::filterTag))
- target = toSVGFilterElement(element)->href()->currentValue()->value();
+ if (isSVGPatternElement(element))
+ target = toSVGPatternElement(element).href()->currentValue()->value();
+ else if (isSVGGradientElement(element))
+ target = toSVGGradientElement(element).href()->currentValue()->value();
+ else if (isSVGFilterElement(element))
+ target = toSVGFilterElement(element).href()->currentValue()->value();
else
ASSERT_NOT_REACHED();
- return SVGURIReference::fragmentIdentifierFromIRIString(target, element->document());
+ return SVGURIReference::fragmentIdentifierFromIRIString(target, element.document());
}
static inline bool svgPaintTypeHasURL(SVGPaint::SVGPaintType paintType)
@@ -285,7 +285,7 @@ PassOwnPtr<SVGResources> SVGResources::buildResources(const RenderObject* object
}
if (chainableResourceTags().contains(tagName)) {
- AtomicString id = targetReferenceFromResource(element);
+ AtomicString id = targetReferenceFromResource(*element);
if (!ensureResources(resources)->setLinkedResource(getRenderSVGResourceContainerById(document, id)))
registerPendingResource(extensions, id, element);
}
« no previous file with comments | « Source/core/rendering/svg/SVGRenderTreeAsText.cpp ('k') | Source/core/rendering/svg/SVGRootInlineBox.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698