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 12 matching lines...) Expand all Loading... |
23 #include "core/dom/StyleChangeReason.h" | 23 #include "core/dom/StyleChangeReason.h" |
24 #include "core/layout/svg/LayoutSVGEllipse.h" | 24 #include "core/layout/svg/LayoutSVGEllipse.h" |
25 #include "core/svg/SVGLength.h" | 25 #include "core/svg/SVGLength.h" |
26 | 26 |
27 namespace blink { | 27 namespace blink { |
28 | 28 |
29 inline SVGCircleElement::SVGCircleElement(Document& document) | 29 inline SVGCircleElement::SVGCircleElement(Document& document) |
30 : SVGGeometryElement(SVGNames::circleTag, document), | 30 : SVGGeometryElement(SVGNames::circleTag, document), |
31 m_cx(SVGAnimatedLength::create(this, | 31 m_cx(SVGAnimatedLength::create(this, |
32 SVGNames::cxAttr, | 32 SVGNames::cxAttr, |
33 SVGLength::create(SVGLengthMode::Width))), | 33 SVGLength::create(SVGLengthMode::Width), |
| 34 CSSPropertyCx)), |
34 m_cy(SVGAnimatedLength::create(this, | 35 m_cy(SVGAnimatedLength::create(this, |
35 SVGNames::cyAttr, | 36 SVGNames::cyAttr, |
36 SVGLength::create(SVGLengthMode::Height))), | 37 SVGLength::create(SVGLengthMode::Height), |
| 38 CSSPropertyCy)), |
37 m_r(SVGAnimatedLength::create(this, | 39 m_r(SVGAnimatedLength::create(this, |
38 SVGNames::rAttr, | 40 SVGNames::rAttr, |
39 SVGLength::create(SVGLengthMode::Other))) { | 41 SVGLength::create(SVGLengthMode::Other), |
| 42 CSSPropertyR)) { |
40 addToPropertyMap(m_cx); | 43 addToPropertyMap(m_cx); |
41 addToPropertyMap(m_cy); | 44 addToPropertyMap(m_cy); |
42 addToPropertyMap(m_r); | 45 addToPropertyMap(m_r); |
43 } | 46 } |
44 | 47 |
45 DEFINE_TRACE(SVGCircleElement) { | 48 DEFINE_TRACE(SVGCircleElement) { |
46 visitor->trace(m_cx); | 49 visitor->trace(m_cx); |
47 visitor->trace(m_cy); | 50 visitor->trace(m_cy); |
48 visitor->trace(m_r); | 51 visitor->trace(m_r); |
49 SVGGeometryElement::trace(visitor); | 52 SVGGeometryElement::trace(visitor); |
(...skipping 17 matching lines...) Expand all Loading... |
67 r, | 70 r, |
68 lengthContext.valueForLength( | 71 lengthContext.valueForLength( |
69 svgStyle.cy(), style, SVGLengthMode::Height) - | 72 svgStyle.cy(), style, SVGLengthMode::Height) - |
70 r, | 73 r, |
71 r * 2, r * 2)); | 74 r * 2, r * 2)); |
72 } | 75 } |
73 | 76 |
74 return path; | 77 return path; |
75 } | 78 } |
76 | 79 |
77 bool SVGCircleElement::isPresentationAttribute( | |
78 const QualifiedName& attrName) const { | |
79 if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr || | |
80 attrName == SVGNames::rAttr) | |
81 return true; | |
82 return SVGGeometryElement::isPresentationAttribute(attrName); | |
83 } | |
84 | |
85 bool SVGCircleElement::isPresentationAttributeWithSVGDOM( | |
86 const QualifiedName& attrName) const { | |
87 if (attrName == SVGNames::cxAttr || attrName == SVGNames::cyAttr || | |
88 attrName == SVGNames::rAttr) | |
89 return true; | |
90 return SVGGeometryElement::isPresentationAttributeWithSVGDOM(attrName); | |
91 } | |
92 | |
93 void SVGCircleElement::collectStyleForPresentationAttribute( | 80 void SVGCircleElement::collectStyleForPresentationAttribute( |
94 const QualifiedName& name, | 81 const QualifiedName& name, |
95 const AtomicString& value, | 82 const AtomicString& value, |
96 MutableStylePropertySet* style) { | 83 MutableStylePropertySet* style) { |
97 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); | 84 SVGAnimatedPropertyBase* property = propertyFromAttribute(name); |
98 if (property == m_cx) | 85 if (property == m_cx) |
99 addPropertyToPresentationAttributeStyle( | 86 addPropertyToPresentationAttributeStyle( |
100 style, CSSPropertyCx, m_cx->currentValue()->asCSSPrimitiveValue()); | 87 style, CSSPropertyCx, m_cx->currentValue()->asCSSPrimitiveValue()); |
101 else if (property == m_cy) | 88 else if (property == m_cy) |
102 addPropertyToPresentationAttributeStyle( | 89 addPropertyToPresentationAttributeStyle( |
(...skipping 32 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
135 return m_cx->currentValue()->isRelative() || | 122 return m_cx->currentValue()->isRelative() || |
136 m_cy->currentValue()->isRelative() || | 123 m_cy->currentValue()->isRelative() || |
137 m_r->currentValue()->isRelative(); | 124 m_r->currentValue()->isRelative(); |
138 } | 125 } |
139 | 126 |
140 LayoutObject* SVGCircleElement::createLayoutObject(const ComputedStyle&) { | 127 LayoutObject* SVGCircleElement::createLayoutObject(const ComputedStyle&) { |
141 return new LayoutSVGEllipse(this); | 128 return new LayoutSVGEllipse(this); |
142 } | 129 } |
143 | 130 |
144 } // namespace blink | 131 } // namespace blink |
OLD | NEW |