SVGViewElement.cpp [plain text]
#include "config.h"
#include "SVGViewElement.h"
#include "RenderSVGResource.h"
#include "SVGNames.h"
#include "SVGSVGElement.h"
#include "SVGStringList.h"
#include <wtf/IsoMallocInlines.h>
namespace WebCore {
WTF_MAKE_ISO_ALLOCATED_IMPL(SVGViewElement);
inline SVGViewElement::SVGViewElement(const QualifiedName& tagName, Document& document)
: SVGElement(tagName, document)
, SVGFitToViewBox(this)
{
ASSERT(hasTagName(SVGNames::viewTag));
}
Ref<SVGViewElement> SVGViewElement::create(const QualifiedName& tagName, Document& document)
{
return adoptRef(*new SVGViewElement(tagName, document));
}
void SVGViewElement::parseAttribute(const QualifiedName& name, const AtomString& value)
{
SVGElement::parseAttribute(name, value);
SVGFitToViewBox::parseAttribute(name, value);
SVGZoomAndPan::parseAttribute(name, value);
}
void SVGViewElement::svgAttributeChanged(const QualifiedName& attrName)
{
if (PropertyRegistry::isKnownAttribute(attrName))
return;
if (SVGFitToViewBox::isKnownAttribute(attrName)) {
if (m_targetElement) {
m_targetElement->inheritViewAttributes(*this);
if (auto* renderer = m_targetElement->renderer())
RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer);
}
return;
}
SVGElement::svgAttributeChanged(attrName);
}
}