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

Unified Diff: Source/core/svg/SVGMPathElement.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/SVGMPathElement.h ('k') | Source/core/svg/SVGMaskElement.h » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: Source/core/svg/SVGMPathElement.cpp
diff --git a/Source/core/svg/SVGMPathElement.cpp b/Source/core/svg/SVGMPathElement.cpp
index 8fb5460edd357d6103e1b69d5d59a437d2fb826c..343b86dd173028bc7abe6c4d534317f1752f4170 100644
--- a/Source/core/svg/SVGMPathElement.cpp
+++ b/Source/core/svg/SVGMPathElement.cpp
@@ -30,16 +30,16 @@
namespace WebCore {
// Animated property definitions
-DEFINE_ANIMATED_STRING(SVGMPathElement, XLinkNames::hrefAttr, Href, href)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGMPathElement)
- REGISTER_LOCAL_ANIMATED_PROPERTY(href)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGMPathElement::SVGMPathElement(Document& document)
: SVGElement(SVGNames::mpathTag, document)
+ , m_href(SVGAnimatedString::create(this, XLinkNames::hrefAttr, SVGString::create()))
{
ScriptWrappable::init(this);
+ addToPropertyMap(m_href);
registerAnimatedPropertiesForSVGMPathElement();
}
@@ -60,7 +60,7 @@ void SVGMPathElement::buildPendingResource()
return;
AtomicString id;
- Element* target = SVGURIReference::targetElementFromIRIString(hrefCurrentValue(), document(), &id);
+ Element* target = SVGURIReference::targetElementFromIRIString(m_href->currentValue()->value(), document(), &id);
if (!target) {
// Do not register as pending if we are already pending this resource.
if (document().accessSVGExtensions()->isElementPendingResource(this, id))
@@ -111,15 +111,17 @@ bool SVGMPathElement::isSupportedAttribute(const QualifiedName& attrName)
void SVGMPathElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
+ SVGParsingError parseError = NoError;
+
if (!isSupportedAttribute(name)) {
SVGElement::parseAttribute(name, value);
- return;
+ } else if (name.matches(XLinkNames::hrefAttr)) {
+ m_href->setBaseValueAsString(value, parseError);
+ } else {
+ ASSERT_NOT_REACHED();
}
- if (SVGURIReference::parseAttribute(name, value))
- return;
-
- ASSERT_NOT_REACHED();
+ reportAttributeParsingError(parseError, name, value);
}
void SVGMPathElement::svgAttributeChanged(const QualifiedName& attrName)
@@ -141,7 +143,7 @@ void SVGMPathElement::svgAttributeChanged(const QualifiedName& attrName)
SVGPathElement* SVGMPathElement::pathElement()
{
- Element* target = targetElementFromIRIString(hrefCurrentValue(), document());
+ Element* target = targetElementFromIRIString(m_href->currentValue()->value(), document());
if (target && target->hasTagName(SVGNames::pathTag))
return toSVGPathElement(target);
return 0;
« no previous file with comments | « Source/core/svg/SVGMPathElement.h ('k') | Source/core/svg/SVGMaskElement.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698