| 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 13 matching lines...) Expand all Loading... |
| 24 | 24 |
| 25 #include "core/rendering/svg/RenderSVGEllipse.h" | 25 #include "core/rendering/svg/RenderSVGEllipse.h" |
| 26 #include "core/rendering/svg/RenderSVGResource.h" | 26 #include "core/rendering/svg/RenderSVGResource.h" |
| 27 #include "core/svg/SVGElementInstance.h" | 27 #include "core/svg/SVGElementInstance.h" |
| 28 #include "core/svg/SVGLength.h" | 28 #include "core/svg/SVGLength.h" |
| 29 | 29 |
| 30 namespace WebCore { | 30 namespace WebCore { |
| 31 | 31 |
| 32 inline SVGCircleElement::SVGCircleElement(Document& document) | 32 inline SVGCircleElement::SVGCircleElement(Document& document) |
| 33 : SVGGeometryElement(SVGNames::circleTag, document) | 33 : SVGGeometryElement(SVGNames::circleTag, document) |
| 34 , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(L
engthModeWidth))) | 34 , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(L
engthModeWidth), AllowNegativeLengths)) |
| 35 , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(L
engthModeHeight))) | 35 , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(L
engthModeHeight), AllowNegativeLengths)) |
| 36 , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(Len
gthModeOther))) | 36 , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(Len
gthModeOther), ForbidNegativeLengths)) |
| 37 { | 37 { |
| 38 ScriptWrappable::init(this); | 38 ScriptWrappable::init(this); |
| 39 | 39 |
| 40 addToPropertyMap(m_cx); | 40 addToPropertyMap(m_cx); |
| 41 addToPropertyMap(m_cy); | 41 addToPropertyMap(m_cy); |
| 42 addToPropertyMap(m_r); | 42 addToPropertyMap(m_r); |
| 43 } | 43 } |
| 44 | 44 |
| 45 PassRefPtr<SVGCircleElement> SVGCircleElement::create(Document& document) | 45 PassRefPtr<SVGCircleElement> SVGCircleElement::create(Document& document) |
| 46 { | 46 { |
| (...skipping 11 matching lines...) Expand all Loading... |
| 58 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 58 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 59 } | 59 } |
| 60 | 60 |
| 61 void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) | 61 void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr
ing& value) |
| 62 { | 62 { |
| 63 SVGParsingError parseError = NoError; | 63 SVGParsingError parseError = NoError; |
| 64 | 64 |
| 65 if (!isSupportedAttribute(name)) | 65 if (!isSupportedAttribute(name)) |
| 66 SVGGeometryElement::parseAttribute(name, value); | 66 SVGGeometryElement::parseAttribute(name, value); |
| 67 else if (name == SVGNames::cxAttr) | 67 else if (name == SVGNames::cxAttr) |
| 68 m_cx->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 68 m_cx->setBaseValueAsString(value, parseError); |
| 69 else if (name == SVGNames::cyAttr) | 69 else if (name == SVGNames::cyAttr) |
| 70 m_cy->setBaseValueAsString(value, AllowNegativeLengths, parseError); | 70 m_cy->setBaseValueAsString(value, parseError); |
| 71 else if (name == SVGNames::rAttr) | 71 else if (name == SVGNames::rAttr) |
| 72 m_r->setBaseValueAsString(value, ForbidNegativeLengths, parseError); | 72 m_r->setBaseValueAsString(value, parseError); |
| 73 else | 73 else |
| 74 ASSERT_NOT_REACHED(); | 74 ASSERT_NOT_REACHED(); |
| 75 | 75 |
| 76 reportAttributeParsingError(parseError, name, value); | 76 reportAttributeParsingError(parseError, name, value); |
| 77 } | 77 } |
| 78 | 78 |
| 79 void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) | 79 void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName) |
| 80 { | 80 { |
| 81 if (!isSupportedAttribute(attrName)) { | 81 if (!isSupportedAttribute(attrName)) { |
| 82 SVGGeometryElement::svgAttributeChanged(attrName); | 82 SVGGeometryElement::svgAttributeChanged(attrName); |
| (...skipping 28 matching lines...) Expand all Loading... |
| 111 || m_cy->currentValue()->isRelative() | 111 || m_cy->currentValue()->isRelative() |
| 112 || m_r->currentValue()->isRelative(); | 112 || m_r->currentValue()->isRelative(); |
| 113 } | 113 } |
| 114 | 114 |
| 115 RenderObject* SVGCircleElement::createRenderer(RenderStyle*) | 115 RenderObject* SVGCircleElement::createRenderer(RenderStyle*) |
| 116 { | 116 { |
| 117 return new RenderSVGEllipse(this); | 117 return new RenderSVGEllipse(this); |
| 118 } | 118 } |
| 119 | 119 |
| 120 } | 120 } |
| OLD | NEW |