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

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

Issue 112003003: [SVG] SVGLength{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: rebaselined Created 7 years 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
Index: Source/core/svg/SVGEllipseElement.cpp
diff --git a/Source/core/svg/SVGEllipseElement.cpp b/Source/core/svg/SVGEllipseElement.cpp
index b0e4aeda679e8f7c036459811eadc23a013e58fd..cd98babe9e867b2dc7fdfd95e78609357d4a5de3 100644
--- a/Source/core/svg/SVGEllipseElement.cpp
+++ b/Source/core/svg/SVGEllipseElement.cpp
@@ -30,29 +30,26 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_LENGTH(SVGEllipseElement, SVGNames::cxAttr, Cx, cx)
-DEFINE_ANIMATED_LENGTH(SVGEllipseElement, SVGNames::cyAttr, Cy, cy)
-DEFINE_ANIMATED_LENGTH(SVGEllipseElement, SVGNames::rxAttr, Rx, rx)
-DEFINE_ANIMATED_LENGTH(SVGEllipseElement, SVGNames::ryAttr, Ry, ry)
DEFINE_ANIMATED_BOOLEAN(SVGEllipseElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGEllipseElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(cx)
- REGISTER_LOCAL_ANIMATED_PROPERTY(cy)
- REGISTER_LOCAL_ANIMATED_PROPERTY(rx)
- REGISTER_LOCAL_ANIMATED_PROPERTY(ry)
REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGEllipseElement::SVGEllipseElement(Document& document)
: SVGGeometryElement(SVGNames::ellipseTag, document)
- , m_cx(LengthModeWidth)
- , m_cy(LengthModeHeight)
- , m_rx(LengthModeWidth)
- , m_ry(LengthModeHeight)
+ , m_cx(SVGAnimatedLength::create(this, SVGNames::cxAttr, SVGLength::create(LengthModeWidth)))
+ , m_cy(SVGAnimatedLength::create(this, SVGNames::cyAttr, SVGLength::create(LengthModeHeight)))
+ , m_rx(SVGAnimatedLength::create(this, SVGNames::rxAttr, SVGLength::create(LengthModeWidth)))
+ , m_ry(SVGAnimatedLength::create(this, SVGNames::ryAttr, SVGLength::create(LengthModeHeight)))
{
ScriptWrappable::init(this);
+
+ addToPropertyMap(m_cx);
+ addToPropertyMap(m_cy);
+ addToPropertyMap(m_rx);
+ addToPropertyMap(m_ry);
registerAnimatedPropertiesForSVGEllipseElement();
}
@@ -81,13 +78,13 @@ void SVGEllipseElement::parseAttribute(const QualifiedName& name, const AtomicSt
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::rxAttr)
- setRxBaseValue(SVGLength::construct(LengthModeWidth, value, parseError, ForbidNegativeLengths));
+ m_rx->setBaseValueAsString(value, ForbidNegativeLengths, parseError);
else if (name == SVGNames::ryAttr)
- setRyBaseValue(SVGLength::construct(LengthModeHeight, value, parseError, ForbidNegativeLengths));
+ m_ry->setBaseValueAsString(value, ForbidNegativeLengths, parseError);
else if (SVGExternalResourcesRequired::parseAttribute(name, value)) {
} else
ASSERT_NOT_REACHED();
@@ -132,10 +129,10 @@ void SVGEllipseElement::svgAttributeChanged(const QualifiedName& attrName)
bool SVGEllipseElement::selfHasRelativeLengths() const
{
- return cxCurrentValue().isRelative()
- || cyCurrentValue().isRelative()
- || rxCurrentValue().isRelative()
- || ryCurrentValue().isRelative();
+ return m_cx->currentValue()->isRelative()
+ || m_cy->currentValue()->isRelative()
+ || m_rx->currentValue()->isRelative()
+ || m_ry->currentValue()->isRelative();
}
RenderObject* SVGEllipseElement::createRenderer(RenderStyle*)

Powered by Google App Engine
This is Rietveld 408576698