Generate more SVG type checks and conversions.
[WebKit-https.git] / Source / WebCore / svg / SVGPatternElement.cpp
index aa4a4cf..61bc084 100644 (file)
@@ -229,9 +229,9 @@ void SVGPatternElement::collectPatternAttributes(PatternAttributes& attributes)
         processedPatterns.add(current);
 
         // Respect xlink:href, take attributes from referenced element
-        Node* refNode = SVGURIReference::targetElementFromIRIString(current->href(), &document());
-        if (refNode && refNode->hasTagName(SVGNames::patternTag)) {
-            current = static_cast<const SVGPatternElement*>(const_cast<const Node*>(refNode));
+        Element* refElement = SVGURIReference::targetElementFromIRIString(current->href(), &document());
+        if (refElement && isSVGPatternElement(refElement)) {
+            current = toSVGPatternElement(refElement);
 
             // Cycle detection
             if (processedPatterns.contains(current)) {