SVGSwitchElement.cpp [plain text]
#include "config.h"
#include "SVGSwitchElement.h"
#include "ElementIterator.h"
#include "RenderSVGTransformableContainer.h"
#include "SVGNames.h"
namespace WebCore {
DEFINE_ANIMATED_BOOLEAN(SVGSwitchElement, SVGNames::externalResourcesRequiredAttr, ExternalResourcesRequired, externalResourcesRequired)
BEGIN_REGISTER_ANIMATED_PROPERTIES(SVGSwitchElement)
REGISTER_LOCAL_ANIMATED_PROPERTY(externalResourcesRequired)
REGISTER_PARENT_ANIMATED_PROPERTIES(SVGGraphicsElement)
END_REGISTER_ANIMATED_PROPERTIES
inline SVGSwitchElement::SVGSwitchElement(const QualifiedName& tagName, Document& document)
: SVGGraphicsElement(tagName, document)
{
ASSERT(hasTagName(SVGNames::switchTag));
registerAnimatedPropertiesForSVGSwitchElement();
}
Ref<SVGSwitchElement> SVGSwitchElement::create(const QualifiedName& tagName, Document& document)
{
return adoptRef(*new SVGSwitchElement(tagName, document));
}
bool SVGSwitchElement::childShouldCreateRenderer(const Node& child) const
{
for (auto& element : childrenOfType<SVGElement>(*this)) {
if (!element.isValid())
continue;
return &element == &child; }
return false;
}
RenderPtr<RenderElement> SVGSwitchElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&)
{
return createRenderer<RenderSVGTransformableContainer>(*this, WTFMove(style));
}
}