OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2007 Nikolas Zimmermann <zimmermann@kde.org> |
3 * Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com> | 3 * Copyright (C) 2010 Rob Buis <rwlbuis@gmail.com> |
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 30 matching lines...) Expand all Loading... |
41 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
SpacingType>() | 41 template<> const SVGEnumerationStringEntries& getStaticStringEntries<SVGTextPath
SpacingType>() |
42 { | 42 { |
43 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); | 43 DEFINE_STATIC_LOCAL(SVGEnumerationStringEntries, entries, ()); |
44 if (entries.isEmpty()) { | 44 if (entries.isEmpty()) { |
45 entries.append(std::make_pair(SVGTextPathSpacingAuto, "auto")); | 45 entries.append(std::make_pair(SVGTextPathSpacingAuto, "auto")); |
46 entries.append(std::make_pair(SVGTextPathSpacingExact, "exact")); | 46 entries.append(std::make_pair(SVGTextPathSpacingExact, "exact")); |
47 } | 47 } |
48 return entries; | 48 return entries; |
49 } | 49 } |
50 | 50 |
51 SVGTextPathElement::SVGTextPathElement(Document& document) | 51 inline SVGTextPathElement::SVGTextPathElement(Document& document) |
52 : SVGTextContentElement(SVGNames::textPathTag, document) | 52 : SVGTextContentElement(SVGNames::textPathTag, document) |
53 , SVGURIReference(this) | 53 , SVGURIReference(this) |
54 , m_startOffset(SVGAnimatedLength::create(this, SVGNames::startOffsetAttr, S
VGLength::create(LengthModeOther), AllowNegativeLengths)) | 54 , m_startOffset(SVGAnimatedLength::create(this, SVGNames::startOffsetAttr, S
VGLength::create(LengthModeOther), AllowNegativeLengths)) |
55 , m_method(SVGAnimatedEnumeration<SVGTextPathMethodType>::create(this, SVGNa
mes::methodAttr, SVGTextPathMethodAlign)) | 55 , m_method(SVGAnimatedEnumeration<SVGTextPathMethodType>::create(this, SVGNa
mes::methodAttr, SVGTextPathMethodAlign)) |
56 , m_spacing(SVGAnimatedEnumeration<SVGTextPathSpacingType>::create(this, SVG
Names::spacingAttr, SVGTextPathSpacingExact)) | 56 , m_spacing(SVGAnimatedEnumeration<SVGTextPathSpacingType>::create(this, SVG
Names::spacingAttr, SVGTextPathSpacingExact)) |
57 { | 57 { |
58 ScriptWrappable::init(this); | 58 ScriptWrappable::init(this); |
59 | 59 |
60 addToPropertyMap(m_startOffset); | 60 addToPropertyMap(m_startOffset); |
61 addToPropertyMap(m_method); | 61 addToPropertyMap(m_method); |
62 addToPropertyMap(m_spacing); | 62 addToPropertyMap(m_spacing); |
63 } | 63 } |
64 | 64 |
| 65 DEFINE_NODE_FACTORY(SVGTextPathElement) |
| 66 |
65 SVGTextPathElement::~SVGTextPathElement() | 67 SVGTextPathElement::~SVGTextPathElement() |
66 { | 68 { |
67 #if !ENABLE(OILPAN) | 69 #if !ENABLE(OILPAN) |
68 clearResourceReferences(); | 70 clearResourceReferences(); |
69 #endif | 71 #endif |
70 } | 72 } |
71 | 73 |
72 void SVGTextPathElement::clearResourceReferences() | 74 void SVGTextPathElement::clearResourceReferences() |
73 { | 75 { |
74 document().accessSVGExtensions().removeAllTargetReferencesForElement(this); | 76 document().accessSVGExtensions().removeAllTargetReferencesForElement(this); |
(...skipping 102 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
177 clearResourceReferences(); | 179 clearResourceReferences(); |
178 } | 180 } |
179 | 181 |
180 bool SVGTextPathElement::selfHasRelativeLengths() const | 182 bool SVGTextPathElement::selfHasRelativeLengths() const |
181 { | 183 { |
182 return m_startOffset->currentValue()->isRelative() | 184 return m_startOffset->currentValue()->isRelative() |
183 || SVGTextContentElement::selfHasRelativeLengths(); | 185 || SVGTextContentElement::selfHasRelativeLengths(); |
184 } | 186 } |
185 | 187 |
186 } | 188 } |
OLD | NEW |