Index: Source/core/svg/SVGAltGlyphItemElement.cpp |
diff --git a/Source/core/svg/SVGAltGlyphItemElement.cpp b/Source/core/svg/SVGAltGlyphItemElement.cpp |
index abe9e8d6785b3800f4f1e245bdfe484535c46e49..94c5fafcfbe705665a9920e9a7b3411d9c22795d 100644 |
--- a/Source/core/svg/SVGAltGlyphItemElement.cpp |
+++ b/Source/core/svg/SVGAltGlyphItemElement.cpp |
@@ -22,6 +22,7 @@ |
#if ENABLE(SVG_FONTS) |
#include "core/svg/SVGAltGlyphItemElement.h" |
+#include "core/dom/ElementTraversal.h" |
#include "core/svg/SVGGlyphRefElement.h" |
namespace WebCore { |
@@ -47,15 +48,13 @@ bool SVGAltGlyphItemElement::hasValidGlyphElements(Vector<AtomicString>& glyphNa |
// |
// Here we fill glyphNames and return true only if all referenced glyphs are valid and |
// there is at least one glyph. |
- for (Node* child = firstChild(); child; child = child->nextSibling()) { |
- if (child->hasTagName(SVGNames::glyphRefTag)) { |
- AtomicString referredGlyphName; |
- if (toSVGGlyphRefElement(child)->hasValidGlyphElement(referredGlyphName)) |
- glyphNames.append(referredGlyphName); |
- else { |
- glyphNames.clear(); |
- return false; |
- } |
+ for (SVGGlyphRefElement* glyph = Traversal<SVGGlyphRefElement>::firstChild(*this); glyph; glyph = Traversal<SVGGlyphRefElement>::nextSibling(*glyph)) { |
+ AtomicString referredGlyphName; |
+ if (glyph->hasValidGlyphElement(referredGlyphName)) { |
+ glyphNames.append(referredGlyphName); |
+ } else { |
+ glyphNames.clear(); |
+ return false; |
} |
} |
return !glyphNames.isEmpty(); |