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 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
47 entries.append(std::make_pair(SVGTextPathSpacingUnknown, emptyString()))
; | 47 entries.append(std::make_pair(SVGTextPathSpacingUnknown, emptyString()))
; |
48 entries.append(std::make_pair(SVGTextPathSpacingAuto, "auto")); | 48 entries.append(std::make_pair(SVGTextPathSpacingAuto, "auto")); |
49 entries.append(std::make_pair(SVGTextPathSpacingExact, "exact")); | 49 entries.append(std::make_pair(SVGTextPathSpacingExact, "exact")); |
50 } | 50 } |
51 return entries; | 51 return entries; |
52 } | 52 } |
53 | 53 |
54 inline SVGTextPathElement::SVGTextPathElement(Document& document) | 54 inline SVGTextPathElement::SVGTextPathElement(Document& document) |
55 : SVGTextContentElement(SVGNames::textPathTag, document) | 55 : SVGTextContentElement(SVGNames::textPathTag, document) |
56 , SVGURIReference(this) | 56 , SVGURIReference(this) |
57 , m_startOffset(SVGAnimatedLength::create(this, SVGNames::startOffsetAttr, S
VGLength::create(LengthModeOther))) | 57 , m_startOffset(SVGAnimatedLength::create(this, SVGNames::startOffsetAttr, S
VGLength::create(LengthModeOther), AllowNegativeLengths)) |
58 , m_method(SVGAnimatedEnumeration<SVGTextPathMethodType>::create(this, SVGNa
mes::methodAttr, SVGTextPathMethodAlign)) | 58 , m_method(SVGAnimatedEnumeration<SVGTextPathMethodType>::create(this, SVGNa
mes::methodAttr, SVGTextPathMethodAlign)) |
59 , m_spacing(SVGAnimatedEnumeration<SVGTextPathSpacingType>::create(this, SVG
Names::spacingAttr, SVGTextPathSpacingExact)) | 59 , m_spacing(SVGAnimatedEnumeration<SVGTextPathSpacingType>::create(this, SVG
Names::spacingAttr, SVGTextPathSpacingExact)) |
60 { | 60 { |
61 ScriptWrappable::init(this); | 61 ScriptWrappable::init(this); |
62 | 62 |
63 addToPropertyMap(m_startOffset); | 63 addToPropertyMap(m_startOffset); |
64 addToPropertyMap(m_method); | 64 addToPropertyMap(m_method); |
65 addToPropertyMap(m_spacing); | 65 addToPropertyMap(m_spacing); |
66 } | 66 } |
67 | 67 |
(...skipping 24 matching lines...) Expand all Loading... |
92 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 92 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
93 } | 93 } |
94 | 94 |
95 void SVGTextPathElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) | 95 void SVGTextPathElement::parseAttribute(const QualifiedName& name, const AtomicS
tring& value) |
96 { | 96 { |
97 SVGParsingError parseError = NoError; | 97 SVGParsingError parseError = NoError; |
98 | 98 |
99 if (!isSupportedAttribute(name)) | 99 if (!isSupportedAttribute(name)) |
100 SVGTextContentElement::parseAttribute(name, value); | 100 SVGTextContentElement::parseAttribute(name, value); |
101 else if (name == SVGNames::startOffsetAttr) | 101 else if (name == SVGNames::startOffsetAttr) |
102 m_startOffset->setBaseValueAsString(value, AllowNegativeLengths, parseEr
ror); | 102 m_startOffset->setBaseValueAsString(value, parseError); |
103 else if (name == SVGNames::methodAttr) | 103 else if (name == SVGNames::methodAttr) |
104 m_method->setBaseValueAsString(value, parseError); | 104 m_method->setBaseValueAsString(value, parseError); |
105 else if (name == SVGNames::spacingAttr) | 105 else if (name == SVGNames::spacingAttr) |
106 m_spacing->setBaseValueAsString(value, parseError); | 106 m_spacing->setBaseValueAsString(value, parseError); |
107 else if (SVGURIReference::parseAttribute(name, value, parseError)) { | 107 else if (SVGURIReference::parseAttribute(name, value, parseError)) { |
108 } else | 108 } else |
109 ASSERT_NOT_REACHED(); | 109 ASSERT_NOT_REACHED(); |
110 | 110 |
111 reportAttributeParsingError(parseError, name, value); | 111 reportAttributeParsingError(parseError, name, value); |
112 } | 112 } |
(...skipping 70 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
183 clearResourceReferences(); | 183 clearResourceReferences(); |
184 } | 184 } |
185 | 185 |
186 bool SVGTextPathElement::selfHasRelativeLengths() const | 186 bool SVGTextPathElement::selfHasRelativeLengths() const |
187 { | 187 { |
188 return m_startOffset->currentValue()->isRelative() | 188 return m_startOffset->currentValue()->isRelative() |
189 || SVGTextContentElement::selfHasRelativeLengths(); | 189 || SVGTextContentElement::selfHasRelativeLengths(); |
190 } | 190 } |
191 | 191 |
192 } | 192 } |
OLD | NEW |