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

Unified Diff: Source/core/svg/SVGCursorElement.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/SVGCursorElement.cpp
diff --git a/Source/core/svg/SVGCursorElement.cpp b/Source/core/svg/SVGCursorElement.cpp
index 5473a2f30847212267e137aa89b1def6e3d4343b..4bfacd6d38a453bf675dabbe3a248bae015faae6 100644
--- a/Source/core/svg/SVGCursorElement.cpp
+++ b/Source/core/svg/SVGCursorElement.cpp
@@ -30,14 +30,10 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::xAttr, X, x)
-DEFINE_ANIMATED_LENGTH(SVGCursorElement, SVGNames::yAttr, Y, y)
DEFINE_ANIMATED_STRING(SVGCursorElement, XLinkNames::hrefAttr, Href, href)
DEFINE_ANIMATED_BOOLEAN(SVGCursorElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGCursorElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(x)
- REGISTER_LOCAL_ANIMATED_PROPERTY(y)
REGISTER_LOCAL_ANIMATED_PROPERTY(href)
REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTests)
@@ -45,10 +41,13 @@ END_REGISTER_ANIMATED_PROPERTIES
inline SVGCursorElement::SVGCursorElement(Document& document)
: SVGElement(SVGNames::cursorTag, document)
- , m_x(LengthModeWidth)
- , m_y(LengthModeHeight)
+ , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth)))
+ , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight)))
{
ScriptWrappable::init(this);
+
+ addToPropertyMap(m_x);
+ addToPropertyMap(m_y);
registerAnimatedPropertiesForSVGCursorElement();
}
@@ -84,9 +83,9 @@ void SVGCursorElement::parseAttribute(const QualifiedName& name, const AtomicStr
if (!isSupportedAttribute(name))
SVGElement::parseAttribute(name, value);
else if (name == SVGNames::xAttr)
- setXBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
+ m_x->setBaseValueAsString(value, AllowNegativeLengths, parseError);
else if (name == SVGNames::yAttr)
- setYBaseValue(SVGLength::construct(LengthModeHeight, value, parseError));
+ m_y->setBaseValueAsString(value, AllowNegativeLengths, parseError);
else if (SVGTests::parseAttribute(name, value)
|| SVGExternalResourcesRequired::parseAttribute(name, value)
|| SVGURIReference::parseAttribute(name, value)) {

Powered by Google App Engine
This is Rietveld 408576698