| 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 29 matching lines...) Expand all Loading... |
| 40 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGEllipseElement) | 40 BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGEllipseElement) |
| 41 REGISTER_LOCAL_ANIMATED_PROPERTY(cx) | 41 REGISTER_LOCAL_ANIMATED_PROPERTY(cx) |
| 42 REGISTER_LOCAL_ANIMATED_PROPERTY(cy) | 42 REGISTER_LOCAL_ANIMATED_PROPERTY(cy) |
| 43 REGISTER_LOCAL_ANIMATED_PROPERTY(rx) | 43 REGISTER_LOCAL_ANIMATED_PROPERTY(rx) |
| 44 REGISTER_LOCAL_ANIMATED_PROPERTY(ry) | 44 REGISTER_LOCAL_ANIMATED_PROPERTY(ry) |
| 45 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) | 45 REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired) |
| 46 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) | 46 REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement) |
| 47 END_REGISTER_ANIMATED_PROPERTIES | 47 END_REGISTER_ANIMATED_PROPERTIES |
| 48 | 48 |
| 49 inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Docume
nt& document) | 49 inline SVGEllipseElement::SVGEllipseElement(const QualifiedName& tagName, Docume
nt& document) |
| 50 : SVGGraphicsElement(tagName, document) | 50 : SVGGeometryElement(tagName, document) |
| 51 , m_cx(LengthModeWidth) | 51 , m_cx(LengthModeWidth) |
| 52 , m_cy(LengthModeHeight) | 52 , m_cy(LengthModeHeight) |
| 53 , m_rx(LengthModeWidth) | 53 , m_rx(LengthModeWidth) |
| 54 , m_ry(LengthModeHeight) | 54 , m_ry(LengthModeHeight) |
| 55 { | 55 { |
| 56 ASSERT(hasTagName(SVGNames::ellipseTag)); | 56 ASSERT(hasTagName(SVGNames::ellipseTag)); |
| 57 ScriptWrappable::init(this); | 57 ScriptWrappable::init(this); |
| 58 registerAnimatedPropertiesForSVGEllipseElement(); | 58 registerAnimatedPropertiesForSVGEllipseElement(); |
| 59 } | 59 } |
| 60 | 60 |
| (...skipping 14 matching lines...) Expand all Loading... |
| 75 supportedAttributes.add(SVGNames::ryAttr); | 75 supportedAttributes.add(SVGNames::ryAttr); |
| 76 } | 76 } |
| 77 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 77 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 78 } | 78 } |
| 79 | 79 |
| 80 void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) | 80 void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt
ring& value) |
| 81 { | 81 { |
| 82 SVGParsingError parseError = NoError; | 82 SVGParsingError parseError = NoError; |
| 83 | 83 |
| 84 if (!isSupportedAttribute(name)) | 84 if (!isSupportedAttribute(name)) |
| 85 SVGGraphicsElement::parseAttribute(name, value); | 85 SVGGeometryElement::parseAttribute(name, value); |
| 86 else if (name == SVGNames::cxAttr) | 86 else if (name == SVGNames::cxAttr) |
| 87 setCxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError))
; | 87 setCxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError))
; |
| 88 else if (name == SVGNames::cyAttr) | 88 else if (name == SVGNames::cyAttr) |
| 89 setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)
); | 89 setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError)
); |
| 90 else if (name == SVGNames::rxAttr) | 90 else if (name == SVGNames::rxAttr) |
| 91 setRxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError,
ForbidNegativeLengths)); | 91 setRxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError,
ForbidNegativeLengths)); |
| 92 else if (name == SVGNames::ryAttr) | 92 else if (name == SVGNames::ryAttr) |
| 93 setRyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError,
ForbidNegativeLengths)); | 93 setRyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError,
ForbidNegativeLengths)); |
| 94 else if (SVGLangSpace::parseAttribute(name, value) | 94 else if (SVGLangSpace::parseAttribute(name, value) |
| 95 || SVGExternalResourcesRequired::parseAttribute(name, value)) { | 95 || SVGExternalResourcesRequired::parseAttribute(name, value)) { |
| 96 } else | 96 } else |
| 97 ASSERT_NOT_REACHED(); | 97 ASSERT_NOT_REACHED(); |
| 98 | 98 |
| 99 reportAttributeParsingError(parseError, name, value); | 99 reportAttributeParsingError(parseError, name, value); |
| 100 } | 100 } |
| 101 | 101 |
| 102 void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) | 102 void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName) |
| 103 { | 103 { |
| 104 if (!isSupportedAttribute(attrName)) { | 104 if (!isSupportedAttribute(attrName)) { |
| 105 SVGGraphicsElement::svgAttributeChanged(attrName); | 105 SVGGeometryElement::svgAttributeChanged(attrName); |
| 106 return; | 106 return; |
| 107 } | 107 } |
| 108 | 108 |
| 109 SVGElementInstance::InvalidationGuard invalidationGuard(this); | 109 SVGElementInstance::InvalidationGuard invalidationGuard(this); |
| 110 | 110 |
| 111 bool isLengthAttribute = attrName == SVGNames::cxAttr | 111 bool isLengthAttribute = attrName == SVGNames::cxAttr |
| 112 || attrName == SVGNames::cyAttr | 112 || attrName == SVGNames::cyAttr |
| 113 || attrName == SVGNames::rxAttr | 113 || attrName == SVGNames::rxAttr |
| 114 || attrName == SVGNames::ryAttr; | 114 || attrName == SVGNames::ryAttr; |
| 115 | 115 |
| (...skipping 25 matching lines...) Expand all Loading... |
| 141 || rxCurrentValue().isRelative() | 141 || rxCurrentValue().isRelative() |
| 142 || ryCurrentValue().isRelative(); | 142 || ryCurrentValue().isRelative(); |
| 143 } | 143 } |
| 144 | 144 |
| 145 RenderObject* SVGEllipseElement::createRenderer(RenderStyle*) | 145 RenderObject* SVGEllipseElement::createRenderer(RenderStyle*) |
| 146 { | 146 { |
| 147 return new RenderSVGEllipse(this); | 147 return new RenderSVGEllipse(this); |
| 148 } | 148 } |
| 149 | 149 |
| 150 } | 150 } |
| OLD | NEW |