Changeset 90560 in webkit
- Timestamp:
- Jul 7, 2011 7:18:01 AM (13 years ago)
- Location:
- trunk/Source/WebCore
- Files:
-
- 26 edited
Legend:
- Unmodified
- Added
- Removed
-
trunk/Source/WebCore/ChangeLog
r90558 r90560 1 2011-07-07 Nikolas Zimmermann <nzimmermann@rim.com> 2 3 Move remaining enums out of SVG*Element classes 4 https://bugs.webkit.org/show_bug.cgi?id=64075 5 6 Reviewed by Dirk Schulze. 7 8 Move remaining enums out of SVG*Element classes. This is a preparation patch for bug 63797. 9 Also move the SVGPropertyTraits template specializations for enum types before the class 10 definition in the header, otherwhise we can't use SVGPropertyTraits<FooType>::fromString/toString 11 in the DECLARE_ANIMATED* macros, which is needed soon. 12 13 No new tests, just refactoring. 14 15 * rendering/svg/RenderSVGResourceGradient.cpp: 16 (WebCore::RenderSVGResourceGradient::applyResource): 17 * rendering/svg/RenderSVGResourceGradient.h: 18 * rendering/svg/RenderSVGResourceMarker.cpp: 19 (WebCore::RenderSVGResourceMarker::angle): 20 (WebCore::RenderSVGResourceMarker::markerTransformation): 21 * rendering/svg/RenderSVGResourceMarker.h: 22 (WebCore::RenderSVGResourceMarker::markerUnits): 23 * rendering/svg/RenderSVGTextPath.cpp: 24 (WebCore::RenderSVGTextPath::RenderSVGTextPath): 25 (WebCore::RenderSVGTextPath::exactAlignment): 26 (WebCore::RenderSVGTextPath::stretchMethod): 27 * rendering/svg/SVGRenderTreeAsText.cpp: 28 (WebCore::operator<<): 29 (WebCore::writeCommonGradientProperties): 30 * rendering/svg/SVGTextChunkBuilder.cpp: 31 (WebCore::SVGTextChunkBuilder::addTextChunk): 32 * rendering/svg/SVGTextLayoutEngine.cpp: 33 (WebCore::SVGTextLayoutEngine::parentDefinesTextLength): 34 (WebCore::SVGTextLayoutEngine::beginTextPathLayout): 35 * svg/GradientAttributes.h: 36 (WebCore::GradientAttributes::GradientAttributes): 37 (WebCore::GradientAttributes::spreadMethod): 38 (WebCore::GradientAttributes::setSpreadMethod): 39 * svg/SVGComponentTransferFunctionElement.h: 40 * svg/SVGFEBlendElement.h: 41 * svg/SVGFEColorMatrixElement.h: 42 * svg/SVGFECompositeElement.h: 43 * svg/SVGFEConvolveMatrixElement.h: 44 * svg/SVGFEDisplacementMapElement.h: 45 * svg/SVGFEMorphologyElement.h: 46 * svg/SVGFETurbulenceElement.h: 47 * svg/SVGGradientElement.cpp: 48 (WebCore::SVGGradientElement::SVGGradientElement): 49 * svg/SVGGradientElement.h: 50 * svg/SVGMarkerElement.cpp: 51 (WebCore::SVGMarkerElement::SVGMarkerElement): 52 (WebCore::SVGMarkerElement::parseMappedAttribute): 53 (WebCore::SVGMarkerElement::setOrientToAuto): 54 (WebCore::SVGMarkerElement::setOrientToAngle): 55 (WebCore::SVGMarkerElement::synchronizeOrientType): 56 (WebCore::SVGMarkerElement::orientTypeAnimated): 57 * svg/SVGMarkerElement.h: 58 * svg/SVGTextContentElement.cpp: 59 (WebCore::SVGTextContentElement::SVGTextContentElement): 60 * svg/SVGTextContentElement.h: 61 * svg/SVGTextPathElement.cpp: 62 (WebCore::SVGTextPathElement::SVGTextPathElement): 63 * svg/SVGTextPathElement.h: 64 1 65 2011-07-07 Ilya Tikhonovsky <loislo@chromium.org> 2 66 -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.cpp
r89550 r90560 279 279 } 280 280 281 GradientSpreadMethod RenderSVGResourceGradient::platformSpreadMethodFromSVGType(SVG GradientElement::SVGSpreadMethodType method) const281 GradientSpreadMethod RenderSVGResourceGradient::platformSpreadMethodFromSVGType(SVGSpreadMethodType method) const 282 282 { 283 283 switch (method) { 284 case SVG GradientElement::SVG_SPREADMETHOD_UNKNOWN:285 case SVG GradientElement::SVG_SPREADMETHOD_PAD:284 case SVGSpreadMethodUnknown: 285 case SVGSpreadMethodPad: 286 286 return SpreadMethodPad; 287 case SVG GradientElement::SVG_SPREADMETHOD_REFLECT:287 case SVGSpreadMethodReflect: 288 288 return SpreadMethodReflect; 289 case SVG GradientElement::SVG_SPREADMETHOD_REPEAT:289 case SVGSpreadMethodRepeat: 290 290 return SpreadMethodRepeat; 291 291 } -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceGradient.h
r89550 r90560 62 62 virtual void buildGradient(GradientData*, SVGGradientElement*) const = 0; 63 63 64 GradientSpreadMethod platformSpreadMethodFromSVGType(SVG GradientElement::SVGSpreadMethodType) const;64 GradientSpreadMethod platformSpreadMethodFromSVGType(SVGSpreadMethodType) const; 65 65 66 66 private: -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.cpp
r88250 r90560 107 107 108 108 float angle = -1; 109 if (marker->orientType() == SVGMarker Element::SVG_MARKER_ORIENT_ANGLE)109 if (marker->orientType() == SVGMarkerOrientAngle) 110 110 angle = marker->orientAngle().value(); 111 111 … … 119 119 120 120 float markerAngle = angle(); 121 bool useStrokeWidth = (marker->markerUnits() == SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH);121 bool useStrokeWidth = marker->markerUnits() == SVGMarkerUnitsStrokeWidth; 122 122 123 123 AffineTransform transform; -
trunk/Source/WebCore/rendering/svg/RenderSVGResourceMarker.h
r86765 r90560 61 61 FloatPoint referencePoint() const; 62 62 float angle() const; 63 SVGMarker Element::SVGMarkerUnitsType markerUnits() const { return static_cast<SVGMarkerElement*>(node())->markerUnits(); }63 SVGMarkerUnitsType markerUnits() const { return static_cast<SVGMarkerElement*>(node())->markerUnits(); } 64 64 65 65 virtual RenderSVGResourceType resourceType() const { return s_resourceType; } -
trunk/Source/WebCore/rendering/svg/RenderSVGTextPath.cpp
r85617 r90560 36 36 RenderSVGTextPath::RenderSVGTextPath(Node* n) 37 37 : RenderSVGInline(n) 38 , m_startOffset(0 .0f)38 , m_startOffset(0) 39 39 , m_exactAlignment(true) 40 40 , m_stretchMethod(false) … … 70 70 bool RenderSVGTextPath::exactAlignment() const 71 71 { 72 return static_cast<SVGTextPathElement*>(node())->spacing() == SVG _TEXTPATH_SPACINGTYPE_EXACT;72 return static_cast<SVGTextPathElement*>(node())->spacing() == SVGTextPathSpacingExact; 73 73 } 74 74 75 75 bool RenderSVGTextPath::stretchMethod() const 76 76 { 77 return static_cast<SVGTextPathElement*>(node())->method() == SVG _TEXTPATH_METHODTYPE_STRETCH;77 return static_cast<SVGTextPathElement*>(node())->method() == SVGTextPathMethodStretch; 78 78 } 79 79 -
trunk/Source/WebCore/rendering/svg/SVGRenderTreeAsText.cpp
r87121 r90560 193 193 } 194 194 195 static TextStream& operator<<(TextStream& ts, const SVGMarker Element::SVGMarkerUnitsType& markerUnit)196 { 197 ts << SVGPropertyTraits<SVGMarker Element::SVGMarkerUnitsType>::toString(markerUnit);195 static TextStream& operator<<(TextStream& ts, const SVGMarkerUnitsType& markerUnit) 196 { 197 ts << SVGPropertyTraits<SVGMarkerUnitsType>::toString(markerUnit); 198 198 return ts; 199 199 } … … 252 252 } 253 253 254 static TextStream& operator<<(TextStream& ts, const SVG GradientElement::SVGSpreadMethodType& type)255 { 256 ts << SVGPropertyTraits<SVG GradientElement::SVGSpreadMethodType>::toString(type).upper();254 static TextStream& operator<<(TextStream& ts, const SVGSpreadMethodType& type) 255 { 256 ts << SVGPropertyTraits<SVGSpreadMethodType>::toString(type).upper(); 257 257 return ts; 258 258 } … … 501 501 } 502 502 503 static inline void writeCommonGradientProperties(TextStream& ts, SVG GradientElement::SVGSpreadMethodType spreadMethod, const AffineTransform& gradientTransform, bool boundingBoxMode)503 static inline void writeCommonGradientProperties(TextStream& ts, SVGSpreadMethodType spreadMethod, const AffineTransform& gradientTransform, bool boundingBoxMode) 504 504 { 505 505 writeNameValuePair(ts, "gradientUnits", boundingBoxModeString(boundingBoxMode)); 506 506 507 if (spreadMethod != SVG GradientElement::SVG_SPREADMETHOD_PAD)507 if (spreadMethod != SVGSpreadMethodPad) 508 508 ts << " [spreadMethod=" << spreadMethod << "]"; 509 509 -
trunk/Source/WebCore/rendering/svg/SVGTextChunkBuilder.cpp
r86765 r90560 131 131 132 132 switch (textContentElement->lengthAdjust()) { 133 case SVG TextContentElement::LENGTHADJUST_UNKNOWN:133 case SVGLengthAdjustUnknown: 134 134 break; 135 case SVG TextContentElement::LENGTHADJUST_SPACING:135 case SVGLengthAdjustSpacing: 136 136 chunkStyle |= SVGTextChunk::LengthAdjustSpacing; 137 137 break; 138 case SVG TextContentElement::LENGTHADJUST_SPACINGANDGLYPHS:138 case SVGLengthAdjustSpacingAndGlyphs: 139 139 chunkStyle |= SVGTextChunk::LengthAdjustSpacingAndGlyphs; 140 140 break; -
trunk/Source/WebCore/rendering/svg/SVGTextLayoutEngine.cpp
r86765 r90560 155 155 RenderObject* currentParent = parent; 156 156 while (currentParent) { 157 SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromRenderer(currentParent); 158 if (textContentElement) { 159 SVGTextContentElement::SVGLengthAdjustType lengthAdjust = textContentElement->lengthAdjust(); 160 if (lengthAdjust == SVGTextContentElement::LENGTHADJUST_SPACING && textContentElement->specifiedTextLength().value(textContentElement) > 0) 157 if (SVGTextContentElement* textContentElement = SVGTextContentElement::elementFromRenderer(currentParent)) { 158 if (textContentElement->lengthAdjust() == SVGLengthAdjustSpacing && textContentElement->specifiedTextLength().value(textContentElement) > 0) 161 159 return true; 162 160 } … … 209 207 210 208 // Eventually handle textLength adjustments. 211 SVG TextContentElement::SVGLengthAdjustType lengthAdjust = SVGTextContentElement::LENGTHADJUST_UNKNOWN;209 SVGLengthAdjustType lengthAdjust = SVGLengthAdjustUnknown; 212 210 float desiredTextLength = 0; 213 211 … … 220 218 return; 221 219 222 if (lengthAdjust == SVG TextContentElement::LENGTHADJUST_SPACING)220 if (lengthAdjust == SVGLengthAdjustSpacing) 223 221 m_textPathSpacing = (desiredTextLength - totalLength) / totalCharacters; 224 222 else -
trunk/Source/WebCore/svg/GradientAttributes.h
r86765 r90560 29 29 struct GradientAttributes { 30 30 GradientAttributes() 31 : m_spreadMethod(SVG GradientElement::SVG_SPREADMETHOD_PAD)31 : m_spreadMethod(SVGSpreadMethodPad) 32 32 , m_boundingBoxMode(true) 33 33 , m_spreadMethodSet(false) … … 38 38 } 39 39 40 SVG GradientElement::SVGSpreadMethodType spreadMethod() const { return m_spreadMethod; }40 SVGSpreadMethodType spreadMethod() const { return m_spreadMethod; } 41 41 bool boundingBoxMode() const { return m_boundingBoxMode; } 42 42 AffineTransform gradientTransform() const { return m_gradientTransform; } 43 43 const Vector<Gradient::ColorStop>& stops() const { return m_stops; } 44 44 45 void setSpreadMethod(SVG GradientElement::SVGSpreadMethodType value)45 void setSpreadMethod(SVGSpreadMethodType value) 46 46 { 47 47 m_spreadMethod = value; … … 74 74 private: 75 75 // Properties 76 SVG GradientElement::SVGSpreadMethodType m_spreadMethod;76 SVGSpreadMethodType m_spreadMethod; 77 77 bool m_boundingBoxMode; 78 78 AffineTransform m_gradientTransform; -
trunk/Source/WebCore/svg/SVGComponentTransferFunctionElement.h
r87010 r90560 29 29 30 30 namespace WebCore { 31 32 class SVGComponentTransferFunctionElement : public SVGElement {33 public:34 ComponentTransferFunction transferFunction() const;35 36 protected:37 SVGComponentTransferFunctionElement(const QualifiedName&, Document*);38 39 // FIXME: svgAttributeChanged missing.40 bool isSupportedAttribute(const QualifiedName&);41 virtual void parseMappedAttribute(Attribute*);42 virtual void synchronizeProperty(const QualifiedName&);43 virtual void fillAttributeToPropertyTypeMap();44 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();45 46 private:47 // Animated property declarations48 DECLARE_ANIMATED_ENUMERATION(Type, type, ComponentTransferType)49 DECLARE_ANIMATED_NUMBER_LIST(TableValues, tableValues)50 DECLARE_ANIMATED_NUMBER(Slope, slope)51 DECLARE_ANIMATED_NUMBER(Intercept, intercept)52 DECLARE_ANIMATED_NUMBER(Amplitude, amplitude)53 DECLARE_ANIMATED_NUMBER(Exponent, exponent)54 DECLARE_ANIMATED_NUMBER(Offset, offset)55 };56 31 57 32 template<> … … 96 71 }; 97 72 73 class SVGComponentTransferFunctionElement : public SVGElement { 74 public: 75 ComponentTransferFunction transferFunction() const; 76 77 protected: 78 SVGComponentTransferFunctionElement(const QualifiedName&, Document*); 79 80 // FIXME: svgAttributeChanged missing. 81 bool isSupportedAttribute(const QualifiedName&); 82 virtual void parseMappedAttribute(Attribute*); 83 virtual void synchronizeProperty(const QualifiedName&); 84 virtual void fillAttributeToPropertyTypeMap(); 85 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 86 87 private: 88 // Animated property declarations 89 DECLARE_ANIMATED_ENUMERATION(Type, type, ComponentTransferType) 90 DECLARE_ANIMATED_NUMBER_LIST(TableValues, tableValues) 91 DECLARE_ANIMATED_NUMBER(Slope, slope) 92 DECLARE_ANIMATED_NUMBER(Intercept, intercept) 93 DECLARE_ANIMATED_NUMBER(Amplitude, amplitude) 94 DECLARE_ANIMATED_NUMBER(Exponent, exponent) 95 DECLARE_ANIMATED_NUMBER(Offset, offset) 96 }; 97 98 98 } // namespace WebCore 99 99 -
trunk/Source/WebCore/svg/SVGFEBlendElement.h
r87010 r90560 28 28 29 29 namespace WebCore { 30 31 class SVGFEBlendElement : public SVGFilterPrimitiveStandardAttributes {32 public:33 static PassRefPtr<SVGFEBlendElement> create(const QualifiedName&, Document*);34 35 private:36 SVGFEBlendElement(const QualifiedName&, Document*);37 38 bool isSupportedAttribute(const QualifiedName&);39 virtual void parseMappedAttribute(Attribute*);40 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);41 virtual void svgAttributeChanged(const QualifiedName&);42 virtual void synchronizeProperty(const QualifiedName&);43 virtual void fillAttributeToPropertyTypeMap();44 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();45 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);46 47 // Animated property declarations48 DECLARE_ANIMATED_STRING(In1, in1)49 DECLARE_ANIMATED_STRING(In2, in2)50 DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType)51 };52 30 53 31 template<> … … 92 70 }; 93 71 72 class SVGFEBlendElement : public SVGFilterPrimitiveStandardAttributes { 73 public: 74 static PassRefPtr<SVGFEBlendElement> create(const QualifiedName&, Document*); 75 76 private: 77 SVGFEBlendElement(const QualifiedName&, Document*); 78 79 bool isSupportedAttribute(const QualifiedName&); 80 virtual void parseMappedAttribute(Attribute*); 81 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName); 82 virtual void svgAttributeChanged(const QualifiedName&); 83 virtual void synchronizeProperty(const QualifiedName&); 84 virtual void fillAttributeToPropertyTypeMap(); 85 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 86 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 87 88 // Animated property declarations 89 DECLARE_ANIMATED_STRING(In1, in1) 90 DECLARE_ANIMATED_STRING(In2, in2) 91 DECLARE_ANIMATED_ENUMERATION(Mode, mode, BlendModeType) 92 }; 93 94 94 } // namespace WebCore 95 95 -
trunk/Source/WebCore/svg/SVGFEColorMatrixElement.h
r87010 r90560 29 29 30 30 namespace WebCore { 31 32 class SVGFEColorMatrixElement : public SVGFilterPrimitiveStandardAttributes {33 public:34 static PassRefPtr<SVGFEColorMatrixElement> create(const QualifiedName&, Document*);35 36 private:37 SVGFEColorMatrixElement(const QualifiedName&, Document*);38 39 bool isSupportedAttribute(const QualifiedName&);40 virtual void parseMappedAttribute(Attribute*);41 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);42 virtual void svgAttributeChanged(const QualifiedName&);43 virtual void synchronizeProperty(const QualifiedName&);44 virtual void fillAttributeToPropertyTypeMap();45 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();46 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);47 48 // Animated property declarations49 DECLARE_ANIMATED_STRING(In1, in1)50 DECLARE_ANIMATED_ENUMERATION(Type, type, ColorMatrixType)51 DECLARE_ANIMATED_NUMBER_LIST(Values, values)52 };53 31 54 32 template<> … … 89 67 }; 90 68 69 class SVGFEColorMatrixElement : public SVGFilterPrimitiveStandardAttributes { 70 public: 71 static PassRefPtr<SVGFEColorMatrixElement> create(const QualifiedName&, Document*); 72 73 private: 74 SVGFEColorMatrixElement(const QualifiedName&, Document*); 75 76 bool isSupportedAttribute(const QualifiedName&); 77 virtual void parseMappedAttribute(Attribute*); 78 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); 79 virtual void svgAttributeChanged(const QualifiedName&); 80 virtual void synchronizeProperty(const QualifiedName&); 81 virtual void fillAttributeToPropertyTypeMap(); 82 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 83 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 84 85 // Animated property declarations 86 DECLARE_ANIMATED_STRING(In1, in1) 87 DECLARE_ANIMATED_ENUMERATION(Type, type, ColorMatrixType) 88 DECLARE_ANIMATED_NUMBER_LIST(Values, values) 89 }; 90 91 91 } // namespace WebCore 92 92 -
trunk/Source/WebCore/svg/SVGFECompositeElement.h
r87010 r90560 29 29 30 30 namespace WebCore { 31 32 class SVGFECompositeElement : public SVGFilterPrimitiveStandardAttributes {33 public:34 static PassRefPtr<SVGFECompositeElement> create(const QualifiedName&, Document*);35 36 private:37 SVGFECompositeElement(const QualifiedName&, Document*);38 39 bool isSupportedAttribute(const QualifiedName&);40 virtual void parseMappedAttribute(Attribute*);41 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);42 virtual void svgAttributeChanged(const QualifiedName&);43 virtual void synchronizeProperty(const QualifiedName&);44 virtual void fillAttributeToPropertyTypeMap();45 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();46 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);47 48 // Animated property declarations49 DECLARE_ANIMATED_STRING(In1, in1)50 DECLARE_ANIMATED_STRING(In2, in2)51 DECLARE_ANIMATED_ENUMERATION(_operator, _operator, CompositeOperationType)52 DECLARE_ANIMATED_NUMBER(K1, k1)53 DECLARE_ANIMATED_NUMBER(K2, k2)54 DECLARE_ANIMATED_NUMBER(K3, k3)55 DECLARE_ANIMATED_NUMBER(K4, k4)56 };57 31 58 32 template<> … … 101 75 }; 102 76 77 class SVGFECompositeElement : public SVGFilterPrimitiveStandardAttributes { 78 public: 79 static PassRefPtr<SVGFECompositeElement> create(const QualifiedName&, Document*); 80 81 private: 82 SVGFECompositeElement(const QualifiedName&, Document*); 83 84 bool isSupportedAttribute(const QualifiedName&); 85 virtual void parseMappedAttribute(Attribute*); 86 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); 87 virtual void svgAttributeChanged(const QualifiedName&); 88 virtual void synchronizeProperty(const QualifiedName&); 89 virtual void fillAttributeToPropertyTypeMap(); 90 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 91 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 92 93 // Animated property declarations 94 DECLARE_ANIMATED_STRING(In1, in1) 95 DECLARE_ANIMATED_STRING(In2, in2) 96 DECLARE_ANIMATED_ENUMERATION(_operator, _operator, CompositeOperationType) 97 DECLARE_ANIMATED_NUMBER(K1, k1) 98 DECLARE_ANIMATED_NUMBER(K2, k2) 99 DECLARE_ANIMATED_NUMBER(K3, k3) 100 DECLARE_ANIMATED_NUMBER(K4, k4) 101 }; 102 103 103 } // namespace WebCore 104 104 -
trunk/Source/WebCore/svg/SVGFEConvolveMatrixElement.h
r87010 r90560 31 31 32 32 namespace WebCore { 33 34 template<> 35 struct SVGPropertyTraits<EdgeModeType> { 36 static EdgeModeType highestEnumValue() { return EDGEMODE_NONE; } 37 38 static String toString(EdgeModeType type) 39 { 40 switch (type) { 41 case EDGEMODE_UNKNOWN: 42 return emptyString(); 43 case EDGEMODE_DUPLICATE: 44 return "duplicate"; 45 case EDGEMODE_WRAP: 46 return "wrap"; 47 case EDGEMODE_NONE: 48 return "none"; 49 } 50 51 ASSERT_NOT_REACHED(); 52 return emptyString(); 53 } 54 55 static EdgeModeType fromString(const String& value) 56 { 57 if (value == "duplicate") 58 return EDGEMODE_DUPLICATE; 59 if (value == "wrap") 60 return EDGEMODE_WRAP; 61 if (value == "none") 62 return EDGEMODE_NONE; 63 return EDGEMODE_UNKNOWN; 64 } 65 }; 33 66 34 67 class SVGFEConvolveMatrixElement : public SVGFilterPrimitiveStandardAttributes { … … 71 104 }; 72 105 73 template<>74 struct SVGPropertyTraits<EdgeModeType> {75 static EdgeModeType highestEnumValue() { return EDGEMODE_NONE; }76 77 static String toString(EdgeModeType type)78 {79 switch (type) {80 case EDGEMODE_UNKNOWN:81 return emptyString();82 case EDGEMODE_DUPLICATE:83 return "duplicate";84 case EDGEMODE_WRAP:85 return "wrap";86 case EDGEMODE_NONE:87 return "none";88 }89 90 ASSERT_NOT_REACHED();91 return emptyString();92 }93 94 static EdgeModeType fromString(const String& value)95 {96 if (value == "duplicate")97 return EDGEMODE_DUPLICATE;98 if (value == "wrap")99 return EDGEMODE_WRAP;100 if (value == "none")101 return EDGEMODE_NONE;102 return EDGEMODE_UNKNOWN;103 }104 };105 106 106 } // namespace WebCore 107 107 -
trunk/Source/WebCore/svg/SVGFEDisplacementMapElement.h
r87010 r90560 28 28 29 29 namespace WebCore { 30 31 class SVGFEDisplacementMapElement : public SVGFilterPrimitiveStandardAttributes { 32 public: 33 static PassRefPtr<SVGFEDisplacementMapElement> create(const QualifiedName&, Document*); 34 35 static ChannelSelectorType stringToChannel(const String&); 36 37 private: 38 SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*); 39 40 bool isSupportedAttribute(const QualifiedName&); 41 virtual void parseMappedAttribute(Attribute*); 42 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName); 43 virtual void svgAttributeChanged(const QualifiedName&); 44 virtual void synchronizeProperty(const QualifiedName&); 45 virtual void fillAttributeToPropertyTypeMap(); 46 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 47 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 48 49 // Animated property declarations 50 DECLARE_ANIMATED_STRING(In1, in1) 51 DECLARE_ANIMATED_STRING(In2, in2) 52 DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType) 53 DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType) 54 DECLARE_ANIMATED_NUMBER(Scale, scale) 55 }; 56 30 57 31 template<> 58 32 struct SVGPropertyTraits<ChannelSelectorType> { … … 92 66 }; 93 67 68 class SVGFEDisplacementMapElement : public SVGFilterPrimitiveStandardAttributes { 69 public: 70 static PassRefPtr<SVGFEDisplacementMapElement> create(const QualifiedName&, Document*); 71 72 static ChannelSelectorType stringToChannel(const String&); 73 74 private: 75 SVGFEDisplacementMapElement(const QualifiedName& tagName, Document*); 76 77 bool isSupportedAttribute(const QualifiedName&); 78 virtual void parseMappedAttribute(Attribute*); 79 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName); 80 virtual void svgAttributeChanged(const QualifiedName&); 81 virtual void synchronizeProperty(const QualifiedName&); 82 virtual void fillAttributeToPropertyTypeMap(); 83 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 84 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 85 86 // Animated property declarations 87 DECLARE_ANIMATED_STRING(In1, in1) 88 DECLARE_ANIMATED_STRING(In2, in2) 89 DECLARE_ANIMATED_ENUMERATION(XChannelSelector, xChannelSelector, ChannelSelectorType) 90 DECLARE_ANIMATED_ENUMERATION(YChannelSelector, yChannelSelector, ChannelSelectorType) 91 DECLARE_ANIMATED_NUMBER(Scale, scale) 92 }; 93 94 94 } // namespace WebCore 95 95 -
trunk/Source/WebCore/svg/SVGFEMorphologyElement.h
r87010 r90560 29 29 namespace WebCore { 30 30 31 class SVGFEMorphologyElement : public SVGFilterPrimitiveStandardAttributes {32 public:33 static PassRefPtr<SVGFEMorphologyElement> create(const QualifiedName&, Document*);34 35 void setRadius(float radiusX, float radiusY);36 37 private:38 SVGFEMorphologyElement(const QualifiedName&, Document*);39 40 bool isSupportedAttribute(const QualifiedName&);41 virtual void parseMappedAttribute(Attribute*);42 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&);43 virtual void svgAttributeChanged(const QualifiedName&);44 virtual void synchronizeProperty(const QualifiedName&);45 virtual void fillAttributeToPropertyTypeMap();46 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();47 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);48 49 static const AtomicString& radiusXIdentifier();50 static const AtomicString& radiusYIdentifier();51 52 // Animated property declarations53 DECLARE_ANIMATED_STRING(In1, in1)54 DECLARE_ANIMATED_ENUMERATION(_operator, _operator, MorphologyOperatorType)55 DECLARE_ANIMATED_NUMBER(RadiusX, radiusX)56 DECLARE_ANIMATED_NUMBER(RadiusY, radiusY)57 };58 59 31 template<> 60 32 struct SVGPropertyTraits<MorphologyOperatorType> { … … 86 58 }; 87 59 60 class SVGFEMorphologyElement : public SVGFilterPrimitiveStandardAttributes { 61 public: 62 static PassRefPtr<SVGFEMorphologyElement> create(const QualifiedName&, Document*); 63 64 void setRadius(float radiusX, float radiusY); 65 66 private: 67 SVGFEMorphologyElement(const QualifiedName&, Document*); 68 69 bool isSupportedAttribute(const QualifiedName&); 70 virtual void parseMappedAttribute(Attribute*); 71 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName&); 72 virtual void svgAttributeChanged(const QualifiedName&); 73 virtual void synchronizeProperty(const QualifiedName&); 74 virtual void fillAttributeToPropertyTypeMap(); 75 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 76 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 77 78 static const AtomicString& radiusXIdentifier(); 79 static const AtomicString& radiusYIdentifier(); 80 81 // Animated property declarations 82 DECLARE_ANIMATED_STRING(In1, in1) 83 DECLARE_ANIMATED_ENUMERATION(_operator, _operator, MorphologyOperatorType) 84 DECLARE_ANIMATED_NUMBER(RadiusX, radiusX) 85 DECLARE_ANIMATED_NUMBER(RadiusY, radiusY) 86 }; 87 88 88 } // namespace WebCore 89 89 -
trunk/Source/WebCore/svg/SVGFETurbulenceElement.h
r87010 r90560 35 35 SVG_STITCHTYPE_STITCH = 1, 36 36 SVG_STITCHTYPE_NOSTITCH = 2 37 };38 39 class SVGFETurbulenceElement : public SVGFilterPrimitiveStandardAttributes {40 public:41 static PassRefPtr<SVGFETurbulenceElement> create(const QualifiedName&, Document*);42 43 private:44 SVGFETurbulenceElement(const QualifiedName&, Document*);45 46 bool isSupportedAttribute(const QualifiedName&);47 virtual void parseMappedAttribute(Attribute*);48 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName);49 virtual void svgAttributeChanged(const QualifiedName&);50 virtual void synchronizeProperty(const QualifiedName&);51 virtual void fillAttributeToPropertyTypeMap();52 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap();53 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*);54 55 static const AtomicString& baseFrequencyXIdentifier();56 static const AtomicString& baseFrequencyYIdentifier();57 58 // Animated property declarations59 DECLARE_ANIMATED_NUMBER(BaseFrequencyX, baseFrequencyX)60 DECLARE_ANIMATED_NUMBER(BaseFrequencyY, baseFrequencyY)61 DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves)62 DECLARE_ANIMATED_NUMBER(Seed, seed)63 DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions)64 DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType)65 37 }; 66 38 … … 123 95 }; 124 96 97 class SVGFETurbulenceElement : public SVGFilterPrimitiveStandardAttributes { 98 public: 99 static PassRefPtr<SVGFETurbulenceElement> create(const QualifiedName&, Document*); 100 101 private: 102 SVGFETurbulenceElement(const QualifiedName&, Document*); 103 104 bool isSupportedAttribute(const QualifiedName&); 105 virtual void parseMappedAttribute(Attribute*); 106 virtual bool setFilterEffectAttribute(FilterEffect*, const QualifiedName& attrName); 107 virtual void svgAttributeChanged(const QualifiedName&); 108 virtual void synchronizeProperty(const QualifiedName&); 109 virtual void fillAttributeToPropertyTypeMap(); 110 virtual AttributeToPropertyTypeMap& attributeToPropertyTypeMap(); 111 virtual PassRefPtr<FilterEffect> build(SVGFilterBuilder*, Filter*); 112 113 static const AtomicString& baseFrequencyXIdentifier(); 114 static const AtomicString& baseFrequencyYIdentifier(); 115 116 // Animated property declarations 117 DECLARE_ANIMATED_NUMBER(BaseFrequencyX, baseFrequencyX) 118 DECLARE_ANIMATED_NUMBER(BaseFrequencyY, baseFrequencyY) 119 DECLARE_ANIMATED_INTEGER(NumOctaves, numOctaves) 120 DECLARE_ANIMATED_NUMBER(Seed, seed) 121 DECLARE_ANIMATED_ENUMERATION(StitchTiles, stitchTiles, SVGStitchOptions) 122 DECLARE_ANIMATED_ENUMERATION(Type, type, TurbulenceType) 123 }; 124 125 125 } // namespace WebCore 126 126 -
trunk/Source/WebCore/svg/SVGGradientElement.cpp
r87010 r90560 40 40 41 41 // Animated property definitions 42 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::spreadMethodAttr, SpreadMethod, spreadMethod, SVG GradientElement::SVGSpreadMethodType)42 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::spreadMethodAttr, SpreadMethod, spreadMethod, SVGSpreadMethodType) 43 43 DEFINE_ANIMATED_ENUMERATION(SVGGradientElement, SVGNames::gradientUnitsAttr, GradientUnits, gradientUnits, SVGUnitTypes::SVGUnitType) 44 44 DEFINE_ANIMATED_TRANSFORM_LIST(SVGGradientElement, SVGNames::gradientTransformAttr, GradientTransform, gradientTransform) … … 48 48 SVGGradientElement::SVGGradientElement(const QualifiedName& tagName, Document* document) 49 49 : SVGStyledElement(tagName, document) 50 , m_spreadMethod(SVG _SPREADMETHOD_PAD)50 , m_spreadMethod(SVGSpreadMethodPad) 51 51 , m_gradientUnits(SVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) 52 52 { -
trunk/Source/WebCore/svg/SVGGradientElement.h
r87010 r90560 34 34 namespace WebCore { 35 35 36 enum SVGSpreadMethodType { 37 SVGSpreadMethodUnknown = 0, 38 SVGSpreadMethodPad, 39 SVGSpreadMethodReflect, 40 SVGSpreadMethodRepeat 41 }; 42 43 template<> 44 struct SVGPropertyTraits<SVGSpreadMethodType> { 45 static SVGSpreadMethodType highestEnumValue() { return SVGSpreadMethodRepeat; } 46 47 static String toString(SVGSpreadMethodType type) 48 { 49 switch (type) { 50 case SVGSpreadMethodUnknown: 51 return emptyString(); 52 case SVGSpreadMethodPad: 53 return "pad"; 54 case SVGSpreadMethodReflect: 55 return "reflect"; 56 case SVGSpreadMethodRepeat: 57 return "repeat"; 58 } 59 60 ASSERT_NOT_REACHED(); 61 return emptyString(); 62 } 63 64 static SVGSpreadMethodType fromString(const String& value) 65 { 66 if (value == "pad") 67 return SVGSpreadMethodPad; 68 if (value == "reflect") 69 return SVGSpreadMethodReflect; 70 if (value == "repeat") 71 return SVGSpreadMethodRepeat; 72 return SVGSpreadMethodUnknown; 73 } 74 }; 75 76 36 77 class SVGGradientElement : public SVGStyledElement, 37 78 public SVGURIReference, 38 79 public SVGExternalResourcesRequired { 39 80 public: 40 enum SVGSpreadMethodType{41 SVG_SPREADMETHOD_UNKNOWN = 0,42 SVG_SPREADMETHOD_PAD = 1,43 SVG_SPREADMETHOD_REFLECT = 2,44 SVG_SPREADMETHOD_REPEAT = 381 enum { 82 SVG_SPREADMETHOD_UNKNOWN = SVGSpreadMethodUnknown, 83 SVG_SPREADMETHOD_PAD = SVGSpreadMethodReflect, 84 SVG_SPREADMETHOD_REFLECT = SVGSpreadMethodRepeat, 85 SVG_SPREADMETHOD_REPEAT = SVGSpreadMethodUnknown 45 86 }; 46 87 … … 73 114 }; 74 115 75 template<>76 struct SVGPropertyTraits<SVGGradientElement::SVGSpreadMethodType> {77 static SVGGradientElement::SVGSpreadMethodType highestEnumValue() { return SVGGradientElement::SVG_SPREADMETHOD_REPEAT; }78 79 static String toString(SVGGradientElement::SVGSpreadMethodType type)80 {81 switch (type) {82 case SVGGradientElement::SVG_SPREADMETHOD_UNKNOWN:83 return emptyString();84 case SVGGradientElement::SVG_SPREADMETHOD_PAD:85 return "pad";86 case SVGGradientElement::SVG_SPREADMETHOD_REFLECT:87 return "reflect";88 case SVGGradientElement::SVG_SPREADMETHOD_REPEAT:89 return "repeat";90 }91 92 ASSERT_NOT_REACHED();93 return emptyString();94 }95 96 static SVGGradientElement::SVGSpreadMethodType fromString(const String& value)97 {98 if (value == "pad")99 return SVGGradientElement::SVG_SPREADMETHOD_PAD;100 if (value == "reflect")101 return SVGGradientElement::SVG_SPREADMETHOD_REFLECT;102 if (value == "repeat")103 return SVGGradientElement::SVG_SPREADMETHOD_REPEAT;104 return SVGGradientElement::SVG_SPREADMETHOD_UNKNOWN;105 }106 };107 108 116 } // namespace WebCore 109 117 -
trunk/Source/WebCore/svg/SVGMarkerElement.cpp
r87010 r90560 39 39 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerWidthAttr, MarkerWidth, markerWidth) 40 40 DEFINE_ANIMATED_LENGTH(SVGMarkerElement, SVGNames::markerHeightAttr, MarkerHeight, markerHeight) 41 DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerUnits, markerUnits, SVGMarker Element::SVGMarkerUnitsType)41 DEFINE_ANIMATED_ENUMERATION(SVGMarkerElement, SVGNames::markerUnitsAttr, MarkerUnits, markerUnits, SVGMarkerUnitsType) 42 42 DEFINE_ANIMATED_ANGLE_MULTIPLE_WRAPPERS(SVGMarkerElement, SVGNames::orientAttr, orientAngleIdentifier(), OrientAngle, orientAngle) 43 43 DEFINE_ANIMATED_BOOLEAN(SVGMarkerElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired) … … 51 51 , m_markerWidth(LengthModeWidth, "3") 52 52 , m_markerHeight(LengthModeHeight, "3") 53 , m_markerUnits(SVG _MARKERUNITS_STROKEWIDTH)54 , m_orientType(SVG _MARKER_ORIENT_ANGLE)53 , m_markerUnits(SVGMarkerUnitsStrokeWidth) 54 , m_orientType(SVGMarkerOrientAngle) 55 55 { 56 56 // Spec: If the markerWidth/markerHeight attribute is not specified, the effect is as if a value of "3" were specified. … … 137 137 if (orientType > 0) 138 138 setOrientTypeBaseValue(orientType); 139 if (orientType == SVG _MARKER_ORIENT_ANGLE)139 if (orientType == SVGMarkerOrientAngle) 140 140 setOrientAngleBaseValue(angle); 141 141 return; … … 269 269 void SVGMarkerElement::setOrientToAuto() 270 270 { 271 setOrientTypeBaseValue(SVG _MARKER_ORIENT_AUTO);271 setOrientTypeBaseValue(SVGMarkerOrientAuto); 272 272 setOrientAngleBaseValue(SVGAngle()); 273 273 … … 278 278 void SVGMarkerElement::setOrientToAngle(const SVGAngle& angle) 279 279 { 280 setOrientTypeBaseValue(SVG _MARKER_ORIENT_ANGLE);280 setOrientTypeBaseValue(SVGMarkerOrientAngle); 281 281 setOrientAngleBaseValue(angle); 282 282 … … 304 304 305 305 AtomicString value; 306 if (m_orientType.value == SVG _MARKER_ORIENT_AUTO)306 if (m_orientType.value == SVGMarkerOrientAuto) 307 307 value = "auto"; 308 else if (m_orientType.value == SVG _MARKER_ORIENT_ANGLE)308 else if (m_orientType.value == SVGMarkerOrientAngle) 309 309 value = orientAngle().valueAsString(); 310 310 … … 312 312 } 313 313 314 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarker Element::SVGMarkerOrientType> > SVGMarkerElement::orientTypeAnimated()314 PassRefPtr<SVGAnimatedEnumerationPropertyTearOff<SVGMarkerOrientType> > SVGMarkerElement::orientTypeAnimated() 315 315 { 316 316 m_orientType.shouldSynchronize = true; -
trunk/Source/WebCore/svg/SVGMarkerElement.h
r87125 r90560 36 36 namespace WebCore { 37 37 38 enum SVGMarkerUnitsType { 39 SVGMarkerUnitsUnknown = 0, 40 SVGMarkerUnitsUserSpaceOnUse, 41 SVGMarkerUnitsStrokeWidth 42 }; 43 44 enum SVGMarkerOrientType { 45 SVGMarkerOrientUnknown = 0, 46 SVGMarkerOrientAuto, 47 SVGMarkerOrientAngle 48 }; 49 50 template<> 51 struct SVGPropertyTraits<SVGMarkerUnitsType> { 52 static SVGMarkerUnitsType highestEnumValue() { return SVGMarkerUnitsStrokeWidth; } 53 54 static String toString(SVGMarkerUnitsType type) 55 { 56 switch (type) { 57 case SVGMarkerUnitsUnknown: 58 return emptyString(); 59 case SVGMarkerUnitsUserSpaceOnUse: 60 return "userSpaceOnUse"; 61 case SVGMarkerUnitsStrokeWidth: 62 return "strokeWidth"; 63 } 64 65 ASSERT_NOT_REACHED(); 66 return emptyString(); 67 } 68 69 static SVGMarkerUnitsType fromString(const String& value) 70 { 71 if (value == "userSpaceOnUse") 72 return SVGMarkerUnitsUserSpaceOnUse; 73 if (value == "strokeWidth") 74 return SVGMarkerUnitsStrokeWidth; 75 return SVGMarkerUnitsUnknown; 76 } 77 }; 78 79 template<> 80 struct SVGPropertyTraits<SVGMarkerOrientType> { 81 static SVGMarkerOrientType highestEnumValue() { return SVGMarkerOrientAngle; } 82 83 // toString is not needed, synchronizeOrientType() handles this on its own. 84 85 static SVGMarkerOrientType fromString(const String& value, SVGAngle& angle) 86 { 87 if (value == "auto") 88 return SVGMarkerOrientAuto; 89 90 ExceptionCode ec = 0; 91 angle.setValueAsString(value, ec); 92 if (!ec) 93 return SVGMarkerOrientAngle; 94 return SVGMarkerOrientUnknown; 95 } 96 }; 97 38 98 class SVGMarkerElement : public SVGStyledElement, 39 99 public SVGLangSpace, … … 41 101 public SVGFitToViewBox { 42 102 public: 43 enum SVGMarkerUnitsType { 44 SVG_MARKERUNITS_UNKNOWN = 0, 45 SVG_MARKERUNITS_USERSPACEONUSE = 1, 46 SVG_MARKERUNITS_STROKEWIDTH = 2 103 // Forward declare enumerations in the W3C naming scheme, for IDL generation. 104 enum { 105 SVG_MARKERUNITS_UNKNOWN = SVGMarkerUnitsUnknown, 106 SVG_MARKERUNITS_USERSPACEONUSE = SVGMarkerUnitsUserSpaceOnUse, 107 SVG_MARKERUNITS_STROKEWIDTH = SVGMarkerUnitsStrokeWidth 47 108 }; 48 109 49 enum SVGMarkerOrientType{50 SVG_MARKER_ORIENT_UNKNOWN = 0,51 SVG_MARKER_ORIENT_AUTO = 1,52 SVG_MARKER_ORIENT_ANGLE = 2110 enum { 111 SVG_MARKER_ORIENT_UNKNOWN = SVGMarkerOrientUnknown, 112 SVG_MARKER_ORIENT_AUTO = SVGMarkerOrientAuto, 113 SVG_MARKER_ORIENT_ANGLE = SVGMarkerOrientAngle 53 114 }; 54 115 … … 108 169 }; 109 170 110 template<>111 struct SVGPropertyTraits<SVGMarkerElement::SVGMarkerUnitsType> {112 static SVGMarkerElement::SVGMarkerUnitsType highestEnumValue() { return SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH; }113 114 static String toString(SVGMarkerElement::SVGMarkerUnitsType type)115 {116 switch (type) {117 case SVGMarkerElement::SVG_MARKERUNITS_UNKNOWN:118 return emptyString();119 case SVGMarkerElement::SVG_MARKERUNITS_USERSPACEONUSE:120 return "userSpaceOnUse";121 case SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH:122 return "strokeWidth";123 }124 125 ASSERT_NOT_REACHED();126 return emptyString();127 }128 129 static SVGMarkerElement::SVGMarkerUnitsType fromString(const String& value)130 {131 if (value == "userSpaceOnUse")132 return SVGMarkerElement::SVG_MARKERUNITS_USERSPACEONUSE;133 if (value == "strokeWidth")134 return SVGMarkerElement::SVG_MARKERUNITS_STROKEWIDTH;135 return SVGMarkerElement::SVG_MARKERUNITS_UNKNOWN;136 }137 };138 139 template<>140 struct SVGPropertyTraits<SVGMarkerElement::SVGMarkerOrientType> {141 static SVGMarkerElement::SVGMarkerOrientType highestEnumValue() { return SVGMarkerElement::SVG_MARKER_ORIENT_ANGLE; }142 143 // toString is not needed, synchronizeOrientType() handles this on its own.144 145 static SVGMarkerElement::SVGMarkerOrientType fromString(const String& value, SVGAngle& angle)146 {147 if (value == "auto")148 return SVGMarkerElement::SVG_MARKER_ORIENT_AUTO;149 150 ExceptionCode ec = 0;151 angle.setValueAsString(value, ec);152 if (!ec)153 return SVGMarkerElement::SVG_MARKER_ORIENT_ANGLE;154 return SVGMarkerElement::SVG_MARKER_ORIENT_UNKNOWN;155 }156 };157 158 171 } 159 172 -
trunk/Source/WebCore/svg/SVGTextContentElement.cpp
r90156 r90560 40 40 41 41 // Animated property definitions 42 DEFINE_ANIMATED_ENUMERATION(SVGTextContentElement, SVGNames::lengthAdjustAttr, LengthAdjust, lengthAdjust, SVG TextContentElement::SVGLengthAdjustType)42 DEFINE_ANIMATED_ENUMERATION(SVGTextContentElement, SVGNames::lengthAdjustAttr, LengthAdjust, lengthAdjust, SVGLengthAdjustType) 43 43 DEFINE_ANIMATED_BOOLEAN(SVGTextContentElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired) 44 44 … … 47 47 , m_specifiedTextLength(LengthModeOther) 48 48 , m_textLength(LengthModeOther) 49 , m_lengthAdjust( LENGTHADJUST_SPACING)49 , m_lengthAdjust(SVGLengthAdjustSpacing) 50 50 { 51 51 } -
trunk/Source/WebCore/svg/SVGTextContentElement.h
r90156 r90560 33 33 namespace WebCore { 34 34 35 enum SVGLengthAdjustType { 36 SVGLengthAdjustUnknown, 37 SVGLengthAdjustSpacing, 38 SVGLengthAdjustSpacingAndGlyphs 39 }; 40 41 template<> 42 struct SVGPropertyTraits<SVGLengthAdjustType> { 43 static SVGLengthAdjustType highestEnumValue() { return SVGLengthAdjustSpacingAndGlyphs; } 44 45 static String toString(SVGLengthAdjustType type) 46 { 47 switch (type) { 48 case SVGLengthAdjustUnknown: 49 return emptyString(); 50 case SVGLengthAdjustSpacing: 51 return "spacing"; 52 case SVGLengthAdjustSpacingAndGlyphs: 53 return "spacingAndGlyphs"; 54 } 55 56 ASSERT_NOT_REACHED(); 57 return emptyString(); 58 } 59 60 static SVGLengthAdjustType fromString(const String& value) 61 { 62 if (value == "spacingAndGlyphs") 63 return SVGLengthAdjustSpacingAndGlyphs; 64 if (value == "spacing") 65 return SVGLengthAdjustSpacing; 66 return SVGLengthAdjustUnknown; 67 } 68 }; 69 35 70 class SVGTextContentElement : public SVGStyledElement, 36 71 public SVGTests, … … 38 73 public SVGExternalResourcesRequired { 39 74 public: 40 enum SVGLengthAdjustType { 41 LENGTHADJUST_UNKNOWN = 0, 42 LENGTHADJUST_SPACING = 1, 43 LENGTHADJUST_SPACINGANDGLYPHS = 2 75 // Forward declare enumerations in the W3C naming scheme, for IDL generation. 76 enum { 77 LENGTHADJUST_UNKNOWN = SVGLengthAdjustUnknown, 78 LENGTHADJUST_SPACING = SVGLengthAdjustSpacing, 79 LENGTHADJUST_SPACINGANDGLYPHS = SVGLengthAdjustSpacingAndGlyphs 44 80 }; 45 81 … … 88 124 }; 89 125 90 template<>91 struct SVGPropertyTraits<SVGTextContentElement::SVGLengthAdjustType> {92 static SVGTextContentElement::SVGLengthAdjustType highestEnumValue() { return SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS; }93 94 static String toString(SVGTextContentElement::SVGLengthAdjustType type)95 {96 switch (type) {97 case SVGTextContentElement::LENGTHADJUST_UNKNOWN:98 return emptyString();99 case SVGTextContentElement::LENGTHADJUST_SPACING:100 return "spacing";101 case SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS:102 return "spacingAndGlyphs";103 }104 105 ASSERT_NOT_REACHED();106 return emptyString();107 }108 109 static SVGTextContentElement::SVGLengthAdjustType fromString(const String& value)110 {111 if (value == "spacingAndGlyphs")112 return SVGTextContentElement::LENGTHADJUST_SPACINGANDGLYPHS;113 if (value == "spacing")114 return SVGTextContentElement::LENGTHADJUST_SPACING;115 return SVGTextContentElement::LENGTHADJUST_UNKNOWN;116 }117 };118 119 126 } // namespace WebCore 120 127 -
trunk/Source/WebCore/svg/SVGTextPathElement.cpp
r87125 r90560 41 41 : SVGTextContentElement(tagName, document) 42 42 , m_startOffset(LengthModeOther) 43 , m_method(SVG _TEXTPATH_METHODTYPE_ALIGN)44 , m_spacing(SVG _TEXTPATH_SPACINGTYPE_EXACT)43 , m_method(SVGTextPathMethodAlign) 44 , m_spacing(SVGTextPathSpacingExact) 45 45 { 46 46 ASSERT(hasTagName(SVGNames::textPathTag)); -
trunk/Source/WebCore/svg/SVGTextPathElement.h
r87125 r90560 29 29 30 30 enum SVGTextPathMethodType { 31 SVG _TEXTPATH_METHODTYPE_UNKNOWN= 0,32 SVG _TEXTPATH_METHODTYPE_ALIGN = 1,33 SVG _TEXTPATH_METHODTYPE_STRETCH = 231 SVGTextPathMethodUnknown = 0, 32 SVGTextPathMethodAlign, 33 SVGTextPathMethodStretch 34 34 }; 35 35 36 36 enum SVGTextPathSpacingType { 37 SVG _TEXTPATH_SPACINGTYPE_UNKNOWN= 0,38 SVG _TEXTPATH_SPACINGTYPE_AUTO = 1,39 SVG _TEXTPATH_SPACINGTYPE_EXACT = 237 SVGTextPathSpacingUnknown = 0, 38 SVGTextPathSpacingAuto, 39 SVGTextPathSpacingExact 40 40 }; 41 41 … … 43 43 public SVGURIReference { 44 44 public: 45 // Forward declare these enums in the w3c naming scheme, for IDL generation45 // Forward declare enumerations in the W3C naming scheme, for IDL generation. 46 46 enum { 47 TEXTPATH_METHODTYPE_UNKNOWN = SVG _TEXTPATH_METHODTYPE_UNKNOWN,48 TEXTPATH_METHODTYPE_ALIGN = SVG _TEXTPATH_METHODTYPE_ALIGN,49 TEXTPATH_METHODTYPE_STRETCH = SVG _TEXTPATH_METHODTYPE_STRETCH,50 TEXTPATH_SPACINGTYPE_UNKNOWN = SVG _TEXTPATH_SPACINGTYPE_UNKNOWN,51 TEXTPATH_SPACINGTYPE_AUTO = SVG _TEXTPATH_SPACINGTYPE_AUTO,52 TEXTPATH_SPACINGTYPE_EXACT = SVG _TEXTPATH_SPACINGTYPE_EXACT47 TEXTPATH_METHODTYPE_UNKNOWN = SVGTextPathMethodUnknown, 48 TEXTPATH_METHODTYPE_ALIGN = SVGTextPathMethodAlign, 49 TEXTPATH_METHODTYPE_STRETCH = SVGTextPathMethodStretch, 50 TEXTPATH_SPACINGTYPE_UNKNOWN = SVGTextPathSpacingUnknown, 51 TEXTPATH_SPACINGTYPE_AUTO = SVGTextPathSpacingAuto, 52 TEXTPATH_SPACINGTYPE_EXACT = SVGTextPathSpacingExact 53 53 }; 54 54 … … 84 84 template<> 85 85 struct SVGPropertyTraits<SVGTextPathMethodType> { 86 static SVGTextPathMethodType highestEnumValue() { return SVG _TEXTPATH_METHODTYPE_STRETCH; }86 static SVGTextPathMethodType highestEnumValue() { return SVGTextPathMethodStretch; } 87 87 88 88 static String toString(SVGTextPathMethodType type) 89 89 { 90 90 switch (type) { 91 case SVG _TEXTPATH_METHODTYPE_UNKNOWN:91 case SVGTextPathMethodUnknown: 92 92 return emptyString(); 93 case SVG _TEXTPATH_METHODTYPE_ALIGN:93 case SVGTextPathMethodAlign: 94 94 return "align"; 95 case SVG _TEXTPATH_METHODTYPE_STRETCH:95 case SVGTextPathMethodStretch: 96 96 return "stretch"; 97 97 } … … 104 104 { 105 105 if (value == "align") 106 return SVG _TEXTPATH_METHODTYPE_ALIGN;106 return SVGTextPathMethodAlign; 107 107 if (value == "stretch") 108 return SVG _TEXTPATH_METHODTYPE_STRETCH;109 return SVG _TEXTPATH_METHODTYPE_UNKNOWN;108 return SVGTextPathMethodStretch; 109 return SVGTextPathMethodUnknown; 110 110 } 111 111 }; … … 113 113 template<> 114 114 struct SVGPropertyTraits<SVGTextPathSpacingType> { 115 static SVGTextPathSpacingType highestEnumValue() { return SVG _TEXTPATH_SPACINGTYPE_EXACT; }115 static SVGTextPathSpacingType highestEnumValue() { return SVGTextPathSpacingExact; } 116 116 117 117 static String toString(SVGTextPathSpacingType type) 118 118 { 119 119 switch (type) { 120 case SVG _TEXTPATH_SPACINGTYPE_UNKNOWN:120 case SVGTextPathSpacingUnknown: 121 121 return emptyString(); 122 case SVG _TEXTPATH_SPACINGTYPE_AUTO:122 case SVGTextPathSpacingAuto: 123 123 return "auto"; 124 case SVG _TEXTPATH_SPACINGTYPE_EXACT:124 case SVGTextPathSpacingExact: 125 125 return "exact"; 126 126 } … … 133 133 { 134 134 if (value == "auto") 135 return SVG _TEXTPATH_SPACINGTYPE_AUTO;135 return SVGTextPathSpacingAuto; 136 136 if (value == "exact") 137 return SVG _TEXTPATH_SPACINGTYPE_EXACT;138 return SVG _TEXTPATH_SPACINGTYPE_UNKNOWN;137 return SVGTextPathSpacingExact; 138 return SVGTextPathSpacingUnknown; 139 139 } 140 140 };
Note: See TracChangeset
for help on using the changeset viewer.