SVGAnimatedProperty.cpp [plain text]
#include "config.h"
#include "SVGAnimatedProperty.h"
#include "SVGElement.h"
namespace WebCore {
SVGAnimatedProperty::SVGAnimatedProperty(SVGElement* contextElement, const QualifiedName& attributeName, AnimatedPropertyType animatedPropertyType)
: m_contextElement(contextElement)
, m_attributeName(attributeName)
, m_animatedPropertyType(animatedPropertyType)
, m_isAnimating(false)
, m_isReadOnly(false)
{
}
SVGAnimatedProperty::~SVGAnimatedProperty()
{
Cache& cache = *animatedPropertyCache();
for (auto it = cache.begin(), end = cache.end(); it != end; ++it) {
if (it->value == this) {
cache.remove(it);
break;
}
}
ASSERT(!m_isAnimating);
}
void SVGAnimatedProperty::commitChange()
{
ASSERT(m_contextElement);
ASSERT(!m_contextElement->m_deletionHasBegun);
m_contextElement->invalidateSVGAttributes();
m_contextElement->svgAttributeChanged(m_attributeName);
}
SVGAnimatedProperty::Cache* SVGAnimatedProperty::animatedPropertyCache()
{
static Cache* s_cache = new Cache;
return s_cache;
}
}