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

Unified Diff: Source/core/svg/SVGTextPositioningElement.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/SVGTextPositioningElement.h ('k') | Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGTextPositioningElement.cpp
diff --git a/Source/core/svg/SVGTextPositioningElement.cpp b/Source/core/svg/SVGTextPositioningElement.cpp
index 664ba23a5a977c2883a1078814a4655c286afd3b..f54fc7fecc34b3acb2ecf91314b88a13de1ea125 100644
--- a/Source/core/svg/SVGTextPositioningElement.cpp
+++ b/Source/core/svg/SVGTextPositioningElement.cpp
@@ -32,25 +32,26 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::xAttr, X, x)
-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::yAttr, Y, y)
-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::dxAttr, Dx, dx)
-DEFINE_ANIMATED_LENGTH_LIST(SVGTextPositioningElement, SVGNames::dyAttr, Dy, dy)
DEFINE_ANIMATED_NUMBER_LIST(SVGTextPositioningElement, SVGNames::rotateAttr, Rotate, rotate)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGTextPositioningElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(x)
- REGISTER_LOCAL_ANIMATED_PROPERTY(y)
- REGISTER_LOCAL_ANIMATED_PROPERTY(dx)
- REGISTER_LOCAL_ANIMATED_PROPERTY(dy)
REGISTER_LOCAL_ANIMATED_PROPERTY(rotate)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGTextContentElement)
END_REGISTER_ANIMATED_PROPERTIES
SVGTextPositioningElement::SVGTextPositioningElement(const QualifiedName& tagName, Document& document)
: SVGTextContentElement(tagName, document)
+ , m_x(SVGAnimatedLengthList::create(this, SVGNames::xAttr, SVGLengthList::create(LengthModeWidth)))
+ , m_y(SVGAnimatedLengthList::create(this, SVGNames::yAttr, SVGLengthList::create(LengthModeHeight)))
+ , m_dx(SVGAnimatedLengthList::create(this, SVGNames::dxAttr, SVGLengthList::create(LengthModeWidth)))
+ , m_dy(SVGAnimatedLengthList::create(this, SVGNames::dyAttr, SVGLengthList::create(LengthModeHeight)))
{
ScriptWrappable::init(this);
+
+ addToPropertyMap(m_x);
+ addToPropertyMap(m_y);
+ addToPropertyMap(m_dx);
+ addToPropertyMap(m_dy);
registerAnimatedPropertiesForSVGTextPositioningElement();
}
@@ -74,47 +75,27 @@ void SVGTextPositioningElement::parseAttribute(const QualifiedName& name, const
return;
}
- if (name == SVGNames::xAttr) {
- SVGLengthList newList;
- newList.parse(value, LengthModeWidth);
- detachAnimatedXListWrappers(newList.size());
- setXBaseValue(newList);
- return;
- }
-
- if (name == SVGNames::yAttr) {
- SVGLengthList newList;
- newList.parse(value, LengthModeHeight);
- detachAnimatedYListWrappers(newList.size());
- setYBaseValue(newList);
- return;
- }
+ SVGParsingError parseError = NoError;
- if (name == SVGNames::dxAttr) {
- SVGLengthList newList;
- newList.parse(value, LengthModeWidth);
- detachAnimatedDxListWrappers(newList.size());
- setDxBaseValue(newList);
- return;
- }
-
- if (name == SVGNames::dyAttr) {
- SVGLengthList newList;
- newList.parse(value, LengthModeHeight);
- detachAnimatedDyListWrappers(newList.size());
- setDyBaseValue(newList);
- return;
- }
-
- if (name == SVGNames::rotateAttr) {
+ if (name == SVGNames::xAttr) {
+ m_x->setBaseValueAsString(value, parseError);
+ } else if (name == SVGNames::yAttr) {
+ m_y->setBaseValueAsString(value, parseError);
+ } else if (name == SVGNames::dxAttr) {
+ m_dx->setBaseValueAsString(value, parseError);
+ } else if (name == SVGNames::dyAttr) {
+ m_dy->setBaseValueAsString(value, parseError);
+ } else if (name == SVGNames::rotateAttr) {
SVGNumberList newList;
newList.parse(value);
detachAnimatedRotateListWrappers(newList.size());
setRotateBaseValue(newList);
return;
+ } else {
+ ASSERT_NOT_REACHED();
}
- ASSERT_NOT_REACHED();
+ reportAttributeParsingError(parseError, name, value);
}
void SVGTextPositioningElement::svgAttributeChanged(const QualifiedName& attrName)
« no previous file with comments | « Source/core/svg/SVGTextPositioningElement.h ('k') | Source/core/svg/SVGUseElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698