Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(72)

Unified Diff: Source/core/svg/SVGCircleElement.cpp

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: revert aggressive svgAttributeChanged, add NeedsRebaseline Created 6 years, 11 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « Source/core/svg/SVGCircleElement.h ('k') | Source/core/svg/SVGCursorElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGCircleElement.cpp
diff --git a/Source/core/svg/SVGCircleElement.cpp b/Source/core/svg/SVGCircleElement.cpp
index 93a899cc557a205110d1f4fd7cec8370a1d1f251..10bb166daf8b2ac11bae6728f026c6d47449d620 100644
--- a/Source/core/svg/SVGCircleElement.cpp
+++ b/Source/core/svg/SVGCircleElement.cpp
@@ -30,24 +30,21 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_LENGTH(SVGCircleElement, SVGNames::cxAttr, Cx, cx)
-DEFINE_ANIMATED_LENGTH(SVGCircleElement, SVGNames::cyAttr, Cy, cy)
-DEFINE_ANIMATED_LENGTH(SVGCircleElement, SVGNames::rAttr, R, r)
-
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCircleElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
- REGISTER_LOCAL_ANIMATED_PROPERTY(cy)
- REGISTER_LOCAL_ANIMATED_PROPERTY(r)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGCircleElement::SVGCircleElement(Document& document)
: SVGGeometryElement(SVGNames::circleTag, document)
- , m_cx(LengthModeWidth)
- , m_cy(LengthModeHeight)
- , m_r(LengthModeOther)
+ , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth)))
+ , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight)))
+ , m_r(SVGAnimatedLength::create(this, SVGNames::rAttr, SVGLength::create(LengthModeOther)))
{
ScriptWrappable::init(this);
+
+ addToPropertyMap(m_cx);
+ addToPropertyMap(m_cy);
+ addToPropertyMap(m_r);
registerAnimatedPropertiesForSVGCircleElement();
}
@@ -74,11 +71,11 @@ void SVGCircleElement::parseAttribute(const QualifiedName& name, const AtomicStr
if (!isSupportedAttribute(name))
SVGGeometryElement::parseAttribute(name, value);
else if (name == SVGNames::cxAttr)
- setCxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
+ m_cx->setBaseValueAsString(value, AllowNegativeLengths, parseError);
else if (name == SVGNames::cyAttr)
- setCyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError));
+ m_cy->setBaseValueAsString(value, AllowNegativeLengths, parseError);
else if (name == SVGNames::rAttr)
- setRBaseValue(SVGLength::construct(LengthModeOther, value, parseError, ForbidNegativeLengths));
+ m_r->setBaseValueAsString(value, ForbidNegativeLengths, parseError);
else
ASSERT_NOT_REACHED();
@@ -116,9 +113,9 @@ void SVGCircleElement::svgAttributeChanged(const QualifiedName& attrName)
bool SVGCircleElement::selfHasRelativeLengths() const
{
- return cxCurrentValue().isRelative()
- || cyCurrentValue().isRelative()
- || rCurrentValue().isRelative();
+ return m_cx->currentValue()->isRelative()
+ || m_cy->currentValue()->isRelative()
+ || m_r->currentValue()->isRelative();
}
RenderObject* SVGCircleElement::createRenderer(RenderStyle*)
« no previous file with comments | « Source/core/svg/SVGCircleElement.h ('k') | Source/core/svg/SVGCursorElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698