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();
}
PassRefPtr<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(PassRef<RenderStyle> style)
{
return createRenderer<RenderSVGTransformableContainer>(*this, WTF::move(style));
}
}