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

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

Issue 148173018: [SVG] SVGAnimatedString{,List} migration to new SVG property impl. (Closed) Base URL: svn://svn.chromium.org/blink/trunk
Patch Set: remove if 0 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
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;
}

Powered by Google App Engine
This is Rietveld 408576698