OLD | NEW |
1 /* | 1 /* |
2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> | 2 * Copyright (C) 2004, 2005, 2006, 2007, 2008 Nikolas Zimmermann <zimmermann@kde
.org> |
3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> | 3 * Copyright (C) 2004, 2005, 2006, 2007 Rob Buis <buis@kde.org> |
4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. | 4 * Copyright (C) Research In Motion Limited 2009-2010. All rights reserved. |
5 * | 5 * |
6 * This library is free software; you can redistribute it and/or | 6 * This library is free software; you can redistribute it and/or |
7 * modify it under the terms of the GNU Library General Public | 7 * modify it under the terms of the GNU Library General Public |
8 * License as published by the Free Software Foundation; either | 8 * License as published by the Free Software Foundation; either |
9 * version 2 of the License, or (at your option) any later version. | 9 * version 2 of the License, or (at your option) any later version. |
10 * | 10 * |
(...skipping 49 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
60 REGISTER_LOCAL_ANIMATED_PROPERTY(refX) | 60 REGISTER_LOCAL_ANIMATED_PROPERTY(refX) |
61 REGISTER_LOCAL_ANIMATED_PROPERTY(refY) | 61 REGISTER_LOCAL_ANIMATED_PROPERTY(refY) |
62 REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth) | 62 REGISTER_LOCAL_ANIMATED_PROPERTY(markerWidth) |
63 REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight) | 63 REGISTER_LOCAL_ANIMATED_PROPERTY(markerHeight) |
64 REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits) | 64 REGISTER_LOCAL_ANIMATED_PROPERTY(markerUnits) |
65 REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle) | 65 REGISTER_LOCAL_ANIMATED_PROPERTY(orientAngle) |
66 REGISTER_LOCAL_ANIMATED_PROPERTY(orientType) | 66 REGISTER_LOCAL_ANIMATED_PROPERTY(orientType) |
67 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 67 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
68 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) | 68 REGISTER_LOCAL_ANIMATED_PROPERTY(viewBox) |
69 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) | 69 REGISTER_LOCAL_ANIMATED_PROPERTY(preserveAspectRatio) |
70 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGStyledElement) | 70 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement) |
71 END_REGISTER_ANIMATED_PROPERTIES | 71 END_REGISTER_ANIMATED_PROPERTIES |
72 | 72 |
73 inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document
* document) | 73 inline SVGMarkerElement::SVGMarkerElement(const QualifiedName& tagName, Document
* document) |
74 : SVGStyledElement(tagName, document) | 74 : SVGElement(tagName, document) |
75 , m_refX(LengthModeWidth) | 75 , m_refX(LengthModeWidth) |
76 , m_refY(LengthModeHeight) | 76 , m_refY(LengthModeHeight) |
77 , m_markerWidth(LengthModeWidth, "3") | 77 , m_markerWidth(LengthModeWidth, "3") |
78 , m_markerHeight(LengthModeHeight, "3") | 78 , m_markerHeight(LengthModeHeight, "3") |
79 , m_markerUnits(SVGMarkerUnitsStrokeWidth) | 79 , m_markerUnits(SVGMarkerUnitsStrokeWidth) |
80 , m_orientType(SVGMarkerOrientAngle) | 80 , m_orientType(SVGMarkerOrientAngle) |
81 { | 81 { |
82 // Spec: If the markerWidth/markerHeight attribute is not specified, the eff
ect is as if a value of "3" were specified. | 82 // Spec: If the markerWidth/markerHeight attribute is not specified, the eff
ect is as if a value of "3" were specified. |
83 ASSERT(hasTagName(SVGNames::markerTag)); | 83 ASSERT(hasTagName(SVGNames::markerTag)); |
84 ScriptWrappable::init(this); | 84 ScriptWrappable::init(this); |
(...skipping 36 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
121 supportedAttributes.add(SVGNames::orientAttr); | 121 supportedAttributes.add(SVGNames::orientAttr); |
122 } | 122 } |
123 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 123 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
124 } | 124 } |
125 | 125 |
126 void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 126 void SVGMarkerElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
127 { | 127 { |
128 SVGParsingError parseError = NoError; | 128 SVGParsingError parseError = NoError; |
129 | 129 |
130 if (!isSupportedAttribute(name)) | 130 if (!isSupportedAttribute(name)) |
131 SVGStyledElement::parseAttribute(name, value); | 131 SVGElement::parseAttribute(name, value); |
132 else if (name == SVGNames::markerUnitsAttr) { | 132 else if (name == SVGNames::markerUnitsAttr) { |
133 SVGMarkerUnitsType propertyValue = SVGPropertyTraits<SVGMarkerUnitsType>
::fromString(value); | 133 SVGMarkerUnitsType propertyValue = SVGPropertyTraits<SVGMarkerUnitsType>
::fromString(value); |
134 if (propertyValue > 0) | 134 if (propertyValue > 0) |
135 setMarkerUnitsBaseValue(propertyValue); | 135 setMarkerUnitsBaseValue(propertyValue); |
136 } else if (name == SVGNames::refXAttr) | 136 } else if (name == SVGNames::refXAttr) |
137 setRefXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError
)); | 137 setRefXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError
)); |
138 else if (name == SVGNames::refYAttr) | 138 else if (name == SVGNames::refYAttr) |
139 setRefYBaseValue(SVGLength::construct(LengthModeHeight, value, parseErro
r)); | 139 setRefYBaseValue(SVGLength::construct(LengthModeHeight, value, parseErro
r)); |
140 else if (name == SVGNames::markerWidthAttr) | 140 else if (name == SVGNames::markerWidthAttr) |
141 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); | 141 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); |
(...skipping 10 matching lines...) Expand all Loading... |
152 || SVGFitToViewBox::parseAttribute(this, name, value)) { | 152 || SVGFitToViewBox::parseAttribute(this, name, value)) { |
153 } else | 153 } else |
154 ASSERT_NOT_REACHED(); | 154 ASSERT_NOT_REACHED(); |
155 | 155 |
156 reportAttributeParsingError(parseError, name, value); | 156 reportAttributeParsingError(parseError, name, value); |
157 } | 157 } |
158 | 158 |
159 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) | 159 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) |
160 { | 160 { |
161 if (!isSupportedAttribute(attrName)) { | 161 if (!isSupportedAttribute(attrName)) { |
162 SVGStyledElement::svgAttributeChanged(attrName); | 162 SVGElement::svgAttributeChanged(attrName); |
163 return; | 163 return; |
164 } | 164 } |
165 | 165 |
166 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 166 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
167 | 167 |
168 if (attrName == SVGNames::refXAttr | 168 if (attrName == SVGNames::refXAttr |
169 || attrName == SVGNames::refYAttr | 169 || attrName == SVGNames::refYAttr |
170 || attrName == SVGNames::markerWidthAttr | 170 || attrName == SVGNames::markerWidthAttr |
171 || attrName == SVGNames::markerHeightAttr) | 171 || attrName == SVGNames::markerHeightAttr) |
172 updateRelativeLengthsInformation(); | 172 updateRelativeLengthsInformation(); |
173 | 173 |
174 if (RenderObject* object = renderer()) | 174 if (RenderObject* object = renderer()) |
175 object->setNeedsLayout(true); | 175 object->setNeedsLayout(true); |
176 } | 176 } |
177 | 177 |
178 void SVGMarkerElement::childrenChanged(bool changedByParser, Node* beforeChange,
Node* afterChange, int childCountDelta) | 178 void SVGMarkerElement::childrenChanged(bool changedByParser, Node* beforeChange,
Node* afterChange, int childCountDelta) |
179 { | 179 { |
180 SVGStyledElement::childrenChanged(changedByParser, beforeChange, afterChange
, childCountDelta); | 180 SVGElement::childrenChanged(changedByParser, beforeChange, afterChange, chil
dCountDelta); |
181 | 181 |
182 if (changedByParser) | 182 if (changedByParser) |
183 return; | 183 return; |
184 | 184 |
185 if (RenderObject* object = renderer()) | 185 if (RenderObject* object = renderer()) |
186 object->setNeedsLayout(true); | 186 object->setNeedsLayout(true); |
187 } | 187 } |
188 | 188 |
189 void SVGMarkerElement::setOrientToAuto() | 189 void SVGMarkerElement::setOrientToAuto() |
190 { | 190 { |
(...skipping 55 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
246 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); | 246 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); |
247 } | 247 } |
248 | 248 |
249 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientType() | 249 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientType() |
250 { | 250 { |
251 m_orientType.shouldSynchronize = true; | 251 m_orientType.shouldSynchronize = true; |
252 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); | 252 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); |
253 } | 253 } |
254 | 254 |
255 } | 255 } |
OLD | NEW |