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

Unified Diff: Source/core/svg/SVGTextPathElement.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/SVGTextPathElement.cpp
diff --git a/Source/core/svg/SVGTextPathElement.cpp b/Source/core/svg/SVGTextPathElement.cpp
index b3f2e1b1fb4298ffa56bb88e1e4f995453e4de34..b17691bbe57c07244a061a5dda89ad86f50f2085 100644
--- a/Source/core/svg/SVGTextPathElement.cpp
+++ b/Source/core/svg/SVGTextPathElement.cpp
@@ -30,13 +30,11 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_LENGTH(SVGTextPathElement, SVGNames::startOffsetAttr, StartOffset, startOffset)
DEFINE_ANIMATED_ENUMERATION(SVGTextPathElement, SVGNames::methodAttr, Method, method, SVGTextPathMethodType)
DEFINE_ANIMATED_ENUMERATION(SVGTextPathElement, SVGNames::spacingAttr, Spacing, spacing, SVGTextPathSpacingType)
DEFINE_ANIMATED_STRING(SVGTextPathElement, XLinkNames::hrefAttr, Href, href)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextPathElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(startOffset)
REGISTER_LOCAL_ANIMATED_PROPERTY(method)
REGISTER_LOCAL_ANIMATED_PROPERTY(spacing)
REGISTER_LOCAL_ANIMATED_PROPERTY(href)
@@ -45,11 +43,13 @@ END_REGISTER_ANIMATED_PROPERTIES
inline SVGTextPathElement::SVGTextPathElement(Document& document)
: SVGTextContentElement(SVGNames::textPathTag, document)
- , m_startOffset(LengthModeOther)
+ , m_startOffset(SVGAnimatedLength::create(this, SVGNames::startOffsetAttr, SVGLength::create(LengthModeOther)))
, m_method(SVGTextPathMethodAlign)
, m_spacing(SVGTextPathSpacingExact)
{
ScriptWrappable::init(this);
+
+ addToPropertyMap(m_startOffset);
registerAnimatedPropertiesForSVGTextPathElement();
}
@@ -87,7 +87,7 @@ void SVGTextPathElement::parseAttribute(const QualifiedName& name, const AtomicS
if (!isSupportedAttribute(name))
SVGTextContentElement::parseAttribute(name, value);
else if (name == SVGNames::startOffsetAttr)
- setStartOffsetBaseValue(SVGLength::construct(LengthModeOther, value, parseError));
+ m_startOffset->setBaseValueAsString(value, AllowNegativeLengths, parseError);
else if (name == SVGNames::methodAttr) {
SVGTextPathMethodType propertyValue = SVGPropertyTraits<SVGTextPathMethodType>::fromString(value);
if (propertyValue > 0)
@@ -189,7 +189,7 @@ void SVGTextPathElement::removedFrom(ContainerNode* rootParent)
bool SVGTextPathElement::selfHasRelativeLengths() const
{
- return startOffsetCurrentValue().isRelative()
+ return m_startOffset->currentValue()->isRelative()
|| SVGTextContentElement::selfHasRelativeLengths();
}

Powered by Google App Engine
This is Rietveld 408576698