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 22 matching lines...) Expand all Loading... |
33 #include "core/rendering/svg/RenderSVGResource.h" | 33 #include "core/rendering/svg/RenderSVGResource.h" |
34 #include "core/rendering/svg/SVGTextQuery.h" | 34 #include "core/rendering/svg/SVGTextQuery.h" |
35 #include "core/svg/SVGElementInstance.h" | 35 #include "core/svg/SVGElementInstance.h" |
36 | 36 |
37 namespace WebCore { | 37 namespace WebCore { |
38 | 38 |
39 // Animated property definitions | 39 // Animated property definitions |
40 | 40 |
41 // SVGTextContentElement's 'textLength' attribute needs special handling. | 41 // SVGTextContentElement's 'textLength' attribute needs special handling. |
42 // It should return getComputedTextLength() when textLength is not specified man
ually. | 42 // It should return getComputedTextLength() when textLength is not specified man
ually. |
43 class SVGAnimatedTextLength : public SVGAnimatedLength { | 43 class SVGAnimatedTextLength FINAL : public SVGAnimatedLength { |
44 public: | 44 public: |
45 static PassRefPtr<SVGAnimatedTextLength> create(SVGTextContentElement* conte
xtElement) | 45 static PassRefPtr<SVGAnimatedTextLength> create(SVGTextContentElement* conte
xtElement) |
46 { | 46 { |
47 return adoptRef(new SVGAnimatedTextLength(contextElement)); | 47 return adoptRef(new SVGAnimatedTextLength(contextElement)); |
48 } | 48 } |
49 | 49 |
50 virtual SVGLengthTearOff* baseVal() | 50 virtual SVGLengthTearOff* baseVal() OVERRIDE |
51 { | 51 { |
52 SVGTextContentElement* textContentElement = toSVGTextContentElement(cont
extElement()); | 52 SVGTextContentElement* textContentElement = toSVGTextContentElement(cont
extElement()); |
53 if (!textContentElement->textLengthIsSpecifiedByUser()) | 53 if (!textContentElement->textLengthIsSpecifiedByUser()) |
54 baseValue()->newValueSpecifiedUnits(LengthTypeNumber, textContentEle
ment->getComputedTextLength()); | 54 baseValue()->newValueSpecifiedUnits(LengthTypeNumber, textContentEle
ment->getComputedTextLength()); |
55 | 55 |
56 return SVGAnimatedLength::baseVal(); | 56 return SVGAnimatedLength::baseVal(); |
57 } | 57 } |
58 | 58 |
59 private: | 59 private: |
60 SVGAnimatedTextLength(SVGTextContentElement* contextElement) | 60 SVGAnimatedTextLength(SVGTextContentElement* contextElement) |
(...skipping 215 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
276 SVGElement* element = toSVGElement(renderer->node()); | 276 SVGElement* element = toSVGElement(renderer->node()); |
277 ASSERT(element); | 277 ASSERT(element); |
278 | 278 |
279 if (!element->isTextContent()) | 279 if (!element->isTextContent()) |
280 return 0; | 280 return 0; |
281 | 281 |
282 return toSVGTextContentElement(element); | 282 return toSVGTextContentElement(element); |
283 } | 283 } |
284 | 284 |
285 } | 285 } |
OLD | NEW |