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 93 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
104 | 104 |
105 AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float
viewHeight) const | 105 AffineTransform SVGMarkerElement::viewBoxToViewTransform(float viewWidth, float
viewHeight) const |
106 { | 106 { |
107 return SVGFitToViewBox::viewBoxToViewTransform(viewBox(), preserveAspectRati
o(), viewWidth, viewHeight); | 107 return SVGFitToViewBox::viewBoxToViewTransform(viewBox(), preserveAspectRati
o(), viewWidth, viewHeight); |
108 } | 108 } |
109 | 109 |
110 bool SVGMarkerElement::isSupportedAttribute(const QualifiedName& attrName) | 110 bool SVGMarkerElement::isSupportedAttribute(const QualifiedName& attrName) |
111 { | 111 { |
112 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 112 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
113 if (supportedAttributes.isEmpty()) { | 113 if (supportedAttributes.isEmpty()) { |
114 SVGLangSpace::addSupportedAttributes(supportedAttributes); | |
115 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); | 114 SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes
); |
116 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); | 115 SVGFitToViewBox::addSupportedAttributes(supportedAttributes); |
117 supportedAttributes.add(SVGNames::markerUnitsAttr); | 116 supportedAttributes.add(SVGNames::markerUnitsAttr); |
118 supportedAttributes.add(SVGNames::refXAttr); | 117 supportedAttributes.add(SVGNames::refXAttr); |
119 supportedAttributes.add(SVGNames::refYAttr); | 118 supportedAttributes.add(SVGNames::refYAttr); |
120 supportedAttributes.add(SVGNames::markerWidthAttr); | 119 supportedAttributes.add(SVGNames::markerWidthAttr); |
121 supportedAttributes.add(SVGNames::markerHeightAttr); | 120 supportedAttributes.add(SVGNames::markerHeightAttr); |
122 supportedAttributes.add(SVGNames::orientAttr); | 121 supportedAttributes.add(SVGNames::orientAttr); |
123 } | 122 } |
124 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 123 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 17 matching lines...) Expand all Loading... |
142 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); | 141 setMarkerWidthBaseValue(SVGLength::construct(LengthModeWidth, value, par
seError)); |
143 else if (name == SVGNames::markerHeightAttr) | 142 else if (name == SVGNames::markerHeightAttr) |
144 setMarkerHeightBaseValue(SVGLength::construct(LengthModeHeight, value, p
arseError)); | 143 setMarkerHeightBaseValue(SVGLength::construct(LengthModeHeight, value, p
arseError)); |
145 else if (name == SVGNames::orientAttr) { | 144 else if (name == SVGNames::orientAttr) { |
146 SVGAngle angle; | 145 SVGAngle angle; |
147 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>:
:fromString(value, angle); | 146 SVGMarkerOrientType orientType = SVGPropertyTraits<SVGMarkerOrientType>:
:fromString(value, angle); |
148 if (orientType > 0) | 147 if (orientType > 0) |
149 setOrientTypeBaseValue(orientType); | 148 setOrientTypeBaseValue(orientType); |
150 if (orientType == SVGMarkerOrientAngle) | 149 if (orientType == SVGMarkerOrientAngle) |
151 setOrientAngleBaseValue(angle); | 150 setOrientAngleBaseValue(angle); |
152 } else if (SVGLangSpace::parseAttribute(name, value) | 151 } else if (SVGExternalResourcesRequired::parseAttribute(name, value) |
153 || SVGExternalResourcesRequired::parseAttribute(name, value) | |
154 || SVGFitToViewBox::parseAttribute(this, name, value)) { | 152 || SVGFitToViewBox::parseAttribute(this, name, value)) { |
155 } else | 153 } else |
156 ASSERT_NOT_REACHED(); | 154 ASSERT_NOT_REACHED(); |
157 | 155 |
158 reportAttributeParsingError(parseError, name, value); | 156 reportAttributeParsingError(parseError, name, value); |
159 } | 157 } |
160 | 158 |
161 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) | 159 void SVGMarkerElement::svgAttributeChanged(const QualifiedName& attrName) |
162 { | 160 { |
163 if (!isSupportedAttribute(attrName)) { | 161 if (!isSupportedAttribute(attrName)) { |
(...skipping 84 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
248 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); | 246 (ownerType, orientTypePropertyInfo(), ownerType->m_orientType.value); |
249 } | 247 } |
250 | 248 |
251 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientTypeAnimated() | 249 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarke
rElement::orientTypeAnimated() |
252 { | 250 { |
253 m_orientType.shouldSynchronize = true; | 251 m_orientType.shouldSynchronize = true; |
254 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); | 252 return static_pointer_cast<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOr
ientType> >(lookupOrCreateOrientTypeWrapper(this)); |
255 } | 253 } |
256 | 254 |
257 } | 255 } |
OLD | NEW |