Index: Source/core/svg/SVGElement.cpp |
diff --git a/Source/core/svg/SVGElement.cpp b/Source/core/svg/SVGElement.cpp |
index 7451ea67ed9e5603ee1af7c2d3b9f820175266ba..af8b7459440c9c7a1f9b79018684d9dbf9e744cf 100644 |
--- a/Source/core/svg/SVGElement.cpp |
+++ b/Source/core/svg/SVGElement.cpp |
@@ -51,10 +51,8 @@ |
namespace WebCore { |
// Animated property definitions |
-DEFINE_ANIMATED_STRING(SVGElement, HTMLNames::classAttr, ClassName, className) |
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGElement) |
-REGISTER_LOCAL_ANIMATED_PROPERTY(className) |
END_REGISTER_ANIMATED_PROPERTIES |
using namespace HTMLNames; |
@@ -72,6 +70,7 @@ void mapAttributeToCSSProperty(HashMap<StringImpl*, CSSPropertyID>* propertyName |
SVGElement::SVGElement(const QualifiedName& tagName, Document& document, ConstructionType constructionType) |
: Element(tagName, &document, constructionType) |
+ , m_className(SVGAnimatedString::create(this, HTMLNames::classAttr, SVGString::create())) |
#if !ASSERT_DISABLED |
, m_inRelativeLengthClientsInvalidation(false) |
#endif |
@@ -80,6 +79,7 @@ SVGElement::SVGElement(const QualifiedName& tagName, Document& document, Constru |
, m_hasSVGRareData(false) |
{ |
ScriptWrappable::init(this); |
+ addToPropertyMap(m_className); |
registerAnimatedPropertiesForSVGElement(); |
setHasCustomStyleCallbacks(); |
} |
@@ -681,7 +681,9 @@ void SVGElement::parseAttribute(const QualifiedName& name, const AtomicString& v |
// the className here. svgAttributeChanged actually causes the resulting |
// style updates (instead of Element::parseAttribute). We don't |
// tell Element about the change to avoid parsing the class list twice |
- setClassNameBaseValue(value); |
+ SVGParsingError parseError = NoError; |
+ m_className->setBaseValueAsString(value, parseError); |
+ reportAttributeParsingError(parseError, name, value); |
} else if (name == ontouchstartAttr) { |
setAttributeEventListener(EventTypeNames::touchstart, createAttributeEventListener(this, name, value)); |
} else if (name == ontouchmoveAttr) { |
@@ -996,7 +998,7 @@ void SVGElement::svgAttributeChanged(const QualifiedName& attrName) |
} |
if (attrName == HTMLNames::classAttr) { |
- classAttributeChanged(AtomicString(classNameCurrentValue())); |
+ classAttributeChanged(AtomicString(m_className->currentValue()->value())); |
SVGElementInstance::invalidateAllInstancesOfElement(this); |
return; |
} |