KHTML
SVGFontFaceFormatElement.cpp
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020 #include "config.h"
00021
00022 #if ENABLE(SVG_FONTS)
00023 #include "SVGFontFaceFormatElement.h"
00024
00025 #include "SVGFontFaceElement.h"
00026 #include "SVGNames.h"
00027
00028 namespace WebCore {
00029
00030 using namespace SVGNames;
00031
00032 SVGFontFaceFormatElement::SVGFontFaceFormatElement(const QualifiedName& tagName, Document* doc)
00033 : SVGElement(tagName, doc)
00034 {
00035 }
00036
00037 void SVGFontFaceFormatElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
00038 {
00039 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
00040
00041 if (!parentNode() || !parentNode()->hasTagName(font_face_uriTag))
00042 return;
00043
00044 Node* ancestor = parentNode()->parentNode();
00045 if (!ancestor || !ancestor->hasTagName(font_face_srcTag))
00046 return;
00047
00048 ancestor = ancestor->parentNode();
00049 if (ancestor && ancestor->hasTagName(font_faceTag))
00050 static_cast<SVGFontFaceElement*>(ancestor)->rebuildFontFace();
00051 }
00052
00053 }
00054
00055 #endif // ENABLE(SVG_FONTS)