diff options
Diffstat (limited to 'Source/WebCore/svg/SVGFEOffsetElement.cpp')
-rw-r--r-- | Source/WebCore/svg/SVGFEOffsetElement.cpp | 44 |
1 files changed, 8 insertions, 36 deletions
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> SVGFEOffsetElement::create(const QualifiedName& tagName, Document& document) -{ - return adoptRef(new SVGFEOffsetElement(tagName, document)); -} - -bool SVGFEOffsetElement::isSupportedAttribute(const QualifiedName& attrName) +Ref<SVGFEOffsetElement> SVGFEOffsetElement::create(const QualifiedName& tagName, Document& document) { - DEFINE_STATIC_LOCAL(HashSet<QualifiedName>, supportedAttributes, ()); - if (supportedAttributes.isEmpty()) { - supportedAttributes.add(SVGNames::inAttr); - supportedAttributes.add(SVGNames::dxAttr); - supportedAttributes.add(SVGNames::dyAttr); - } - return supportedAttributes.contains<SVGAttributeHashTranslator>(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<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter* filter) +RefPtr<FilterEffect> SVGFEOffsetElement::build(SVGFilterBuilder* filterBuilder, Filter& filter) { FilterEffect* input1 = filterBuilder->getEffectById(in1()); if (!input1) - return 0; + return nullptr; RefPtr<FilterEffect> effect = FEOffset::create(filter, dx(), dy()); effect->inputEffects().append(input1); - return effect.release(); + return effect; } } - -#endif // ENABLE(SVG) |