OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2007, 2008 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Rob Buis <buis@kde.org> |
4 * | 4 * |
5 * This library is free software; you can redistribute it and/or | 5 * This library is free software; you can redistribute it and/or |
6 * modify it under the terms of the GNU Library General Public | 6 * modify it under the terms of the GNU Library General Public |
7 * License as published by the Free Software Foundation; either | 7 * License as published by the Free Software Foundation; either |
8 * version 2 of the License, or (at your option) any later version. | 8 * version 2 of the License, or (at your option) any later version. |
9 * | 9 * |
10 * This library is distributed in the hope that it will be useful, | 10 * This library is distributed in the hope that it will be useful, |
(...skipping 50 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
61 { | 61 { |
62 SVGTextContentElement* textContentElement = toSVGTextContentElement(cont
extElement()); | 62 SVGTextContentElement* textContentElement = toSVGTextContentElement(cont
extElement()); |
63 if (!textContentElement->textLengthIsSpecifiedByUser()) | 63 if (!textContentElement->textLengthIsSpecifiedByUser()) |
64 baseValue()->newValueSpecifiedUnits(LengthTypeNumber, textContentEle
ment->getComputedTextLength()); | 64 baseValue()->newValueSpecifiedUnits(LengthTypeNumber, textContentEle
ment->getComputedTextLength()); |
65 | 65 |
66 return SVGAnimatedLength::baseVal(); | 66 return SVGAnimatedLength::baseVal(); |
67 } | 67 } |
68 | 68 |
69 private: | 69 private: |
70 SVGAnimatedTextLength(SVGTextContentElement* contextElement) | 70 SVGAnimatedTextLength(SVGTextContentElement* contextElement) |
71 : SVGAnimatedLength(contextElement, SVGNames::textLengthAttr, SVGLength:
:create(LengthModeOther)) | 71 : SVGAnimatedLength(contextElement, SVGNames::textLengthAttr, SVGLength:
:create(LengthModeOther), ForbidNegativeLengths) |
72 { | 72 { |
73 } | 73 } |
74 }; | 74 }; |
75 | 75 |
76 | 76 |
77 SVGTextContentElement::SVGTextContentElement(const QualifiedName& tagName, Docum
ent& document) | 77 SVGTextContentElement::SVGTextContentElement(const QualifiedName& tagName, Docum
ent& document) |
78 : SVGGraphicsElement(tagName, document) | 78 : SVGGraphicsElement(tagName, document) |
79 , m_textLength(SVGAnimatedTextLength::create(this)) | 79 , m_textLength(SVGAnimatedTextLength::create(this)) |
80 , m_textLengthIsSpecifiedByUser(false) | 80 , m_textLengthIsSpecifiedByUser(false) |
81 , m_lengthAdjust(SVGAnimatedEnumeration<SVGLengthAdjustType>::create(this, S
VGNames::lengthAdjustAttr, SVGLengthAdjustSpacing)) | 81 , m_lengthAdjust(SVGAnimatedEnumeration<SVGLengthAdjustType>::create(this, S
VGNames::lengthAdjustAttr, SVGLengthAdjustSpacing)) |
(...skipping 149 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
231 | 231 |
232 void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom
icString& value) | 232 void SVGTextContentElement::parseAttribute(const QualifiedName& name, const Atom
icString& value) |
233 { | 233 { |
234 SVGParsingError parseError = NoError; | 234 SVGParsingError parseError = NoError; |
235 | 235 |
236 if (!isSupportedAttribute(name)) | 236 if (!isSupportedAttribute(name)) |
237 SVGGraphicsElement::parseAttribute(name, value); | 237 SVGGraphicsElement::parseAttribute(name, value); |
238 else if (name == SVGNames::lengthAdjustAttr) { | 238 else if (name == SVGNames::lengthAdjustAttr) { |
239 m_lengthAdjust->setBaseValueAsString(value, parseError); | 239 m_lengthAdjust->setBaseValueAsString(value, parseError); |
240 } else if (name == SVGNames::textLengthAttr) { | 240 } else if (name == SVGNames::textLengthAttr) { |
241 m_textLength->setBaseValueAsString(value, ForbidNegativeLengths, parseEr
ror); | 241 m_textLength->setBaseValueAsString(value, parseError); |
242 } else if (name.matches(XMLNames::spaceAttr)) { | 242 } else if (name.matches(XMLNames::spaceAttr)) { |
243 } else | 243 } else |
244 ASSERT_NOT_REACHED(); | 244 ASSERT_NOT_REACHED(); |
245 | 245 |
246 reportAttributeParsingError(parseError, name, value); | 246 reportAttributeParsingError(parseError, name, value); |
247 } | 247 } |
248 | 248 |
249 void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) | 249 void SVGTextContentElement::svgAttributeChanged(const QualifiedName& attrName) |
250 { | 250 { |
251 if (!isSupportedAttribute(attrName)) { | 251 if (!isSupportedAttribute(attrName)) { |
(...skipping 25 matching lines...) Expand all Loading... |
277 | 277 |
278 if (!renderer->isSVGText() && !renderer->isSVGInline()) | 278 if (!renderer->isSVGText() && !renderer->isSVGInline()) |
279 return 0; | 279 return 0; |
280 | 280 |
281 SVGElement* element = toSVGElement(renderer->node()); | 281 SVGElement* element = toSVGElement(renderer->node()); |
282 ASSERT(element); | 282 ASSERT(element); |
283 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element)
: 0; | 283 return isSVGTextContentElement(*element) ? toSVGTextContentElement(element)
: 0; |
284 } | 284 } |
285 | 285 |
286 } | 286 } |
OLD | NEW |