24 #include "wtf/Platform.h"
31 #include "RenderSVGText.h"
33 #include "SVGRenderStyle.h"
39 SVGTextElement::SVGTextElement(
const QualifiedName& tagName, Document* doc)
40 : SVGTextPositioningElement(tagName, doc)
46 SVGTextElement::~SVGTextElement()
50 ANIMATED_PROPERTY_DEFINITIONS(SVGTextElement, SVGTransformList*, TransformList, transformList, Transform, transform,
SVGNames::transformAttr, m_transform.get())
52 void SVGTextElement::parseMappedAttribute(MappedAttribute* attr)
55 SVGTransformList* localTransforms = transformBaseValue();
58 localTransforms->clear(ec);
60 if (!SVGTransformable::parseTransformAttribute(localTransforms, attr->value()))
61 localTransforms->clear(ec);
63 setTransformBaseValue(localTransforms);
65 renderer()->setNeedsLayout(
true);
68 SVGTextPositioningElement::parseMappedAttribute(attr);
71 SVGElement* SVGTextElement::nearestViewportElement()
const
73 return SVGTransformable::nearestViewportElement(
this);
76 SVGElement* SVGTextElement::farthestViewportElement()
const
78 return SVGTransformable::farthestViewportElement(
this);
81 FloatRect SVGTextElement::getBBox()
const
83 return SVGTransformable::getBBox(
this);
86 AffineTransform SVGTextElement::getScreenCTM()
const
88 return SVGTransformable::getScreenCTM(
this);
91 AffineTransform SVGTextElement::getCTM()
const
93 return SVGTransformable::getCTM(
this);
96 AffineTransform SVGTextElement::animatedLocalTransform()
const
98 return m_supplementalTransform ? transform()->concatenate().matrix() * *m_supplementalTransform : transform()->concatenate().matrix();
101 AffineTransform* SVGTextElement::supplementalTransform()
103 if (!m_supplementalTransform)
104 m_supplementalTransform.set(
new AffineTransform());
105 return m_supplementalTransform.get();
108 RenderObject* SVGTextElement::createRenderer(RenderArena* arena, RenderStyle* style)
111 kDebug() <<
"create renderer for <text>" << endl;
112 return new (arena) RenderSVGText(
this);
115 bool SVGTextElement::childShouldCreateRenderer(Node* child)
const
117 if (child->isTextNode()
118 #if ENABLE(SVG_FONTS)
126 void SVGTextElement::svgAttributeChanged(
const QualifiedName& attrName)
128 SVGTextPositioningElement::svgAttributeChanged(attrName);
133 if (SVGTextPositioningElement::isKnownAttribute(attrName))
134 renderer()->setNeedsLayout(
true);
139 #endif // ENABLE(SVG)
DOM::QualifiedName textPathTag
DOM::QualifiedName trefTag
DOM::QualifiedName transformAttr
static QDebug kDebug(bool cond, int area=KDE_DEFAULT_DEBUG_AREA)
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
DOM::QualifiedName tspanTag
DOM::QualifiedName altGlyphTag