SVGAnimateTransformElement.cpp [plain text]
#include "config.h"
#include "SVGAnimateTransformElement.h"
#include "SVGNames.h"
#include "SVGTransformable.h"
namespace WebCore {
inline SVGAnimateTransformElement::SVGAnimateTransformElement(const QualifiedName& tagName, Document& document)
: SVGAnimateElementBase(tagName, document)
, m_type(SVGTransformValue::SVG_TRANSFORM_UNKNOWN)
{
ASSERT(hasTagName(SVGNames::animateTransformTag));
}
Ref<SVGAnimateTransformElement> SVGAnimateTransformElement::create(const QualifiedName& tagName, Document& document)
{
return adoptRef(*new SVGAnimateTransformElement(tagName, document));
}
bool SVGAnimateTransformElement::hasValidAttributeType()
{
SVGElement* targetElement = this->targetElement();
if (!targetElement)
return false;
if (attributeType() == AttributeType::CSS)
return false;
return m_animatedPropertyType == AnimatedTransformList;
}
void SVGAnimateTransformElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (name == SVGNames::typeAttr) {
m_type = SVGTransformable::parseTransformType(value);
if (m_type == SVGTransformValue::SVG_TRANSFORM_MATRIX)
m_type = SVGTransformValue::SVG_TRANSFORM_UNKNOWN;
return;
}
SVGAnimateElementBase::parseAttribute(name, value);
}
}