This source file includes following definitions.
- create
- insertedInto
- removedFrom
- childrenChanged
#include "config.h"
#include "core/svg/SVGTitleElement.h"
#include "SVGNames.h"
#include "core/dom/Document.h"
namespace WebCore {
inline SVGTitleElement::SVGTitleElement(Document& document)
: SVGElement(SVGNames::titleTag, document)
{
ScriptWrappable::init(this);
}
PassRefPtr<SVGTitleElement> SVGTitleElement::create(Document& document)
{
return adoptRef(new SVGTitleElement(document));
}
Node::InsertionNotificationRequest SVGTitleElement::insertedInto(ContainerNode* rootParent)
{
SVGElement::insertedInto(rootParent);
if (!rootParent->inDocument())
return InsertionDone;
if (firstChild())
document().setTitleElement(textContent(), this);
return InsertionDone;
}
void SVGTitleElement::removedFrom(ContainerNode* rootParent)
{
SVGElement::removedFrom(rootParent);
if (rootParent->inDocument())
document().removeTitle(this);
}
void SVGTitleElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
{
SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
if (inDocument())
document().setTitleElement(textContent(), this);
}
}