diff options
Diffstat (limited to 'Source/WebCore/svg/SVGSymbolElement.cpp')
-rw-r--r-- | Source/WebCore/svg/SVGSymbolElement.cpp | 51 |
1 files changed, 11 insertions, 40 deletions
diff --git a/Source/WebCore/svg/SVGSymbolElement.cpp b/Source/WebCore/svg/SVGSymbolElement.cpp index ca9d770ce..051bdc539 100644 --- a/Source/WebCore/svg/SVGSymbolElement.cpp +++ b/Source/WebCore/svg/SVGSymbolElement.cpp @@ -19,12 +19,9 @@ */ #include "config.h" - -#if ENABLE(SVG) #include "SVGSymbolElement.h" #include "RenderSVGHiddenContainer.h" -#include "SVGElementInstance.h" #include "SVGFitToViewBox.h" #include "SVGNames.h" @@ -49,51 +46,27 @@ inline SVGSymbolElement::SVGSymbolElement(const QualifiedName& tagName, Document registerAnimatedPropertiesForSVGSymbolElement(); } -PassRefPtr<SVGSymbolElement> SVGSymbolElement::create(const QualifiedName& tagName, Document& document) -{ - return adoptRef(new SVGSymbolElement(tagName, document)); -} - -bool SVGSymbolElement::isSupportedAttribute(const QualifiedName& attrName) +Ref<SVGSymbolElement> SVGSymbolElement::create(const QualifiedName& tagName, Document& document) { - DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); - if (supportedAttributes.isEmpty()) { - SVGLangSpace::addSupportedAttributes(supportedAttributes); - SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); - SVGFitToViewBox::addSupportedAttributes(supportedAttributes); - } - return supportedAttributes.contains<SVGAttributeHashTranslator>(attrName); + return adoptRef(*new SVGSymbolElement(tagName, document)); } void SVGSymbolElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (!isSupportedAttribute(name)) { - SVGElement::parseAttribute(name, value); - return; - } - - if (SVGLangSpace::parseAttribute(name, value)) - return; - if (SVGExternalResourcesRequired::parseAttribute(name, value)) - return; - if (SVGFitToViewBox::parseAttribute(this, name, value)) - return; - - ASSERT_NOT_REACHED(); + SVGElement::parseAttribute(name, value); + SVGExternalResourcesRequired::parseAttribute(name, value); + SVGFitToViewBox::parseAttribute(this, name, value); } void SVGSymbolElement::svgAttributeChanged(const QualifiedName& attrName) { - if (!isSupportedAttribute(attrName)) { - SVGElement::svgAttributeChanged(attrName); + if (attrName == SVGNames::viewBoxAttr) { + InstanceInvalidationGuard guard(*this); + updateRelativeLengthsInformation(); return; } - SVGElementInstance::InvalidationGuard invalidationGuard(this); - - // Every other property change is ignored. - if (attrName == SVGNames::viewBoxAttr) - updateRelativeLengthsInformation(); + SVGElement::svgAttributeChanged(attrName); } bool SVGSymbolElement::selfHasRelativeLengths() const @@ -101,11 +74,9 @@ bool SVGSymbolElement::selfHasRelativeLengths() const return hasAttribute(SVGNames::viewBoxAttr); } -RenderPtr<RenderElement> SVGSymbolElement::createElementRenderer(PassRef<RenderStyle> style) +RenderPtr<RenderElement> SVGSymbolElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) { - return createRenderer<RenderSVGHiddenContainer>(*this, std::move(style)); + return createRenderer<RenderSVGHiddenContainer>(*this, WTFMove(style)); } } - -#endif // ENABLE(SVG) |