From 1bf1084f2b10c3b47fd1a588d85d21ed0eb41d0c Mon Sep 17 00:00:00 2001 From: Lorry Tar Creator Date: Tue, 27 Jun 2017 06:07:23 +0000 Subject: webkitgtk-2.16.5 --- Source/WebCore/svg/SVGGElement.cpp | 46 ++++++++++++++++---------------------- 1 file changed, 19 insertions(+), 27 deletions(-) (limited to 'Source/WebCore/svg/SVGGElement.cpp') diff --git a/Source/WebCore/svg/SVGGElement.cpp b/Source/WebCore/svg/SVGGElement.cpp index 2d6490475..94cf836fe 100644 --- a/Source/WebCore/svg/SVGGElement.cpp +++ b/Source/WebCore/svg/SVGGElement.cpp @@ -19,15 +19,13 @@ */ #include "config.h" - -#if ENABLE(SVG) #include "SVGGElement.h" #include "RenderSVGHiddenContainer.h" #include "RenderSVGResource.h" #include "RenderSVGTransformableContainer.h" -#include "SVGElementInstance.h" #include "SVGNames.h" +#include namespace WebCore { @@ -46,34 +44,30 @@ SVGGElement::SVGGElement(const QualifiedName& tagName, Document& document) registerAnimatedPropertiesForSVGGElement(); } -PassRefPtr SVGGElement::create(const QualifiedName& tagName, Document& document) +Ref SVGGElement::create(const QualifiedName& tagName, Document& document) +{ + return adoptRef(*new SVGGElement(tagName, document)); +} + +Ref SVGGElement::create(Document& document) { - return adoptRef(new SVGGElement(tagName, document)); + return create(SVGNames::gTag, document); } bool SVGGElement::isSupportedAttribute(const QualifiedName& attrName) { - DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); - if (supportedAttributes.isEmpty()) { + static NeverDestroyed> supportedAttributes; + if (supportedAttributes.get().isEmpty()) { SVGLangSpace::addSupportedAttributes(supportedAttributes); SVGExternalResourcesRequired::addSupportedAttributes(supportedAttributes); } - return supportedAttributes.contains(attrName); + return supportedAttributes.get().contains(attrName); } void SVGGElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (!isSupportedAttribute(name)) { - SVGGraphicsElement::parseAttribute(name, value); - return; - } - - if (SVGLangSpace::parseAttribute(name, value)) - return; - if (SVGExternalResourcesRequired::parseAttribute(name, value)) - return; - - ASSERT_NOT_REACHED(); + SVGGraphicsElement::parseAttribute(name, value); + SVGExternalResourcesRequired::parseAttribute(name, value); } void SVGGElement::svgAttributeChanged(const QualifiedName& attrName) @@ -83,22 +77,22 @@ void SVGGElement::svgAttributeChanged(const QualifiedName& attrName) return; } - SVGElementInstance::InvalidationGuard invalidationGuard(this); + InstanceInvalidationGuard guard(*this); if (auto renderer = this->renderer()) RenderSVGResource::markForLayoutAndParentResourceInvalidation(*renderer); } -RenderPtr SVGGElement::createElementRenderer(PassRef style) +RenderPtr SVGGElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) { - // SVG 1.1 testsuite explicitely uses constructs like + // SVG 1.1 testsuite explicitly uses constructs like // We still have to create renderers for the & element, though the // subtree may be hidden - we only want the resource renderers to exist so they can be // referenced from somewhere else. - if (style.get().display() == NONE) - return createRenderer(*this, std::move(style)); + if (style.display() == NONE) + return createRenderer(*this, WTFMove(style)); - return createRenderer(*this, std::move(style)); + return createRenderer(*this, WTFMove(style)); } bool SVGGElement::rendererIsNeeded(const RenderStyle&) @@ -109,5 +103,3 @@ bool SVGGElement::rendererIsNeeded(const RenderStyle&) } } - -#endif // ENABLE(SVG) -- cgit v1.2.1