SVGTitleElement.cpp [plain text]
#include "config.h"
#if ENABLE(SVG)
#include "SVGTitleElement.h"
#include "SVGNames.h"
#include "Document.h"
namespace WebCore {
inline SVGTitleElement::SVGTitleElement(const QualifiedName& tagName, Document* document)
: SVGStyledElement(tagName, document)
{
ASSERT(hasTagName(SVGNames::titleTag));
}
PassRefPtr<SVGTitleElement> SVGTitleElement::create(const QualifiedName& tagName, Document* document)
{
return adoptRef(new SVGTitleElement(tagName, document));
}
void SVGTitleElement::insertedIntoDocument()
{
SVGStyledElement::insertedIntoDocument();
if (firstChild())
document()->setTitleElement(StringWithDirection(textContent(), LTR), this);
}
void SVGTitleElement::removedFromDocument()
{
SVGElement::removedFromDocument();
document()->removeTitle(this);
}
void SVGTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
if (inDocument())
document()->setTitleElement(StringWithDirection(textContent(), LTR), this);
}
AttributeToPropertyTypeMap& SVGTitleElement::attributeToPropertyTypeMap()
{
DEFINE_STATIC_LOCAL(AttributeToPropertyTypeMap, s_attributeToPropertyTypeMap, ());
return s_attributeToPropertyTypeMap;
}
void SVGTitleElement::fillAttributeToPropertyTypeMap()
{
SVGStyledElement::fillPassedAttributeToPropertyTypeMap(attributeToPropertyTypeMap());
}
}
#endif // ENABLE(SVG)