24#include "wtf/Platform.h"
31#include "RenderSVGText.h"
33#include "SVGRenderStyle.h"
39SVGTextElement::SVGTextElement(
const QualifiedName& tagName, Document* doc)
40 : SVGTextPositioningElement(tagName, doc)
46SVGTextElement::~SVGTextElement()
50ANIMATED_PROPERTY_DEFINITIONS(SVGTextElement, SVGTransformList*, TransformList, transformList, Transform, transform, SVGNames::transformAttr, m_transform.get())
52void SVGTextElement::parseMappedAttribute(MappedAttribute* attr)
54 if (attr->name() == SVGNames::transformAttr) {
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);
71SVGElement* SVGTextElement::nearestViewportElement()
const
73 return SVGTransformable::nearestViewportElement(
this);
76SVGElement* SVGTextElement::farthestViewportElement()
const
78 return SVGTransformable::farthestViewportElement(
this);
81FloatRect SVGTextElement::getBBox()
const
83 return SVGTransformable::getBBox(
this);
86AffineTransform SVGTextElement::getScreenCTM()
const
88 return SVGTransformable::getScreenCTM(
this);
91AffineTransform SVGTextElement::getCTM()
const
93 return SVGTransformable::getCTM(
this);
96AffineTransform SVGTextElement::animatedLocalTransform()
const
98 return m_supplementalTransform ? transform()->concatenate().matrix() * *m_supplementalTransform : transform()->concatenate().matrix();
101AffineTransform* SVGTextElement::supplementalTransform()
103 if (!m_supplementalTransform)
104 m_supplementalTransform.set(
new AffineTransform());
105 return m_supplementalTransform.get();
108RenderObject* SVGTextElement::createRenderer(RenderArena* arena, RenderStyle* style)
111 kDebug() <<
"create renderer for <text>" << endl;
112 return new (arena) RenderSVGText(
this);
115bool SVGTextElement::childShouldCreateRenderer(Node* child)
const
117 if (child->isTextNode()
119 || child->hasTagName(SVGNames::altGlyphTag)
121 || child->hasTagName(SVGNames::tspanTag) || child->hasTagName(SVGNames::trefTag) || child->hasTagName(SVGNames::aTag) || child->hasTagName(SVGNames::textPathTag))
126void SVGTextElement::svgAttributeChanged(
const QualifiedName& attrName)
128 SVGTextPositioningElement::svgAttributeChanged(attrName);
133 if (SVGTextPositioningElement::isKnownAttribute(attrName))
134 renderer()->setNeedsLayout(
true);
KAction * create(StandardAction id, const QObject *recvr, const char *slot, QObject *parent)
DOM::QualifiedName transformAttr
unsigned short ExceptionCode