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/SVGEllipseElement.h" | 23 #include "core/svg/SVGEllipseElement.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 SVGEllipseElement::SVGEllipseElement(Document& document) | 31 inline SVGEllipseElement::SVGEllipseElement(Document& document) |
32 : SVGGeometryElement(SVGNames::ellipseTag, document) | 32 : SVGGeometryElement(SVGNames::ellipseTag, 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_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(L
engthModeWidth), ForbidNegativeLengths)) | 35 , m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(L
engthModeWidth), ForbidNegativeLengths)) |
36 , m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(L
engthModeHeight), ForbidNegativeLengths)) | 36 , m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(L
engthModeHeight), 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_rx); | 42 addToPropertyMap(m_rx); |
43 addToPropertyMap(m_ry); | 43 addToPropertyMap(m_ry); |
44 } | 44 } |
45 | 45 |
| 46 DEFINE_NODE_FACTORY(SVGEllipseElement) |
| 47 |
46 bool SVGEllipseElement::isSupportedAttribute(const QualifiedName& attrName) | 48 bool SVGEllipseElement::isSupportedAttribute(const QualifiedName& attrName) |
47 { | 49 { |
48 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); | 50 DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); |
49 if (supportedAttributes.isEmpty()) { | 51 if (supportedAttributes.isEmpty()) { |
50 supportedAttributes.add(SVGNames::cxAttr); | 52 supportedAttributes.add(SVGNames::cxAttr); |
51 supportedAttributes.add(SVGNames::cyAttr); | 53 supportedAttributes.add(SVGNames::cyAttr); |
52 supportedAttributes.add(SVGNames::rxAttr); | 54 supportedAttributes.add(SVGNames::rxAttr); |
53 supportedAttributes.add(SVGNames::ryAttr); | 55 supportedAttributes.add(SVGNames::ryAttr); |
54 } | 56 } |
55 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); | 57 return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); |
(...skipping 56 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
112 || m_rx->currentValue()->isRelative() | 114 || m_rx->currentValue()->isRelative() |
113 || m_ry->currentValue()->isRelative(); | 115 || m_ry->currentValue()->isRelative(); |
114 } | 116 } |
115 | 117 |
116 RenderObject* SVGEllipseElement::createRenderer(RenderStyle*) | 118 RenderObject* SVGEllipseElement::createRenderer(RenderStyle*) |
117 { | 119 { |
118 return new RenderSVGEllipse(this); | 120 return new RenderSVGEllipse(this); |
119 } | 121 } |
120 | 122 |
121 } | 123 } |
OLD | NEW |