#if ENABLE(SVG_FONTS)
#include "core/svg/SVGAltGlyphDefElement.h"
-#include "SVGNames.h"
+#include "core/SVGNames.h"
+#include "core/dom/ElementTraversal.h"
#include "core/svg/SVGAltGlyphItemElement.h"
#include "core/svg/SVGGlyphRefElement.h"
-namespace WebCore {
+namespace blink {
inline SVGAltGlyphDefElement::SVGAltGlyphDefElement(Document& document)
: SVGElement(SVGNames::altGlyphDefTag, document)
{
- ScriptWrappable::init(this);
}
-PassRefPtr<SVGAltGlyphDefElement> SVGAltGlyphDefElement::create(Document& document)
-{
- return adoptRef(new SVGAltGlyphDefElement(document));
-}
+DEFINE_NODE_FACTORY(SVGAltGlyphDefElement)
bool SVGAltGlyphDefElement::hasValidGlyphElements(Vector<AtomicString>& glyphNames) const
{
bool fountFirstGlyphRef = false;
bool foundFirstAltGlyphItem = false;
- for (Node* child = firstChild(); child; child = child->nextSibling()) {
- if (!foundFirstAltGlyphItem && child->hasTagName(SVGNames::glyphRefTag)) {
+ for (SVGElement* child = Traversal<SVGElement>::firstChild(*this); child; child = Traversal<SVGElement>::nextSibling(*child)) {
+ if (!foundFirstAltGlyphItem && isSVGGlyphRefElement(*child)) {
fountFirstGlyphRef = true;
AtomicString referredGlyphName;
glyphNames.clear();
return false;
}
- } else if (!fountFirstGlyphRef && child->hasTagName(SVGNames::altGlyphItemTag)) {
+ } else if (!fountFirstGlyphRef && isSVGAltGlyphItemElement(*child)) {
foundFirstAltGlyphItem = true;
Vector<AtomicString> referredGlyphNames;