KHTML
SVGFontFaceSrcElement.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 "SVGFontFaceSrcElement.h"
00024
00025 #include "CSSValueList.h"
00026 #include "CSSFontFaceSrcValue.h"
00027 #include "SVGFontFaceElement.h"
00028 #include "SVGFontFaceNameElement.h"
00029 #include "SVGFontFaceUriElement.h"
00030 #include "SVGNames.h"
00031
00032 namespace WebCore {
00033
00034 using namespace SVGNames;
00035
00036 SVGFontFaceSrcElement::SVGFontFaceSrcElement(const QualifiedName& tagName, Document* doc)
00037 : SVGElement(tagName, doc)
00038 {
00039 }
00040
00041 PassRefPtr<CSSValueList> SVGFontFaceSrcElement::srcValue() const
00042 {
00043 RefPtr<CSSValueList> list = new CSSValueList;
00044 for (Node* child = firstChild(); child; child = child->nextSibling()) {
00045 if (child->hasTagName(font_face_uriTag))
00046 list->append(static_cast<SVGFontFaceUriElement*>(child)->srcValue());
00047 else if (child->hasTagName(font_face_nameTag))
00048 list->append(static_cast<SVGFontFaceNameElement*>(child)->srcValue());
00049 }
00050 return list;
00051 }
00052
00053 void SVGFontFaceSrcElement::childrenChanged(bool changedByParser, Node* beforeChange, Node* afterChange, int childCountDelta)
00054 {
00055 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, childCountDelta);
00056 if (parentNode() && parentNode()->hasTagName(font_faceTag))
00057 static_cast<SVGFontFaceElement*>(parentNode())->rebuildFontFace();
00058 }
00059
00060 }
00061
00062 #endif // ENABLE(SVG_FONTS)