diff --git a/content/svg/content/src/nsSVGFilterElement.cpp b/content/svg/content/src/nsSVGFilterElement.cpp index 0c4c371741c8..542b3c94b688 100644 --- a/content/svg/content/src/nsSVGFilterElement.cpp +++ b/content/svg/content/src/nsSVGFilterElement.cpp @@ -241,36 +241,3 @@ nsSVGFilterElement::GetStringInfo() return StringAttributesInfo(mStringAttributes, sStringInfo, NS_ARRAY_LENGTH(sStringInfo)); } - -inline static void DidAnimateAttr(nsSVGFilterElement *aFilterElement) -{ - // nsSVGFilterFrame doesn't implement a useful AttributeChanged - nsIFrame* frame = aFilterElement->GetPrimaryFrame(); - if (frame) { - nsSVGEffects::InvalidateRenderingObservers(frame); - } -} - -void -nsSVGFilterElement::DidAnimateLength(PRUint8 aAttrEnum) -{ - DidAnimateAttr(this); -} - -void -nsSVGFilterElement::DidAnimateIntegerPair(PRUint8 aAttrEnum) -{ - DidAnimateAttr(this); -} - -void -nsSVGFilterElement::DidAnimateEnum(PRUint8 aAttrEnum) -{ - DidAnimateAttr(this); -} - -void -nsSVGFilterElement::DidAnimateString(PRUint8 aAttrEnum) -{ - DidAnimateAttr(this); -} diff --git a/content/svg/content/src/nsSVGFilterElement.h b/content/svg/content/src/nsSVGFilterElement.h index cf230accdb00..2bf4b1e68ceb 100644 --- a/content/svg/content/src/nsSVGFilterElement.h +++ b/content/svg/content/src/nsSVGFilterElement.h @@ -88,11 +88,6 @@ protected: virtual EnumAttributesInfo GetEnumInfo(); virtual StringAttributesInfo GetStringInfo(); - virtual void DidAnimateLength(PRUint8 aAttrEnum); - virtual void DidAnimateIntegerPair(PRUint8 aAttrEnum); - virtual void DidAnimateEnum(PRUint8 aAttrEnum); - virtual void DidAnimateString(PRUint8 aAttrEnum); - enum { X, Y, WIDTH, HEIGHT }; nsSVGLength2 mLengthAttributes[4]; static LengthInfo sLengthInfo[4]; diff --git a/layout/svg/base/src/nsSVGFilterFrame.cpp b/layout/svg/base/src/nsSVGFilterFrame.cpp index 7e3865123242..b29eb3fbe3b4 100644 --- a/layout/svg/base/src/nsSVGFilterFrame.cpp +++ b/layout/svg/base/src/nsSVGFilterFrame.cpp @@ -38,6 +38,7 @@ #include "nsIDocument.h" #include "nsSVGOuterSVGFrame.h" #include "nsGkAtoms.h" +#include "nsSVGEffects.h" #include "nsSVGUtils.h" #include "nsSVGFilterElement.h" #include "nsSVGFilters.h" @@ -227,6 +228,27 @@ nsAutoFilterInstance::~nsAutoFilterInstance() { } +NS_IMETHODIMP +nsSVGFilterFrame::AttributeChanged(PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType) +{ + if ((aNameSpaceID == kNameSpaceID_None && + (aAttribute == nsGkAtoms::x || + aAttribute == nsGkAtoms::y || + aAttribute == nsGkAtoms::width || + aAttribute == nsGkAtoms::height || + aAttribute == nsGkAtoms::filterRes || + aAttribute == nsGkAtoms::filterUnits || + aAttribute == nsGkAtoms::primitiveUnits)) || + (aNameSpaceID == kNameSpaceID_XLink && + aAttribute == nsGkAtoms::href)) { + nsSVGEffects::InvalidateRenderingObservers(this); + } + return nsSVGFilterFrameBase::AttributeChanged(aNameSpaceID, + aAttribute, aModType); +} + nsresult nsSVGFilterFrame::FilterPaint(nsSVGRenderState *aContext, nsIFrame *aTarget, diff --git a/layout/svg/base/src/nsSVGFilterFrame.h b/layout/svg/base/src/nsSVGFilterFrame.h index 2dcf93008049..bfc17a46e916 100644 --- a/layout/svg/base/src/nsSVGFilterFrame.h +++ b/layout/svg/base/src/nsSVGFilterFrame.h @@ -54,6 +54,10 @@ protected: public: NS_DECL_FRAMEARENA_HELPERS + NS_IMETHOD AttributeChanged(PRInt32 aNameSpaceID, + nsIAtom* aAttribute, + PRInt32 aModType); + nsresult FilterPaint(nsSVGRenderState *aContext, nsIFrame *aTarget, nsSVGFilterPaintCallback *aPaintCallback, const nsIntRect* aDirtyRect);