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

Unified Diff: Source/core/svg/SVGFilterPrimitiveStandardAttributes.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/SVGFilterPrimitiveStandardAttributes.h ('k') | Source/core/svg/SVGForeignObjectElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
diff --git a/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp b/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
index cb25ed470d9235feb8ca107dcffc9b94f0369da2..b41bba04ade5b7ae20207ec296c6e3ce7fb32560 100644
--- a/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
+++ b/Source/core/svg/SVGFilterPrimitiveStandardAttributes.cpp
@@ -32,30 +32,32 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiveStandardAttributes, SVGNames::xAttr, X, x)
-DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiveStandardAttributes, SVGNames::yAttr, Y, y)
-DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiveStandardAttributes, SVGNames::widthAttr, Width, width)
-DEFINE_ANIMATED_LENGTH(SVGFilterPrimitiveStandardAttributes, SVGNames::heightAttr, Height, height)
DEFINE_ANIMATED_STRING(SVGFilterPrimitiveStandardAttributes, SVGNames::resultAttr, Result, result)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGFilterPrimitiveStandardAttributes)
- REGISTER_LOCAL_ANIMATED_PROPERTY(x)
- REGISTER_LOCAL_ANIMATED_PROPERTY(y)
- REGISTER_LOCAL_ANIMATED_PROPERTY(width)
- REGISTER_LOCAL_ANIMATED_PROPERTY(height)
REGISTER_LOCAL_ANIMATED_PROPERTY(result)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGElement)
END_REGISTER_ANIMATED_PROPERTIES
SVGFilterPrimitiveStandardAttributes::SVGFilterPrimitiveStandardAttributes(const QualifiedName& tagName, Document& document)
: SVGElement(tagName, document)
- , m_x(LengthModeWidth, "0%")
- , m_y(LengthModeHeight, "0%")
- , m_width(LengthModeWidth, "100%")
- , m_height(LengthModeHeight, "100%")
+ , m_x(SVGAnimatedLength::create(this, SVGNames::xAttr, SVGLength::create(LengthModeWidth)))
+ , m_y(SVGAnimatedLength::create(this, SVGNames::yAttr, SVGLength::create(LengthModeHeight)))
+ , m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth)))
+ , m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight)))
{
// Spec: If the x/y attribute is not specified, the effect is as if a value of "0%" were specified.
+ m_x->setDefaultValueAsString("0%");
+ m_y->setDefaultValueAsString("0%");
+
// Spec: If the width/height attribute is not specified, the effect is as if a value of "100%" were specified.
+ m_width->setDefaultValueAsString("100%");
+ m_height->setDefaultValueAsString("100%");
+
+ addToPropertyMap(m_x);
+ addToPropertyMap(m_y);
+ addToPropertyMap(m_width);
+ addToPropertyMap(m_height);
registerAnimatedPropertiesForSVGFilterPrimitiveStandardAttributes();
}
@@ -79,13 +81,13 @@ void SVGFilterPrimitiveStandardAttributes::parseAttribute(const QualifiedName& n
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 (name == SVGNames::widthAttr)
- setWidthBaseValue(SVGLength::construct(LengthModeWidth, value, parseError));
+ m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError);
else if (name == SVGNames::heightAttr)
- setHeightBaseValue(SVGLength::construct(LengthModeHeight, value, parseError));
+ m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError);
else if (name == SVGNames::resultAttr)
setResultBaseValue(value);
else
« no previous file with comments | « Source/core/svg/SVGFilterPrimitiveStandardAttributes.h ('k') | Source/core/svg/SVGForeignObjectElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698