25#include "wtf/Platform.h"
40#include "RenderSVGTransformableContainer.h"
41#include "RenderSVGInline.h"
51SVGAElement::SVGAElement(
const QualifiedName& tagName, Document *doc)
52 : SVGStyledTransformableElement(tagName, doc)
56 , SVGExternalResourcesRequired()
60SVGAElement::~SVGAElement()
64String SVGAElement::title()
const
66 return getAttribute(XLinkNames::titleAttr);
69ANIMATED_PROPERTY_DEFINITIONS(SVGAElement, String, String,
string, Target, target, SVGNames::targetAttr, m_target)
71void SVGAElement::parseMappedAttribute(MappedAttribute* attr)
73 if (attr->name() == SVGNames::targetAttr)
74 setTargetBaseValue(attr->value());
76 if (SVGURIReference::parseMappedAttribute(attr))
78 if (SVGTests::parseMappedAttribute(attr))
80 if (SVGLangSpace::parseMappedAttribute(attr))
82 if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
84 SVGStyledTransformableElement::parseMappedAttribute(attr);
88void SVGAElement::svgAttributeChanged(
const QualifiedName& attrName)
90 SVGStyledTransformableElement::svgAttributeChanged(attrName);
94 if (SVGURIReference::isKnownAttribute(attrName)) {
103RenderObject* SVGAElement::createRenderer(RenderArena* arena, RenderStyle* style)
106 if (
static_cast<SVGElement*
>(parent())->isTextContent())
107 return new (arena) RenderSVGInline(
this);
109 return new (arena) RenderSVGTransformableContainer(
this);
112void SVGAElement::defaultEventHandler(Event* evt)
165 SVGStyledTransformableElement::defaultEventHandler(evt);
168bool SVGAElement::supportsFocus()
const
172 return isFocusable() || (document() && !document()->haveStylesheetsLoaded());
175bool SVGAElement::isFocusableImpl(FocusType ft)
const
180 if (isContentEditable())
181 return SVGStyledTransformableElement::isFocusableImpl(ft);
187bool SVGAElement::childShouldCreateRenderer(Node* child)
const
191 if (child->hasTagName(SVGNames::aTag))
193 if (parent() && parent()->isSVGElement())
194 return static_cast<SVGElement*
>(parent())->childShouldCreateRenderer(child);
196 return SVGElement::childShouldCreateRenderer(child);