KHTML
SVGPolyElement.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
00021
00022
00023 #include "config.h"
00024 #include "wtf/Platform.h"
00025
00026 #if ENABLE(SVG)
00027 #include "SVGPolyElement.h"
00028
00029 #include "Document.h"
00030 #include "FloatPoint.h"
00031 #include "RenderPath.h"
00032 #include "SVGNames.h"
00033 #include "SVGParserUtilities.h"
00034 #include "SVGPointList.h"
00035
00036 namespace WebCore {
00037
00038 SVGPolyElement::SVGPolyElement(const QualifiedName& tagName, Document* doc)
00039 : SVGStyledTransformableElement(tagName, doc)
00040 , SVGTests()
00041 , SVGLangSpace()
00042 , SVGExternalResourcesRequired()
00043 , SVGAnimatedPoints()
00044 , m_ignoreAttributeChanges(false)
00045 {
00046 }
00047
00048 SVGPolyElement::~SVGPolyElement()
00049 {
00050 }
00051
00052 SVGPointList* SVGPolyElement::points() const
00053 {
00054 if (!m_points)
00055 m_points = SVGPointList::create(SVGNames::pointsAttr);
00056
00057 return m_points.get();
00058 }
00059
00060 SVGPointList* SVGPolyElement::animatedPoints() const
00061 {
00062
00063 return 0;
00064 }
00065
00066 void SVGPolyElement::parseMappedAttribute(MappedAttribute* attr)
00067 {
00068 const AtomicString& value = attr->value();
00069 if (attr->name() == SVGNames::pointsAttr) {
00070 ExceptionCode ec = 0;
00071 points()->clear(ec);
00072
00073 if (!pointsListFromSVGData(points(), value)) {
00074 points()->clear(ec);
00075
00076 }
00077 } else {
00078 if (SVGTests::parseMappedAttribute(attr))
00079 return;
00080 if (SVGLangSpace::parseMappedAttribute(attr))
00081 return;
00082 if (SVGExternalResourcesRequired::parseMappedAttribute(attr))
00083 return;
00084 SVGStyledTransformableElement::parseMappedAttribute(attr);
00085 }
00086 }
00087
00088 void SVGPolyElement::svgAttributeChanged(const QualifiedName& attrName)
00089 {
00090 if (m_ignoreAttributeChanges)
00091 return;
00092
00093 SVGStyledTransformableElement::svgAttributeChanged(attrName);
00094
00095 if (!renderer())
00096 return;
00097
00098 if (attrName == SVGNames::pointsAttr) {
00099 m_ignoreAttributeChanges = true;
00100 renderer()->setNeedsLayout(true);
00101
00102 ExceptionCode ec = 0;
00103
00104
00105
00106
00107 kDebug() << "fixme!!!!!!!!!" << endl;
00108
00109
00110
00111
00112
00113
00114
00115
00116
00117
00118
00119
00120 m_ignoreAttributeChanges = false;
00121 return;
00122 }
00123
00124 if (SVGTests::isKnownAttribute(attrName) ||
00125 SVGLangSpace::isKnownAttribute(attrName) ||
00126 SVGExternalResourcesRequired::isKnownAttribute(attrName) ||
00127 SVGStyledTransformableElement::isKnownAttribute(attrName))
00128 renderer()->setNeedsLayout(true);
00129 }
00130
00131 }
00132
00133 #endif // ENABLE(SVG)