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/SVGFEOffsetElement.cpp | 44 ++++++------------------------- 1 file changed, 8 insertions(+), 36 deletions(-) (limited to 'Source/WebCore/svg/SVGFEOffsetElement.cpp') diff --git a/Source/WebCore/svg/SVGFEOffsetElement.cpp b/Source/WebCore/svg/SVGFEOffsetElement.cpp index 9911d9f35..43138ff9a 100644 --- a/Source/WebCore/svg/SVGFEOffsetElement.cpp +++ b/Source/WebCore/svg/SVGFEOffsetElement.cpp @@ -19,13 +19,9 @@ */ #include "config.h" - -#if ENABLE(SVG) && ENABLE(FILTERS) #include "SVGFEOffsetElement.h" -#include "Attribute.h" #include "FilterEffect.h" -#include "SVGElementInstance.h" #include "SVGFilterBuilder.h" #include "SVGNames.h" @@ -50,29 +46,13 @@ inline SVGFEOffsetElement::SVGFEOffsetElement(const QualifiedName& tagName, Docu registerAnimatedPropertiesForSVGFEOffsetElement(); } -PassRefPtr SVGFEOffsetElement::create(const QualifiedName& tagName, Document& document) -{ - return adoptRef(new SVGFEOffsetElement(tagName, document)); -} - -bool SVGFEOffsetElement::isSupportedAttribute(const QualifiedName& attrName) +Ref SVGFEOffsetElement::create(const QualifiedName& tagName, Document& document) { - DEFINE_STATIC_LOCAL(HashSet, supportedAttributes, ()); - if (supportedAttributes.isEmpty()) { - supportedAttributes.add(SVGNames::inAttr); - supportedAttributes.add(SVGNames::dxAttr); - supportedAttributes.add(SVGNames::dyAttr); - } - return supportedAttributes.contains(attrName); + return adoptRef(*new SVGFEOffsetElement(tagName, document)); } void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicString& value) { - if (!isSupportedAttribute(name)) { - SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); - return; - } - if (name == SVGNames::dxAttr) { setDxBaseValue(value.toFloat()); return; @@ -88,38 +68,30 @@ void SVGFEOffsetElement::parseAttribute(const QualifiedName& name, const AtomicS return; } - ASSERT_NOT_REACHED(); + SVGFilterPrimitiveStandardAttributes::parseAttribute(name, value); } void SVGFEOffsetElement::svgAttributeChanged(const QualifiedName& attrName) { - if (!isSupportedAttribute(attrName)) { - SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); - return; - } - - SVGElementInstance::InvalidationGuard invalidationGuard(this); - if (attrName == SVGNames::inAttr || attrName == SVGNames::dxAttr || attrName == SVGNames::dyAttr) { + InstanceInvalidationGuard guard(*this); invalidate(); return; } - ASSERT_NOT_REACHED(); + SVGFilterPrimitiveStandardAttributes::svgAttributeChanged(attrName); } -PassRefPtr SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter* filter) +RefPtr SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) { FilterEffect* input1 = filterBuilder->getEffectById(in1()); if (!input1) - return 0; + return nullptr; RefPtr effect = FEOffset::create(filter, dx(), dy()); effect->inputEffects().append(input1); - return effect.release(); + return effect; } } - -#endif // ENABLE(SVG) -- cgit v1.2.1