This source file includes following definitions.
- create
- isSupportedAttribute
- parseAttribute
- svgAttributeChanged
- createRenderer
- rendererIsNeeded
#include "config.h"
#include "core/svg/SVGGElement.h"
#include "SVGNames.h"
#include "core/rendering/svg/RenderSVGHiddenContainer.h"
#include "core/rendering/svg/RenderSVGResource.h"
#include "core/rendering/svg/RenderSVGTransformableContainer.h"
#include "core/svg/SVGElementInstance.h"
namespace WebCore {
SVGGElement::SVGGElement(Document& document, ConstructionType constructionType)
: SVGGraphicsElement(SVGNames::gTag, document, constructionType)
{
ScriptWrappable::init(this);
}
PassRefPtr<SVGGElement> SVGGElement::create(Document& document)
{
return adoptRef(new SVGGElement(document));
}
bool SVGGElement::isSupportedAttribute(const QualifiedName& attrName)
{
DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ());
return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName);
}
void SVGGElement::parseAttribute(const QualifiedName& name, const AtomicString& value)
{
if (!isSupportedAttribute(name)) {
SVGGraphicsElement::parseAttribute(name, value);
return;
}
ASSERT_NOT_REACHED();
}
void SVGGElement::svgAttributeChanged(const QualifiedName& attrName)
{
if (!isSupportedAttribute(attrName)) {
SVGGraphicsElement::svgAttributeChanged(attrName);
return;
}
SVGElementInstance::InvalidationGuard invalidationGuard(this);
if (RenderObject* renderer = this->renderer())
RenderSVGResource::markForLayoutAndParentResourceInvalidation(renderer);
}
RenderObject* SVGGElement::createRenderer(RenderStyle* style)
{
if (style->display() == NONE)
return new RenderSVGHiddenContainer(this);
return new RenderSVGTransformableContainer(this);
}
bool SVGGElement::rendererIsNeeded(const RenderStyle&)
{
return parentOrShadowHostElement() && parentOrShadowHostElement()->isSVGElement();
}
}