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

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

Issue 148173018: [SVG] SVGAnimatedString{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove debug print 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/SVGImageElement.h ('k') | Source/core/svg/SVGLinearGradientElement.cpp » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGImageElement.cpp
diff --git a/Source/core/svg/SVGImageElement.cpp b/Source/core/svg/SVGImageElement.cpp
index 8005d14da37b989fea4d9698ca65e1a186c6cc51..4a5fccd60b4f8219da7c1a08b732dec8f952d967 100644
--- a/Source/core/svg/SVGImageElement.cpp
+++ b/Source/core/svg/SVGImageElement.cpp
@@ -33,10 +33,8 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_STRING(SVGImageElement, XLinkNames::hrefAttr, Href, href)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGImageElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(href)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
@@ -47,6 +45,7 @@ inline SVGImageElement::SVGImageElement(Document& document)
, m_width(SVGAnimatedLength::create(this, SVGNames::widthAttr, SVGLength::create(LengthModeWidth)))
, m_height(SVGAnimatedLength::create(this, SVGNames::heightAttr, SVGLength::create(LengthModeHeight)))
, m_preserveAspectRatio(SVGAnimatedPreserveAspectRatio::create(this, SVGNames::preserveAspectRatioAttr, SVGPreserveAspectRatio::create()))
+ , m_href(SVGAnimatedString::create(this, XLinkNames::hrefAttr, SVGString::create()))
, m_imageLoader(this)
{
ScriptWrappable::init(this);
@@ -57,6 +56,7 @@ inline SVGImageElement::SVGImageElement(Document& document)
addToPropertyMap(m_height);
addToPropertyMap(m_preserveAspectRatio);
+ addToPropertyMap(m_href);
registerAnimatedPropertiesForSVGImageElement();
}
@@ -122,10 +122,11 @@ void SVGImageElement::parseAttribute(const QualifiedName& name, const AtomicStri
m_width->setBaseValueAsString(value, ForbidNegativeLengths, parseError);
else if (name == SVGNames::heightAttr)
m_height->setBaseValueAsString(value, ForbidNegativeLengths, parseError);
- else if (name == SVGNames::preserveAspectRatioAttr) {
+ else if (name == SVGNames::preserveAspectRatioAttr)
m_preserveAspectRatio->setBaseValueAsString(value, parseError);
- } else if (SVGURIReference::parseAttribute(name, value)) {
- } else
+ else if (name.matches(XLinkNames::hrefAttr))
+ m_href->setBaseValueAsString(value, parseError);
+ else
ASSERT_NOT_REACHED();
reportAttributeParsingError(parseError, name, value);
@@ -214,7 +215,7 @@ Node::InsertionNotificationRequest SVGImageElement::insertedInto(ContainerNode*
const AtomicString SVGImageElement::imageSourceURL() const
{
- return AtomicString(hrefCurrentValue());
+ return AtomicString(m_href->currentValue()->value());
}
void SVGImageElement::didMoveToNewDocument(Document& oldDocument)
« no previous file with comments | « Source/core/svg/SVGImageElement.h ('k') | Source/core/svg/SVGLinearGradientElement.cpp » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698