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

Unified Diff: Source/core/svg/SVGFELightElement.cpp

Issue 192133002: Use isSVG*Element() helpers more in SVG code (Part 1) (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/svg/SVGFELightElement.h ('k') | Source/core/svg/SVGFESpecularLightingElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFELightElement.cpp
diff --git a/Source/core/svg/SVGFELightElement.cpp b/Source/core/svg/SVGFELightElement.cpp
index f7305c36c38ad9c00df969faccb540641bf8469f..e986cb30aa3b56891a6cc301d217518b4f5e2297 100644
--- a/Source/core/svg/SVGFELightElement.cpp
+++ b/Source/core/svg/SVGFELightElement.cpp
@@ -57,16 +57,12 @@ SVGFELightElement::SVGFELightElement(const QualifiedName& tagName, Document& doc
addToPropertyMap(m_limitingConeAngle);
}
-SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement* svgElement)
+SVGFELightElement* SVGFELightElement::findLightElement(const SVGElement& svgElement)
{
- for (Node* node = svgElement->firstChild(); node; node = node->nextSibling()) {
- if (isSVGFELightElement(*node))
- return toSVGFELightElement(node);
- }
- return 0;
+ return Traversal<SVGFELightElement>::firstChild(svgElement);
}
-PassRefPtr<LightSource> SVGFELightElement::findLightSource(const SVGElement* svgElement)
+PassRefPtr<LightSource> SVGFELightElement::findLightSource(const SVGElement& svgElement)
{
SVGFELightElement* lightNode = findLightElement(svgElement);
if (!lightNode)
@@ -154,11 +150,12 @@ void SVGFELightElement::svgAttributeChanged(const QualifiedName& attrName)
if (!renderer || !renderer->isSVGResourceFilterPrimitive())
return;
- if (parent->hasTagName(SVGNames::feDiffuseLightingTag)) {
- toSVGFEDiffuseLightingElement(parent)->lightElementAttributeChanged(this, attrName);
+ if (isSVGFEDiffuseLightingElement(*parent)) {
+ toSVGFEDiffuseLightingElement(*parent).lightElementAttributeChanged(this, attrName);
return;
- } else if (parent->hasTagName(SVGNames::feSpecularLightingTag)) {
- toSVGFESpecularLightingElement(parent)->lightElementAttributeChanged(this, attrName);
+ }
+ if (isSVGFESpecularLightingElement(*parent)) {
+ toSVGFESpecularLightingElement(*parent).lightElementAttributeChanged(this, attrName);
return;
}
}
« no previous file with comments | « Source/core/svg/SVGFELightElement.h ('k') | Source/core/svg/SVGFESpecularLightingElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698