| 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 10 matching lines...) Expand all Loading... |
| 21 #include "config.h" | 21 #include "config.h" |
| 22 | 22 |
| 23 #include "core/svg/SVGCircleElement.h" | 23 #include "core/svg/SVGCircleElement.h" |
| 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/SVGLength.h" | 27 #include "core/svg/SVGLength.h" |
| 28 | 28 |
| 29 namespace WebCore { | 29 namespace WebCore { |
| 30 | 30 |
| 31 SVGCircleElement::SVGCircleElement(Document& document) | 31 inline SVGCircleElement::SVGCircleElement(Document& document) |
| 32 : SVGGeometryElement(SVGNames::circleTag, document) | 32 : SVGGeometryElement(SVGNames::circleTag, document) |
| 33 , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(L
engthModeWidth), AllowNegativeLengths)) | 33 , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(L
engthModeWidth), AllowNegativeLengths)) |
| 34 , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(L
engthModeHeight), AllowNegativeLengths)) | 34 , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(L
engthModeHeight), AllowNegativeLengths)) |
| 35 , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(Len
gthModeOther), ForbidNegativeLengths)) | 35 , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(Len
gthModeOther), ForbidNegativeLengths)) |
| 36 { | 36 { |
| 37 ScriptWrappable::init(this); | 37 ScriptWrappable::init(this); |
| 38 | 38 |
| 39 addToPropertyMap(m_cx); | 39 addToPropertyMap(m_cx); |
| 40 addToPropertyMap(m_cy); | 40 addToPropertyMap(m_cy); |
| 41 addToPropertyMap(m_r); | 41 addToPropertyMap(m_r); |
| 42 } | 42 } |
| 43 | 43 |
| 44 DEFINE_NODE_FACTORY(SVGCircleElement) |
| 45 |
| 44 bool SVGCircleElement::isSupportedAttribute(const QualifiedName& attrName) | 46 bool SVGCircleElement::isSupportedAttribute(const QualifiedName& attrName) |
| 45 { | 47 { |
| 46 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 48 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
| 47 if (supportedAttributes.isEmpty()) { | 49 if (supportedAttributes.isEmpty()) { |
| 48 supportedAttributes.add(SVGNames::cxAttr); | 50 supportedAttributes.add(SVGNames::cxAttr); |
| 49 supportedAttributes.add(SVGNames::cyAttr); | 51 supportedAttributes.add(SVGNames::cyAttr); |
| 50 supportedAttributes.add(SVGNames::rAttr); | 52 supportedAttributes.add(SVGNames::rAttr); |
| 51 } | 53 } |
| 52 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 54 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
| 53 } | 55 } |
| (...skipping 51 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
| 105 || m_cy->currentValue()->isRelative() | 107 || m_cy->currentValue()->isRelative() |
| 106 || m_r->currentValue()->isRelative(); | 108 || m_r->currentValue()->isRelative(); |
| 107 } | 109 } |
| 108 | 110 |
| 109 RenderObject* SVGCircleElement::createRenderer(RenderStyle*) | 111 RenderObject* SVGCircleElement::createRenderer(RenderStyle*) |
| 110 { | 112 { |
| 111 return new RenderSVGEllipse(this); | 113 return new RenderSVGEllipse(this); |
| 112 } | 114 } |
| 113 | 115 |
| 114 } | 116 } |
| OLD | NEW |