| OLD | NEW |
| 1 /* | 1 /* |
| 2 * Copyright (C) 2004, 2005, 2006, 2008 Nikolas Zimmermann <zimmermann@kde.org> | 2 * Copyright (C) 2004, 2005, 2006, 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 * | 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 27 matching lines...) Expand all Loading... |
| 38 | 38 |
| 39 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCircleElement) | 39 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCircleElement) |
| 40 REGISTER_LOCAL_ANIMATED_PROPERTY(cx) | 40 REGISTER_LOCAL_ANIMATED_PROPERTY(cx) |
| 41 REGISTER_LOCAL_ANIMATED_PROPERTY(cy) | 41 REGISTER_LOCAL_ANIMATED_PROPERTY(cy) |
| 42 REGISTER_LOCAL_ANIMATED_PROPERTY(r) | 42 REGISTER_LOCAL_ANIMATED_PROPERTY(r) |
| 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 43 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
| 44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) | 44 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
| 45 END_REGISTER_ANIMATED_PROPERTIES | 45 END_REGISTER_ANIMATED_PROPERTIES |
| 46 | 46 |
| 47 inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document
& document) | 47 inline SVGCircleElement::SVGCircleElement(const QualifiedName& tagName, Document
& document) |
| 48 : SVGGraphicsElement(tagName, document) | 48 : SVGGeometryElement(tagName, document) |
| 49 , m_cx(LengthModeWidth) | 49 , m_cx(LengthModeWidth) |
| 50 , m_cy(LengthModeHeight) | 50 , m_cy(LengthModeHeight) |
| 51 , m_r(LengthModeOther) | 51 , m_r(LengthModeOther) |
| 52 { | 52 { |
| 53 ASSERT(hasTagName(SVGNames::circleTag)); | 53 ASSERT(hasTagName(SVGNames::circleTag)); |
| 54 ScriptWrappable::init(this); | 54 ScriptWrappable::init(this); |
| 55 registerAnimatedPropertiesForSVGCircleElement(); | 55 registerAnimatedPropertiesForSVGCircleElement(); |
| 56 } | 56 } |
| 57 | 57 |
| 58 PassRefPtr<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagNa
me, Document& document) | 58 PassRefPtr<SVGCircleElement> SVGCircleElement::create(const QualifiedName& tagNa
me, Document& document) |
| (...skipping 12 matching lines...) Expand all Loading... |
| 71 supportedAttributes.add(SVGNames::rAttr); | 71 supportedAttributes.add(SVGNames::rAttr); |
| 72 } | 72 } |
| 73 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 73 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 74 } | 74 } |
| 75 | 75 |
| 76 void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 76 void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
| 77 { | 77 { |
| 78 SVGParsingError parseError = NoError; | 78 SVGParsingError parseError = NoError; |
| 79 | 79 |
| 80 if (!isSupportedAttribute(name)) | 80 if (!isSupportedAttribute(name)) |
| 81 SVGGraphicsElement::parseAttribute(name, value); | 81 SVGGeometryElement::parseAttribute(name, value); |
| 82 else if (name == SVGNames::cxAttr) | 82 else if (name == SVGNames::cxAttr) |
| 83 setCxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError))
; | 83 setCxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError))
; |
| 84 else if (name == SVGNames::cyAttr) | 84 else if (name == SVGNames::cyAttr) |
| 85 setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)
); | 85 setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)
); |
| 86 else if (name == SVGNames::rAttr) | 86 else if (name == SVGNames::rAttr) |
| 87 setRBaseValue(SVGLength::construct(LengthModeOther, value, parseError, F
orbidNegativeLengths)); | 87 setRBaseValue(SVGLength::construct(LengthModeOther, value, parseError, F
orbidNegativeLengths)); |
| 88 else if (SVGLangSpace::parseAttribute(name, value) | 88 else if (SVGLangSpace::parseAttribute(name, value) |
| 89 || SVGExternalResourcesRequired::parseAttribute(name, value)) { | 89 || SVGExternalResourcesRequired::parseAttribute(name, value)) { |
| 90 } else | 90 } else |
| 91 ASSERT_NOT_REACHED(); | 91 ASSERT_NOT_REACHED(); |
| 92 | 92 |
| 93 reportAttributeParsingError(parseError, name, value); | 93 reportAttributeParsingError(parseError, name, value); |
| 94 } | 94 } |
| 95 | 95 |
| 96 void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) | 96 void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) |
| 97 { | 97 { |
| 98 if (!isSupportedAttribute(attrName)) { | 98 if (!isSupportedAttribute(attrName)) { |
| 99 SVGGraphicsElement::svgAttributeChanged(attrName); | 99 SVGGeometryElement::svgAttributeChanged(attrName); |
| 100 return; | 100 return; |
| 101 } | 101 } |
| 102 | 102 |
| 103 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 103 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
| 104 | 104 |
| 105 bool isLengthAttribute = attrName == SVGNames::cxAttr | 105 bool isLengthAttribute = attrName == SVGNames::cxAttr |
| 106 || attrName == SVGNames::cyAttr | 106 || attrName == SVGNames::cyAttr |
| 107 || attrName == SVGNames::rAttr; | 107 || attrName == SVGNames::rAttr; |
| 108 | 108 |
| 109 if (isLengthAttribute) | 109 if (isLengthAttribute) |
| (...skipping 23 matching lines...) Expand all Loading... |
| 133 || cyCurrentValue().isRelative() | 133 || cyCurrentValue().isRelative() |
| 134 || rCurrentValue().isRelative(); | 134 || rCurrentValue().isRelative(); |
| 135 } | 135 } |
| 136 | 136 |
| 137 RenderObject* SVGCircleElement::createRenderer(RenderStyle*) | 137 RenderObject* SVGCircleElement::createRenderer(RenderStyle*) |
| 138 { | 138 { |
| 139 return new RenderSVGEllipse(this); | 139 return new RenderSVGEllipse(this); |
| 140 } | 140 } |
| 141 | 141 |
| 142 } | 142 } |
| OLD | NEW |