This source file includes following definitions.
- m_viewTarget
- create
- isSupportedAttribute
- parseAttribute
#include "config.h"
#include "core/svg/SVGViewElement.h"
namespace WebCore {
inline SVGViewElement::SVGViewElement(Document& document)
: SVGElement(SVGNames::viewTag, document)
, SVGFitToViewBox(this)
, m_viewTarget(SVGStaticStringList::create(this, SVGNames::viewTargetAttr))
{
ScriptWrappable::init(this);
addToPropertyMap(m_viewTarget);
}
PassRefPtr<SVGViewElement> SVGViewElement::create(Document& document)
{
return adoptRef(new SVGViewElement(document));
}
bool SVGViewElement::isSupportedAttribute(const QualifiedName& attrName)
{
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
if (supportedAttributes.isEmpty()) {
SVGFitToViewBox::addSupportedAttributes(supportedAttributes);
SVGZoomAndPan::addSupportedAttributes(supportedAttributes);
supportedAttributes.add(SVGNames::viewTargetAttr);
}
return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
}
void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (!isSupportedAttribute(name)) {
SVGElement::parseAttribute(name, value);
return;
}
SVGParsingError parseError = NoError;
if (SVGFitToViewBox::parseAttribute(name, value, document(), parseError)) {
} else if (SVGZoomAndPan::parseAttribute(name, value)) {
} else if (name == SVGNames::viewTargetAttr) {
m_viewTarget->setBaseValueAsString(value, parseError);
} else {
ASSERT_NOT_REACHED();
}
reportAttributeParsingError(parseError, name, value);
}
}