SVGFontFaceFormatElement.cpp [plain text]
#include "config.h"
#if ENABLE(SVG_FONTS)
#include "SVGFontFaceFormatElement.h"
#include "SVGFontFaceElement.h"
#include "SVGNames.h"
namespace WebCore {
using namespace SVGNames;
inline SVGFontFaceFormatElement::SVGFontFaceFormatElement(const QualifiedName& tagName, Document& document)
: SVGElement(tagName, document)
{
ASSERT(hasTagName(font_face_formatTag));
}
PassRefPtr<SVGFontFaceFormatElement> SVGFontFaceFormatElement::create(const QualifiedName& tagName, Document& document)
{
return adoptRef(new SVGFontFaceFormatElement(tagName, document));
}
void SVGFontFaceFormatElement::childrenChanged(const ChildChange& change)
{
SVGElement::childrenChanged(change);
if (!parentNode() || !parentNode()->hasTagName(font_face_uriTag))
return;
ContainerNode* ancestor = parentNode()->parentNode();
if (!ancestor || !ancestor->hasTagName(font_face_srcTag))
return;
ancestor = ancestor->parentNode();
if (ancestor && ancestor->hasTagName(font_faceTag))
toSVGFontFaceElement(ancestor)->rebuildFontFace();
}
}
#endif // ENABLE(SVG_FONTS)