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/SVGClipPathElement.cpp | 41 ++++++++++--------------------- 1 file changed, 13 insertions(+), 28 deletions(-) (limited to 'Source/WebCore/svg/SVGClipPathElement.cpp') diff --git a/Source/WebCore/svg/SVGClipPathElement.cpp b/Source/WebCore/svg/SVGClipPathElement.cpp index 446dabeac..fa1876347 100644 --- a/Source/WebCore/svg/SVGClipPathElement.cpp +++ b/Source/WebCore/svg/SVGClipPathElement.cpp @@ -20,17 +20,13 @@ */ #include "config.h" - -#if ENABLE(SVG) #include "SVGClipPathElement.h" -#include "Attribute.h" #include "Document.h" #include "RenderSVGResourceClipper.h" -#include "SVGElementInstance.h" #include "SVGNames.h" -#include "SVGTransformList.h" #include "StyleResolver.h" +#include namespace WebCore { @@ -52,42 +48,33 @@ inline SVGClipPathElement::SVGClipPathElement(const QualifiedName& tagName, Docu registerAnimatedPropertiesForSVGClipPathElement(); } -PassRefPtr SVGClipPathElement::create(const QualifiedName& tagName, Document& document) +Ref SVGClipPathElement::create(const QualifiedName& tagName, Document& document) { - return adoptRef(new SVGClipPathElement(tagName, document)); + return adoptRef(*new SVGClipPathElement(tagName, document)); } bool SVGClipPathElement::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); - supportedAttributes.add(SVGNames::clipPathUnitsAttr); + supportedAttributes.get().add(SVGNames::clipPathUnitsAttr); } - return supportedAttributes.contains(attrName); + return supportedAttributes.get().contains(attrName); } void SVGClipPathElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (!isSupportedAttribute(name)) { - SVGGraphicsElement::parseAttribute(name, value); - return; - } - if (name == SVGNames::clipPathUnitsAttr) { - SVGUnitTypes::SVGUnitType propertyValue = SVGPropertyTraits::fromString(value); + auto propertyValue = SVGPropertyTraits::fromString(value); if (propertyValue > 0) setClipPathUnitsBaseValue(propertyValue); 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 SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) @@ -97,7 +84,7 @@ void SVGClipPathElement::svgAttributeChanged(const QualifiedName& attrName) return; } - SVGElementInstance::InvalidationGuard invalidationGuard(this); + InstanceInvalidationGuard guard(*this); if (RenderObject* object = renderer()) object->setNeedsLayout(); @@ -114,11 +101,9 @@ void SVGClipPathElement::childrenChanged(const ChildChange& change) object->setNeedsLayout(); } -RenderPtr SVGClipPathElement::createElementRenderer(PassRef style) +RenderPtr SVGClipPathElement::createElementRenderer(RenderStyle&& style, const RenderTreePosition&) { - return createRenderer(*this, std::move(style)); + return createRenderer(*this, WTFMove(style)); } } - -#endif // ENABLE(SVG) -- cgit v1.2.1