Upstream version 11.39.266.0
[platform/framework/web/crosswalk.git] / src / third_party / WebKit / Source / core / svg / SVGAltGlyphDefElement.cpp
index 5142195..ecef1c8 100644 (file)
 #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
 {
@@ -88,8 +85,8 @@ bool SVGAltGlyphDefElement::hasValidGlyphElements(Vector<AtomicString>& glyphNam
     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;
 
@@ -103,7 +100,7 @@ bool SVGAltGlyphDefElement::hasValidGlyphElements(Vector<AtomicString>& glyphNam
                 glyphNames.clear();
                 return false;
             }
-        } else if (!fountFirstGlyphRef && child->hasTagName(SVGNames::altGlyphItemTag)) {
+        } else if (!fountFirstGlyphRef && isSVGAltGlyphItemElement(*child)) {
             foundFirstAltGlyphItem = true;
             Vector<AtomicString> referredGlyphNames;