Bug 547333: Call FlushAnimations() in SVG DOM getters for animated values, and not in internal getters. r=jwatt
authorDaniel Holbert <dholbert@cs.stanford.edu>
Thu, 25 Feb 2010 10:20:43 -0800
changeset 38700 35637227632df389d0b1b4a75763c47a1df70311
parent 38699 17da12c3ab044f8597f7be6c311308615737766d
child 38701 7f1105f96113abb79b56fe76c68897bce6639fa1
push id11808
push userdholbert@mozilla.com
push dateThu, 25 Feb 2010 18:23:44 +0000
treeherderautoland@210e12a88a68 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt
bugs547333
milestone1.9.3a2pre
Bug 547333: Call FlushAnimations() in SVG DOM getters for animated values, and not in internal getters. r=jwatt
content/svg/content/src/nsSVGBoolean.h
content/svg/content/src/nsSVGElement.cpp
content/svg/content/src/nsSVGEnum.h
content/svg/content/src/nsSVGFilters.cpp
content/svg/content/src/nsSVGFilters.h
content/svg/content/src/nsSVGInteger.h
content/svg/content/src/nsSVGLength2.h
content/svg/content/src/nsSVGMarkerElement.cpp
content/svg/content/src/nsSVGNumber2.h
content/svg/content/src/nsSVGPathElement.cpp
content/svg/content/src/nsSVGPreserveAspectRatio.h
content/svg/content/src/nsSVGSVGElement.cpp
content/svg/content/src/nsSVGViewBox.cpp
content/svg/content/src/nsSVGViewBox.h
layout/svg/base/src/nsSVGFilterFrame.cpp
layout/svg/base/src/nsSVGGradientFrame.cpp
layout/svg/base/src/nsSVGMaskFrame.cpp
layout/svg/base/src/nsSVGOuterSVGFrame.cpp
layout/svg/base/src/nsSVGPatternFrame.cpp
layout/svg/base/src/nsSVGTextPathFrame.cpp
layout/svg/base/src/nsSVGUtils.cpp
--- a/content/svg/content/src/nsSVGBoolean.h
+++ b/content/svg/content/src/nsSVGBoolean.h
@@ -56,23 +56,18 @@ public:
                               PRBool aDoSetAttr);
   void GetBaseValueString(nsAString& aValue);
 
   void SetBaseValue(PRBool aValue, nsSVGElement *aSVGElement);
   PRBool GetBaseValue() const
     { return mBaseVal; }
 
   void SetAnimValue(PRBool aValue, nsSVGElement *aSVGElement);
-  PRBool GetAnimValue(nsSVGElement *aSVGElement) const
-  {
-  #ifdef MOZ_SMIL
-    aSVGElement->FlushAnimations();
-  #endif
-    return mAnimVal;
-  }
+  PRBool GetAnimValue() const
+    { return mAnimVal; }
 
   nsresult ToDOMAnimatedBoolean(nsIDOMSVGAnimatedBoolean **aResult,
                                 nsSVGElement* aSVGElement);
 #ifdef MOZ_SMIL
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 #endif // MOZ_SMIL
 
@@ -93,19 +88,27 @@ private:
 
     nsSVGBoolean* mVal; // kept alive because it belongs to content
     nsRefPtr<nsSVGElement> mSVGElement;
 
     NS_IMETHOD GetBaseVal(PRBool* aResult)
       { *aResult = mVal->GetBaseValue(); return NS_OK; }
     NS_IMETHOD SetBaseVal(PRBool aValue)
       { mVal->SetBaseValue(aValue, mSVGElement); return NS_OK; }
+
+    // Script may have modified animation parameters or timeline -- DOM getters
+    // need to flush any resample requests to reflect these modifications.
     NS_IMETHOD GetAnimVal(PRBool* aResult)
-      { *aResult = mVal->GetAnimValue(mSVGElement); return NS_OK; }
-
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aResult = mVal->GetAnimValue();
+      return NS_OK;
+    }
   };
 
 #ifdef MOZ_SMIL
   struct SMILBool : public nsISMILAttr
   {
   public:
     SMILBool(nsSVGBoolean* aVal, nsSVGElement* aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
--- a/content/svg/content/src/nsSVGElement.cpp
+++ b/content/svg/content/src/nsSVGElement.cpp
@@ -1325,17 +1325,17 @@ nsSVGElement::GetAnimatedNumberValues(fl
 
   float *f = aFirst;
   PRUint32 i = 0;
 
   va_list args;
   va_start(args, aFirst);
 
   while (f && i < info.mNumberCount) {
-    *f = info.mNumbers[i++].GetAnimValue(this);
+    *f = info.mNumbers[i++].GetAnimValue();
     f = va_arg(args, float*);
   }
   va_end(args);
 }
 
 nsSVGElement::IntegerAttributesInfo
 nsSVGElement::GetIntegerInfo()
 {
@@ -1391,17 +1391,17 @@ nsSVGElement::GetAnimatedIntegerValues(P
 
   PRInt32 *n = aFirst;
   PRUint32 i = 0;
 
   va_list args;
   va_start(args, aFirst);
 
   while (n && i < info.mIntegerCount) {
-    *n = info.mIntegers[i++].GetAnimValue(this);
+    *n = info.mIntegers[i++].GetAnimValue();
     n = va_arg(args, PRInt32*);
   }
   va_end(args);
 }
 
 nsSVGElement::AngleAttributesInfo
 nsSVGElement::GetAngleInfo()
 {
--- a/content/svg/content/src/nsSVGEnum.h
+++ b/content/svg/content/src/nsSVGEnum.h
@@ -65,23 +65,18 @@ public:
 
   nsresult SetBaseValue(PRUint16 aValue,
                         nsSVGElement *aSVGElement,
                         PRBool aDoSetAttr);
   PRUint16 GetBaseValue() const
     { return mBaseVal; }
 
   void SetAnimValue(PRUint16 aValue, nsSVGElement *aSVGElement);
-  PRUint16 GetAnimValue(nsSVGElement *aSVGElement) const
-  {
-  #ifdef MOZ_SMIL
-    aSVGElement->FlushAnimations();
-  #endif
-    return mAnimVal;
-  }
+  PRUint16 GetAnimValue() const
+    { return mAnimVal; }
 
   nsresult ToDOMAnimatedEnum(nsIDOMSVGAnimatedEnumeration **aResult,
                              nsSVGElement* aSVGElement);
 #ifdef MOZ_SMIL
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 #endif // MOZ_SMIL
 
@@ -103,18 +98,27 @@ private:
 
     nsSVGEnum *mVal; // kept alive because it belongs to content
     nsRefPtr<nsSVGElement> mSVGElement;
 
     NS_IMETHOD GetBaseVal(PRUint16* aResult)
       { *aResult = mVal->GetBaseValue(); return NS_OK; }
     NS_IMETHOD SetBaseVal(PRUint16 aValue)
       { return mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE); }
+
+    // Script may have modified animation parameters or timeline -- DOM getters
+    // need to flush any resample requests to reflect these modifications.
     NS_IMETHOD GetAnimVal(PRUint16* aResult)
-      { *aResult = mVal->GetAnimValue(mSVGElement); return NS_OK; }
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aResult = mVal->GetAnimValue();
+      return NS_OK;
+    }
   };
 
 #ifdef MOZ_SMIL
   struct SMILEnum : public nsISMILAttr
   {
   public:
     SMILEnum(nsSVGEnum* aVal, nsSVGElement* aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
--- a/content/svg/content/src/nsSVGFilters.cpp
+++ b/content/svg/content/src/nsSVGFilters.cpp
@@ -127,36 +127,35 @@ NS_INTERFACE_MAP_END_INHERITING(nsSVGFEB
 
 //----------------------------------------------------------------------
 // Implementation
 
 nsSVGFE::ScaleInfo
 nsSVGFE::SetupScalingFilter(nsSVGFilterInstance *aInstance,
                             const Image *aSource, const Image *aTarget,
                             const nsIntRect& aDataRect,
-                            nsSVGNumber2 *aUnitX, nsSVGNumber2 *aUnitY,
-                            nsSVGElement *aElement)
+                            nsSVGNumber2 *aUnitX, nsSVGNumber2 *aUnitY)
 {
   ScaleInfo result;
   result.mRescaling = HasAttr(kNameSpaceID_None, nsGkAtoms::kernelUnitLength);
   if (!result.mRescaling) {
     result.mSource = aSource->mImage;
     result.mTarget = aTarget->mImage;
     result.mDataRect = aDataRect;
     return result;
   }
 
   float kernelX, kernelY;
   nsSVGLength2 val;
   val.Init(nsSVGUtils::X, 0xff,
-           aUnitX->GetAnimValue(aElement),
+           aUnitX->GetAnimValue(),
            nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER);
   kernelX = aInstance->GetPrimitiveLength(&val);
   val.Init(nsSVGUtils::Y, 0xff,
-           aUnitY->GetAnimValue(aElement),
+           aUnitY->GetAnimValue(),
            nsIDOMSVGLength::SVG_LENGTHTYPE_NUMBER);
   kernelY = aInstance->GetPrimitiveLength(&val);
 #ifdef DEBUG_tor
   fprintf(stderr, "scaling kernelX/Y %f %f\n", kernelX, kernelY);
 #endif
   if (kernelX <= 0 || kernelY <= 0)
     return result;
 
@@ -947,17 +946,17 @@ nsSVGFEBlendElement::Filter(nsSVGFilterI
                             const nsIntRect& rect)
 {
   CopyRect(aTarget, aSources[0], rect);
 
   PRUint8* sourceData = aSources[1]->mImage->Data();
   PRUint8* targetData = aTarget->mImage->Data();
   PRUint32 stride = aTarget->mImage->Stride();
 
-  PRUint16 mode = mEnumAttributes[MODE].GetAnimValue(this);
+  PRUint16 mode = mEnumAttributes[MODE].GetAnimValue();
 
   for (PRInt32 x = rect.x; x < rect.XMost(); x++) {
     for (PRInt32 y = rect.y; y < rect.YMost(); y++) {
       PRUint32 targIndex = y * stride + 4 * x;
       PRUint32 qa = targetData[targIndex + GFX_ARGB32_OFFSET_A];
       PRUint32 qb = sourceData[targIndex + GFX_ARGB32_OFFSET_A];
       for (PRInt32 i = NS_MIN(GFX_ARGB32_OFFSET_B, GFX_ARGB32_OFFSET_R);
            i <= NS_MAX(GFX_ARGB32_OFFSET_B, GFX_ARGB32_OFFSET_R); i++) {
@@ -1180,17 +1179,17 @@ nsSVGFEColorMatrixElement::Filter(nsSVGF
                                   const nsTArray<const Image*>& aSources,
                                   const Image* aTarget,
                                   const nsIntRect& rect)
 {
   PRUint8* sourceData = aSources[0]->mImage->Data();
   PRUint8* targetData = aTarget->mImage->Data();
   PRUint32 stride = aTarget->mImage->Stride();
 
-  PRUint16 type = mEnumAttributes[TYPE].GetAnimValue(this);
+  PRUint16 type = mEnumAttributes[TYPE].GetAnimValue();
 
   nsCOMPtr<nsIDOMSVGNumberList> list;
   mValues->GetAnimVal(getter_AddRefs(list));
   PRUint32 num = 0;
   if (list) {
     list->GetNumberOfItems(&num);
   }
 
@@ -1515,17 +1514,17 @@ nsSVGFECompositeElement::SetK(float k1, 
 }
 
 nsresult
 nsSVGFECompositeElement::Filter(nsSVGFilterInstance *instance,
                                 const nsTArray<const Image*>& aSources,
                                 const Image* aTarget,
                                 const nsIntRect& rect)
 {
-  PRUint16 op = mEnumAttributes[OPERATOR].GetAnimValue(this);
+  PRUint16 op = mEnumAttributes[OPERATOR].GetAnimValue();
 
   // Cairo does not support arithmetic operator
   if (op == nsSVGFECompositeElement::SVG_OPERATOR_ARITHMETIC) {
     float k1, k2, k3, k4;
     GetAnimatedNumberValues(&k1, &k2, &k3, &k4, nsnull);
 
 #ifdef DEBUG_tor
     fprintf(stderr, "FILTER COMPOSITE rect: %d,%d  %dx%d\n",
@@ -1588,17 +1587,17 @@ nsSVGFECompositeElement::GetSourceImageN
   aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN1], this));
   aSources.AppendElement(nsSVGStringInfo(&mStringAttributes[IN2], this));
 }
 
 nsIntRect
 nsSVGFECompositeElement::ComputeTargetBBox(const nsTArray<nsIntRect>& aSourceBBoxes,
         const nsSVGFilterInstance& aInstance)
 {
-  PRUint16 op = mEnumAttributes[OPERATOR].GetAnimValue(this);
+  PRUint16 op = mEnumAttributes[OPERATOR].GetAnimValue();
 
   if (op == nsSVGFECompositeElement::SVG_OPERATOR_ARITHMETIC) {
     // "arithmetic" operator can produce non-zero alpha values even where
     // all input alphas are zero, so we can actually render outside the
     // union of the source bboxes.
     // XXX we could also check that k4 is nonzero and check for other
     // cases like k1/k2 or k1/k3 zero.
     return GetMaxRect();
@@ -1948,17 +1947,17 @@ NS_IMETHODIMP nsSVGComponentTransferFunc
 NS_IMETHODIMP nsSVGComponentTransferFunctionElement::GetOffset(nsIDOMSVGAnimatedNumber * *aOffset)
 {
   return mNumberAttributes[OFFSET].ToDOMAnimatedNumber(aOffset, this);
 }
 
 void
 nsSVGComponentTransferFunctionElement::GenerateLookupTable(PRUint8 *aTable)
 {
-  PRUint16 type = mEnumAttributes[TYPE].GetAnimValue(this);
+  PRUint16 type = mEnumAttributes[TYPE].GetAnimValue();
 
   float slope, intercept, amplitude, exponent, offset;
   GetAnimatedNumberValues(&slope, &intercept, &amplitude, 
                           &exponent, &offset, nsnull);
 
   PRUint32 i;
 
   switch (type) {
@@ -3204,19 +3203,19 @@ nsSVGFETurbulenceElement::Filter(nsSVGFi
                             PRInt32(aTarget->mFilterPrimitiveSubregion.Height()));
 
 #ifdef DEBUG_tor
   fprintf(stderr, "FILTER TURBULENCE rect: %d,%d  %dx%d\n",
           rect.x, rect.y, rect.width, rect.height);
 #endif
 
   float fX, fY, seed;
-  PRInt32 octaves = mIntegerAttributes[OCTAVES].GetAnimValue(this);
-  PRUint16 type = mEnumAttributes[TYPE].GetAnimValue(this);
-  PRUint16 stitch = mEnumAttributes[STITCHTILES].GetAnimValue(this);
+  PRInt32 octaves = mIntegerAttributes[OCTAVES].GetAnimValue();
+  PRUint16 type = mEnumAttributes[TYPE].GetAnimValue();
+  PRUint16 stitch = mEnumAttributes[STITCHTILES].GetAnimValue();
 
   GetAnimatedNumberValues(&fX, &fY, &seed, nsnull);
 
   InitSeed((PRInt32)seed);
 
   // XXXroc this makes absolutely no sense to me.
   float filterX = instance->GetFilterRect().X();
   float filterY = instance->GetFilterRect().Y();
@@ -3703,17 +3702,17 @@ nsSVGFEMorphologyElement::Filter(nsSVGFi
     return NS_OK;
   }
 
   PRUint8* sourceData = aSources[0]->mImage->Data();
   PRUint8* targetData = aTarget->mImage->Data();
   PRUint32 stride = aTarget->mImage->Stride();
   PRUint32 xExt[4], yExt[4];  // X, Y indices of RGBA extrema
   PRUint8 extrema[4];         // RGBA magnitude of extrema
-  PRUint16 op = mEnumAttributes[OPERATOR].GetAnimValue(this);
+  PRUint16 op = mEnumAttributes[OPERATOR].GetAnimValue();
 
   /* Scan the kernel for each pixel to determine max/min RGBA values.  Note that
    * as we advance in the x direction, each kernel overlaps the previous kernel.
    * Thus, we can avoid iterating over the entire kernel by comparing the
    * leading edge of the new kernel against the extrema found in the previous
    * kernel.   We must still scan the entire kernel if the previous extrema do
    * not fall within the current kernel or if we are starting a new row.
    */
@@ -3839,17 +3838,17 @@ public:
 
   NS_FORWARD_NSIDOMNODE(nsSVGFEConvolveMatrixElementBase::)
   NS_FORWARD_NSIDOMELEMENT(nsSVGFEConvolveMatrixElementBase::)
 
   virtual nsresult Clone(nsINodeInfo *aNodeInfo, nsINode **aResult) const;
 
 protected:
   virtual PRBool OperatesOnPremultipledAlpha() {
-    return !mBooleanAttributes[PRESERVEALPHA].GetAnimValue(this);
+    return !mBooleanAttributes[PRESERVEALPHA].GetAnimValue();
   }
 
   virtual NumberAttributesInfo GetNumberInfo();
   virtual IntegerAttributesInfo GetIntegerInfo();
   virtual BooleanAttributesInfo GetBooleanInfo();
   virtual EnumAttributesInfo GetEnumInfo();
   virtual StringAttributesInfo GetStringInfo();
 
@@ -4184,40 +4183,39 @@ nsSVGFEConvolveMatrixElement::Filter(nsS
     nsCOMPtr<nsIDOMSVGNumber> number;
     list->GetItem(i, getter_AddRefs(number));
     // svg specification flips the kernel from what one might expect
     number->GetValue(&kernel[num - 1 - i]);
   }
 
   float divisor;
   if (HasAttr(kNameSpaceID_None, nsGkAtoms::divisor)) {
-    divisor = mNumberAttributes[DIVISOR].GetAnimValue(this);
+    divisor = mNumberAttributes[DIVISOR].GetAnimValue();
     if (divisor == 0)
       return NS_ERROR_FAILURE;
   } else {
     divisor = kernel[0];
     for (PRUint32 i = 1; i < num; i++)
       divisor += kernel[i];
     if (divisor == 0)
       divisor = 1;
   }
 
   ScaleInfo info = SetupScalingFilter(instance, aSources[0], aTarget, rect,
                                       &mNumberAttributes[KERNEL_UNIT_LENGTH_X],
-                                      &mNumberAttributes[KERNEL_UNIT_LENGTH_Y],
-                                      this);
+                                      &mNumberAttributes[KERNEL_UNIT_LENGTH_Y]);
   if (!info.mTarget)
     return NS_ERROR_FAILURE;
 
-  PRUint16 edgeMode = mEnumAttributes[EDGEMODE].GetAnimValue(this);
-  PRBool preserveAlpha = mBooleanAttributes[PRESERVEALPHA].GetAnimValue(this);
+  PRUint16 edgeMode = mEnumAttributes[EDGEMODE].GetAnimValue();
+  PRBool preserveAlpha = mBooleanAttributes[PRESERVEALPHA].GetAnimValue();
 
   float bias = 0;
   if (HasAttr(kNameSpaceID_None, nsGkAtoms::bias)) {
-    bias = mNumberAttributes[BIAS].GetAnimValue(this);
+    bias = mNumberAttributes[BIAS].GetAnimValue();
   }
 
   const nsIntRect& dataRect = info.mDataRect;
   PRInt32 stride = info.mSource->Stride();
   PRInt32 width = info.mSource->GetSize().width;
   PRInt32 height = info.mSource->GetSize().height;
   PRUint8 *sourceData = info.mSource->Data();
   PRUint8 *targetData = info.mTarget->Data();
@@ -4783,18 +4781,17 @@ GenerateNormal(float *N, const PRUint8 *
 nsresult
 nsSVGFELightingElement::Filter(nsSVGFilterInstance *instance,
                                const nsTArray<const Image*>& aSources,
                                const Image* aTarget,
                                const nsIntRect& rect)
 {
   ScaleInfo info = SetupScalingFilter(instance, aSources[0], aTarget, rect,
                                       &mNumberAttributes[KERNEL_UNIT_LENGTH_X],
-                                      &mNumberAttributes[KERNEL_UNIT_LENGTH_Y],
-                                      this);
+                                      &mNumberAttributes[KERNEL_UNIT_LENGTH_Y]);
   if (!info.mTarget)
     return NS_ERROR_FAILURE;
 
   nsCOMPtr<nsIDOMSVGFEDistantLightElement> distantLight;
   nsCOMPtr<nsIDOMSVGFEPointLightElement> pointLight;
   nsCOMPtr<nsIDOMSVGFESpotLightElement> spotLight;
 
   nsIFrame* frame = GetPrimaryFrame();
@@ -4857,17 +4854,17 @@ nsSVGFELightingElement::Filter(nsSVGFilt
     nsCOMPtr<nsIContent> spot = do_QueryInterface(spotLight);
     if (spot->HasAttr(kNameSpaceID_None, nsGkAtoms::limitingConeAngle)) {
       cosConeAngle = NS_MAX<double>(cos(limitingConeAngle * radPerDeg), 0.0);
     } else {
       cosConeAngle = 0;
     }
   }
 
-  float surfaceScale = mNumberAttributes[SURFACE_SCALE].GetAnimValue(this);
+  float surfaceScale = mNumberAttributes[SURFACE_SCALE].GetAnimValue();
 
   const nsIntRect& dataRect = info.mDataRect;
   PRInt32 stride = info.mSource->Stride();
   PRUint8 *sourceData = info.mSource->Data();
   PRUint8 *targetData = info.mTarget->Data();
   PRInt32 surfaceWidth = info.mSource->Width();
   PRInt32 surfaceHeight = info.mSource->Height();
   
@@ -5030,17 +5027,17 @@ nsSVGFEDiffuseLightingElement::GetKernel
 //----------------------------------------------------------------------
 // nsSVGElement methods
 
 void
 nsSVGFEDiffuseLightingElement::LightPixel(const float *N, const float *L,
                                           nscolor color, PRUint8 *targetData)
 {
   float diffuseNL =
-    mNumberAttributes[DIFFUSE_CONSTANT].GetAnimValue(this) * DOT(N, L);
+    mNumberAttributes[DIFFUSE_CONSTANT].GetAnimValue() * DOT(N, L);
 
   if (diffuseNL > 0) {
     targetData[GFX_ARGB32_OFFSET_B] =
       NS_MIN(PRUint32(diffuseNL * NS_GET_B(color)), 255U);
     targetData[GFX_ARGB32_OFFSET_G] =
       NS_MIN(PRUint32(diffuseNL * NS_GET_G(color)), 255U);
     targetData[GFX_ARGB32_OFFSET_R] =
       NS_MIN(PRUint32(diffuseNL * NS_GET_R(color)), 255U);
@@ -5160,17 +5157,17 @@ nsSVGFESpecularLightingElement::GetKerne
 // nsSVGElement methods
 
 nsresult
 nsSVGFESpecularLightingElement::Filter(nsSVGFilterInstance *instance,
                                        const nsTArray<const Image*>& aSources,
                                        const Image* aTarget,
                                        const nsIntRect& rect)
 {
-  float specularExponent = mNumberAttributes[SPECULAR_EXPONENT].GetAnimValue(this);
+  float specularExponent = mNumberAttributes[SPECULAR_EXPONENT].GetAnimValue();
 
   // specification defined range (15.22)
   if (specularExponent < 1 || specularExponent > 128)
     return NS_ERROR_FAILURE;
 
   return nsSVGFESpecularLightingElementBase::Filter(instance, aSources, aTarget, rect);
 }
 
@@ -5180,22 +5177,22 @@ nsSVGFESpecularLightingElement::LightPix
                                            nscolor color, PRUint8 *targetData)
 {
   float H[3];
   H[0] = L[0];
   H[1] = L[1];
   H[2] = L[2] + 1;
   NORMALIZE(H);
 
-  float kS = mNumberAttributes[SPECULAR_CONSTANT].GetAnimValue(this);
+  float kS = mNumberAttributes[SPECULAR_CONSTANT].GetAnimValue();
   float dotNH = DOT(N, H);
 
   if (dotNH > 0 && kS > 0) {
     float specularNH =
-      kS * pow(dotNH, mNumberAttributes[SPECULAR_EXPONENT].GetAnimValue(this));
+      kS * pow(dotNH, mNumberAttributes[SPECULAR_EXPONENT].GetAnimValue());
 
     targetData[GFX_ARGB32_OFFSET_B] =
       NS_MIN(PRUint32(specularNH * NS_GET_B(color)), 255U);
     targetData[GFX_ARGB32_OFFSET_G] =
       NS_MIN(PRUint32(specularNH * NS_GET_G(color)), 255U);
     targetData[GFX_ARGB32_OFFSET_R] =
       NS_MIN(PRUint32(specularNH * NS_GET_R(color)), 255U);
 
@@ -5732,17 +5729,17 @@ nsSVGFEDisplacementMapElement::Filter(ns
                                       const Image* aTarget,
                                       const nsIntRect& rect)
 {
 #ifdef DEBUG_tor
   fprintf(stderr, "FILTER DISPLACEMENT rect: %d,%d  %dx%d\n",
           rect.x, rect.y, rect.width, rect.height);
 #endif
 
-  float scale = mNumberAttributes[SCALE].GetAnimValue(this);
+  float scale = mNumberAttributes[SCALE].GetAnimValue();
   if (scale == 0.0f) {
     CopyRect(aTarget, aSources[0], rect);
     return NS_OK;
   }
 
   PRInt32 width = instance->GetSurfaceWidth();
   PRInt32 height = instance->GetSurfaceHeight();
 
@@ -5756,18 +5753,18 @@ nsSVGFEDisplacementMapElement::Filter(ns
   scale = instance->GetPrimitiveLength(&val);
 
   static const PRUint16 channelMap[5] = {
                              0,
                              GFX_ARGB32_OFFSET_R,
                              GFX_ARGB32_OFFSET_G,
                              GFX_ARGB32_OFFSET_B,
                              GFX_ARGB32_OFFSET_A };
-  PRUint16 xChannel = channelMap[mEnumAttributes[CHANNEL_X].GetAnimValue(this)];
-  PRUint16 yChannel = channelMap[mEnumAttributes[CHANNEL_Y].GetAnimValue(this)];
+  PRUint16 xChannel = channelMap[mEnumAttributes[CHANNEL_X].GetAnimValue()];
+  PRUint16 yChannel = channelMap[mEnumAttributes[CHANNEL_Y].GetAnimValue()];
 
   double scaleOver255 = scale / 255.0;
   double scaleAdjustment = 0.5 - 0.5 * scale;
 
   for (PRInt32 y = rect.y; y < rect.YMost(); y++) {
     for (PRInt32 x = rect.x; x < rect.XMost(); x++) {
       PRUint32 targIndex = y * stride + 4 * x;
       // At some point we might want to replace this with a bilinear sample.
--- a/content/svg/content/src/nsSVGFilters.h
+++ b/content/svg/content/src/nsSVGFilters.h
@@ -108,18 +108,17 @@ protected:
     nsIntRect mDataRect; // rect in mSource and mTarget to operate on
     PRPackedBool mRescaling;
   };
 
   ScaleInfo SetupScalingFilter(nsSVGFilterInstance *aInstance,
                                const Image *aSource,
                                const Image *aTarget,
                                const nsIntRect& aDataRect,
-                               nsSVGNumber2 *aUnitX, nsSVGNumber2 *aUnitY,
-                               nsSVGElement *aElement);
+                               nsSVGNumber2 *aUnitX, nsSVGNumber2 *aUnitY);
 
   void FinishScalingFilter(ScaleInfo *aScaleInfo);
 
 public:
   ColorModel
   GetInputColorModel(nsSVGFilterInstance* aInstance, PRUint32 aInputIndex,
                      Image* aImage) {
     return ColorModel(
--- a/content/svg/content/src/nsSVGInteger.h
+++ b/content/svg/content/src/nsSVGInteger.h
@@ -56,23 +56,18 @@ public:
                               PRBool aDoSetAttr);
   void GetBaseValueString(nsAString& aValue);
 
   void SetBaseValue(PRInt32 aValue, nsSVGElement *aSVGElement, PRBool aDoSetAttr);
   PRInt32 GetBaseValue() const
     { return mBaseVal; }
 
   void SetAnimValue(int aValue, nsSVGElement *aSVGElement);
-  int GetAnimValue(nsSVGElement *aSVGElement) const
-  {
-  #ifdef MOZ_SMIL
-    aSVGElement->FlushAnimations();
-  #endif
-    return mAnimVal;
-  }
+  int GetAnimValue() const
+    { return mAnimVal; }
   
   nsresult ToDOMAnimatedInteger(nsIDOMSVGAnimatedInteger **aResult,
                                 nsSVGElement* aSVGElement);
 #ifdef MOZ_SMIL
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 #endif // MOZ_SMIL
   
@@ -93,19 +88,27 @@ private:
 
     nsSVGInteger* mVal; // kept alive because it belongs to content
     nsRefPtr<nsSVGElement> mSVGElement;
 
     NS_IMETHOD GetBaseVal(PRInt32* aResult)
       { *aResult = mVal->GetBaseValue(); return NS_OK; }
     NS_IMETHOD SetBaseVal(PRInt32 aValue)
       { mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE); return NS_OK; }
+
+    // Script may have modified animation parameters or timeline -- DOM getters
+    // need to flush any resample requests to reflect these modifications.
     NS_IMETHOD GetAnimVal(PRInt32* aResult)
-      { *aResult = mVal->GetAnimValue(mSVGElement); return NS_OK; }
-
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aResult = mVal->GetAnimValue();
+      return NS_OK;
+    }
   };
 
 #ifdef MOZ_SMIL
   struct SMILInteger : public nsISMILAttr
   {
   public:
     SMILInteger(nsSVGInteger* aVal, nsSVGElement* aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
--- a/content/svg/content/src/nsSVGLength2.h
+++ b/content/svg/content/src/nsSVGLength2.h
@@ -70,22 +70,17 @@ public:
                               nsSVGElement *aSVGElement,
                               PRBool aDoSetAttr);
   void GetBaseValueString(nsAString& aValue);
   void GetAnimValueString(nsAString& aValue);
 
   float GetBaseValue(nsSVGElement* aSVGElement) const
     { return mBaseVal / GetUnitScaleFactor(aSVGElement, mSpecifiedUnitType); }
   float GetAnimValue(nsSVGElement* aSVGElement) const
-  {
-  #ifdef MOZ_SMIL
-    aSVGElement->FlushAnimations();
-  #endif
-    return mAnimVal / GetUnitScaleFactor(aSVGElement, mSpecifiedUnitType);
-  }
+    { return mAnimVal / GetUnitScaleFactor(aSVGElement, mSpecifiedUnitType); }
   float GetAnimValue(nsIFrame* aFrame) const
     { return mAnimVal / GetUnitScaleFactor(aFrame, mSpecifiedUnitType); }
 
   PRUint8 GetCtxType() const { return mCtxType; }
   PRUint8 GetSpecifiedUnitType() const { return mSpecifiedUnitType; }
   PRBool IsPercentage() const
     { return mSpecifiedUnitType == nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE; }
   float GetAnimValInSpecifiedUnits() const { return mAnimVal; }
@@ -193,16 +188,18 @@ private:
 
     DOMAnimVal(nsSVGLength2* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     virtual ~DOMAnimVal();
     
     nsSVGLength2* mVal; // kept alive because it belongs to mSVGElement
     nsRefPtr<nsSVGElement> mSVGElement;
     
+    // Script may have modified animation parameters or timeline -- DOM getters
+    // need to flush any resample requests to reflect these modifications.
     NS_IMETHOD GetUnitType(PRUint16* aResult)
     {
 #ifdef MOZ_SMIL
       mSVGElement->FlushAnimations();
 #endif
       *aResult = mVal->mSpecifiedUnitType;
       return NS_OK;
     }
--- a/content/svg/content/src/nsSVGMarkerElement.cpp
+++ b/content/svg/content/src/nsSVGMarkerElement.cpp
@@ -378,17 +378,17 @@ nsSVGMarkerElement::GetPreserveAspectRat
 //----------------------------------------------------------------------
 // public helpers
 
 gfxMatrix
 nsSVGMarkerElement::GetMarkerTransform(float aStrokeWidth,
                                        float aX, float aY, float aAutoAngle)
 {
   float scale = 1.0;
-  if (mEnumAttributes[MARKERUNITS].GetAnimValue(this) ==
+  if (mEnumAttributes[MARKERUNITS].GetAnimValue() ==
       SVG_MARKERUNITS_STROKEWIDTH)
     scale = aStrokeWidth;
 
   float angle = mOrientType.GetAnimValue() == SVG_MARKER_ORIENT_AUTO ?
                 aAutoAngle :
                 mAngleAttributes[ORIENT].GetAnimValue() * M_PI / 180.0;
 
   return gfxMatrix(cos(angle) * scale,   sin(angle) * scale,
@@ -400,17 +400,17 @@ gfxMatrix
 nsSVGMarkerElement::GetViewBoxTransform()
 {
   if (!mViewBoxToViewportTransform) {
     float viewportWidth =
       mLengthAttributes[MARKERWIDTH].GetAnimValue(mCoordCtx);
     float viewportHeight = 
       mLengthAttributes[MARKERHEIGHT].GetAnimValue(mCoordCtx);
    
-    const nsSVGViewBoxRect& viewbox = mViewBox.GetAnimValue(this); 
+    const nsSVGViewBoxRect& viewbox = mViewBox.GetAnimValue(); 
 
     if (viewbox.width <= 0.0f || viewbox.height <= 0.0f) {
       return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // invalid - don't paint element
     }
 
     float refX = mLengthAttributes[REFX].GetAnimValue(mCoordCtx);
     float refY = mLengthAttributes[REFY].GetAnimValue(mCoordCtx);
 
--- a/content/svg/content/src/nsSVGNumber2.h
+++ b/content/svg/content/src/nsSVGNumber2.h
@@ -62,23 +62,18 @@ public:
                               nsSVGElement *aSVGElement,
                               PRBool aDoSetAttr);
   void GetBaseValueString(nsAString& aValue);
 
   void SetBaseValue(float aValue, nsSVGElement *aSVGElement, PRBool aDoSetAttr);
   float GetBaseValue() const
     { return mBaseVal; }
   void SetAnimValue(float aValue, nsSVGElement *aSVGElement);
-  float GetAnimValue(nsSVGElement *aSVGElement) const
-  {
-  #ifdef MOZ_SMIL
-    aSVGElement->FlushAnimations();
-  #endif
-    return mAnimVal;
-  }
+  float GetAnimValue() const
+    { return mAnimVal; }
 
   nsresult ToDOMAnimatedNumber(nsIDOMSVGAnimatedNumber **aResult,
                                nsSVGElement* aSVGElement);
 #ifdef MOZ_SMIL
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 #endif // MOZ_SMIL
 
@@ -103,19 +98,27 @@ private:
     NS_IMETHOD GetBaseVal(float* aResult)
       { *aResult = mVal->GetBaseValue(); return NS_OK; }
     NS_IMETHOD SetBaseVal(float aValue)
       {
         NS_ENSURE_FINITE(aValue, NS_ERROR_ILLEGAL_VALUE);
         mVal->SetBaseValue(aValue, mSVGElement, PR_TRUE);
         return NS_OK;
       }
+
+    // Script may have modified animation parameters or timeline -- DOM getters
+    // need to flush any resample requests to reflect these modifications.
     NS_IMETHOD GetAnimVal(float* aResult)
-      { *aResult = mVal->GetAnimValue(mSVGElement); return NS_OK; }
-
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aResult = mVal->GetAnimValue();
+      return NS_OK;
+    }
   };
 
 #ifdef MOZ_SMIL
   struct SMILNumber : public nsISMILAttr
   {
   public:
     SMILNumber(nsSVGNumber2* aVal, nsSVGElement* aSVGElement)
     : mVal(aVal), mSVGElement(aSVGElement) {}
--- a/content/svg/content/src/nsSVGPathElement.cpp
+++ b/content/svg/content/src/nsSVGPathElement.cpp
@@ -119,17 +119,17 @@ nsSVGPathElement::GetPointAtLength(float
   NS_ENSURE_FINITE(distance, NS_ERROR_ILLEGAL_VALUE);
 
   nsRefPtr<gfxFlattenedPath> flat = GetFlattenedPath(gfxMatrix());
   if (!flat)
     return NS_ERROR_FAILURE;
 
   float totalLength = flat->GetLength();
   if (HasAttr(kNameSpaceID_None, nsGkAtoms::pathLength)) {
-    float pathLength = mPathLength.GetAnimValue(this);
+    float pathLength = mPathLength.GetAnimValue();
     distance *= totalLength / pathLength;
   }
   distance = NS_MAX(0.f,         distance);
   distance = NS_MIN(totalLength, distance);
 
   return NS_NewSVGPoint(_retval, flat->FindPoint(gfxPoint(distance, 0)));
 }
 
--- a/content/svg/content/src/nsSVGPreserveAspectRatio.h
+++ b/content/svg/content/src/nsSVGPreserveAspectRatio.h
@@ -104,23 +104,18 @@ public:
   void GetBaseValueString(nsAString& aValue);
 
   nsresult SetBaseAlign(PRUint16 aAlign, nsSVGElement *aSVGElement);
   nsresult SetBaseMeetOrSlice(PRUint16 aMeetOrSlice, nsSVGElement *aSVGElement);
   void SetAnimValue(PRUint64 aPackedValue, nsSVGElement *aSVGElement);
 
   const PreserveAspectRatio &GetBaseValue() const
     { return mBaseVal; }
-  const PreserveAspectRatio &GetAnimValue(nsSVGElement *aSVGElement) const
-  {
-#ifdef MOZ_SMIL
-    aSVGElement->FlushAnimations();
-#endif
-    return mAnimVal;
-  }
+  const PreserveAspectRatio &GetAnimValue() const
+    { return mAnimVal; }
 
   nsresult ToDOMAnimatedPreserveAspectRatio(
     nsIDOMSVGAnimatedPreserveAspectRatio **aResult,
     nsSVGElement* aSVGElement);
 #ifdef MOZ_SMIL
   // Returns a new nsISMILAttr object that the caller must delete
   nsISMILAttr* ToSMILAttr(nsSVGElement* aSVGElement);
 #endif // MOZ_SMIL
@@ -164,23 +159,37 @@ private:
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
 
     DOMAnimVal(nsSVGPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
     nsSVGPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement
     nsRefPtr<nsSVGElement> mSVGElement;
     
+    // Script may have modified animation parameters or timeline -- DOM getters
+    // need to flush any resample requests to reflect these modifications.
     NS_IMETHOD GetAlign(PRUint16* aAlign)
-      { *aAlign = mVal->GetAnimValue(mSVGElement).GetAlign(); return NS_OK; }
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aAlign = mVal->GetAnimValue().GetAlign();
+      return NS_OK;
+    }
     NS_IMETHOD SetAlign(PRUint16 aAlign)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
 
     NS_IMETHOD GetMeetOrSlice(PRUint16* aMeetOrSlice)
-      { *aMeetOrSlice = mVal->GetAnimValue(mSVGElement).GetMeetOrSlice(); return NS_OK; }
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aMeetOrSlice = mVal->GetAnimValue().GetMeetOrSlice();
+      return NS_OK;
+    }
     NS_IMETHOD SetMeetOrSlice(PRUint16 aValue)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
   };
 
   struct DOMAnimPAspectRatio : public nsIDOMSVGAnimatedPreserveAspectRatio
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimPAspectRatio)
--- a/content/svg/content/src/nsSVGSVGElement.cpp
+++ b/content/svg/content/src/nsSVGSVGElement.cpp
@@ -814,17 +814,17 @@ nsSVGSVGElement::GetTransformToElement(n
 
 //----------------------------------------------------------------------
 // nsIDOMSVGZoomAndPan methods
 
 /* attribute unsigned short zoomAndPan; */
 NS_IMETHODIMP
 nsSVGSVGElement::GetZoomAndPan(PRUint16 *aZoomAndPan)
 {
-  *aZoomAndPan = mEnumAttributes[ZOOMANDPAN].GetAnimValue(this);
+  *aZoomAndPan = mEnumAttributes[ZOOMANDPAN].GetAnimValue();
   return NS_OK;
 }
 
 NS_IMETHODIMP
 nsSVGSVGElement::SetZoomAndPan(PRUint16 aZoomAndPan)
 {
   if (aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE ||
       aZoomAndPan == nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY) {
@@ -984,17 +984,17 @@ nsSVGSVGElement::GetViewBoxTransform()
     viewportHeight = mLengthAttributes[HEIGHT].GetAnimValue(ctx);
   } else {
     viewportWidth = mViewportWidth;
     viewportHeight = mViewportHeight;
   }
 
   nsSVGViewBoxRect viewBox;
   if (mViewBox.IsValid()) {
-    viewBox = mViewBox.GetAnimValue(this);
+    viewBox = mViewBox.GetAnimValue();
   } else {
     viewBox.x = viewBox.y = 0.0f;
     viewBox.width  = viewportWidth;
     viewBox.height = viewportHeight;
   }
 
   if (viewBox.width <= 0.0f || viewBox.height <= 0.0f) {
     return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0); // singular
@@ -1109,17 +1109,17 @@ nsSVGSVGElement::InvalidateTransformNoti
 // nsSVGSVGElement
 
 float
 nsSVGSVGElement::GetLength(PRUint8 aCtxType)
 {
   float h, w;
 
   if (mViewBox.IsValid()) {
-    const nsSVGViewBoxRect& viewbox = mViewBox.GetAnimValue(this);
+    const nsSVGViewBoxRect& viewbox = mViewBox.GetAnimValue();
     w = viewbox.width;
     h = viewbox.height;
   } else {
     if (nsSVGUtils::IsInnerSVG(this)) {
       nsSVGSVGElement *ctx = GetCtx();
       w = mLengthAttributes[WIDTH].GetAnimValue(ctx);
       h = mLengthAttributes[HEIGHT].GetAnimValue(ctx);
     } else {
--- a/content/svg/content/src/nsSVGViewBox.cpp
+++ b/content/svg/content/src/nsSVGViewBox.cpp
@@ -98,25 +98,16 @@ NS_INTERFACE_MAP_END
 void
 nsSVGViewBox::Init()
 {
   mBaseVal = nsSVGViewBoxRect();
   mAnimVal = nsnull;
   mHasBaseVal = PR_FALSE;
 }
 
-const nsSVGViewBoxRect&
-nsSVGViewBox::GetAnimValue(nsSVGElement *aSVGElement) const
-{
-#ifdef MOZ_SMIL
-  aSVGElement->FlushAnimations();
-#endif
-  return mAnimVal ? *mAnimVal : mBaseVal;
-}
-
 void
 nsSVGViewBox::SetAnimValue(float aX, float aY, float aWidth, float aHeight,
                            nsSVGElement *aSVGElement)
 {
   if (!mAnimVal) {
     // it's okay if allocation fails - and no point in reporting that
     mAnimVal = new nsSVGViewBoxRect(aX, aY, aWidth, aHeight);
   } else {
--- a/content/svg/content/src/nsSVGViewBox.h
+++ b/content/svg/content/src/nsSVGViewBox.h
@@ -68,17 +68,18 @@ public:
   PRBool IsValid() const
     { return (mHasBaseVal || mAnimVal); }
 
   const nsSVGViewBoxRect& GetBaseValue() const
     { return mBaseVal; }
   void SetBaseValue(float aX, float aY, float aWidth, float aHeight,
                     nsSVGElement *aSVGElement, PRBool aDoSetAttr);
 
-  const nsSVGViewBoxRect& GetAnimValue(nsSVGElement *aSVGElement) const;
+  const nsSVGViewBoxRect& GetAnimValue() const
+    { return mAnimVal ? *mAnimVal : mBaseVal; }
   void SetAnimValue(float aX, float aY, float aWidth, float aHeight,
                     nsSVGElement *aSVGElement);
 
   nsresult SetBaseValueString(const nsAString& aValue,
                               nsSVGElement *aSVGElement,
                               PRBool aDoSetAttr);
   void GetBaseValueString(nsAString& aValue) const;
 
@@ -127,24 +128,50 @@ private:
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
 
     DOMAnimVal(nsSVGViewBox *aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     nsSVGViewBox* mVal; // kept alive because it belongs to content
     nsRefPtr<nsSVGElement> mSVGElement;
 
+    // Script may have modified animation parameters or timeline -- DOM getters
+    // need to flush any resample requests to reflect these modifications.
     NS_IMETHOD GetX(float *aX)
-      { *aX = mVal->GetAnimValue(mSVGElement).x; return NS_OK; }
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aX = mVal->GetAnimValue().x;
+      return NS_OK;
+    }
     NS_IMETHOD GetY(float *aY)
-      { *aY = mVal->GetAnimValue(mSVGElement).y; return NS_OK; }
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aY = mVal->GetAnimValue().y;
+      return NS_OK;
+    }
     NS_IMETHOD GetWidth(float *aWidth)
-      { *aWidth = mVal->GetAnimValue(mSVGElement).width; return NS_OK; }
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aWidth = mVal->GetAnimValue().width;
+      return NS_OK;
+    }
     NS_IMETHOD GetHeight(float *aHeight)
-      { *aHeight = mVal->GetAnimValue(mSVGElement).height; return NS_OK; }
+    {
+#ifdef MOZ_SMIL
+      mSVGElement->FlushAnimations();
+#endif
+      *aHeight = mVal->GetAnimValue().height;
+      return NS_OK;
+    }
 
     NS_IMETHOD SetX(float aX)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
     NS_IMETHOD SetY(float aY)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
     NS_IMETHOD SetWidth(float aWidth)
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
     NS_IMETHOD SetHeight(float aHeight)
--- a/layout/svg/base/src/nsSVGFilterFrame.cpp
+++ b/layout/svg/base/src/nsSVGFilterFrame.cpp
@@ -103,19 +103,19 @@ nsAutoFilterInstance::nsAutoFilterInstan
                                            const nsIntRect *aOverrideSourceBBox)
 {
   mTarget = do_QueryFrame(aTarget);
 
   nsSVGFilterElement *filter =
     static_cast<nsSVGFilterElement*>(aFilterFrame->GetContent());
 
   PRUint16 filterUnits =
-    filter->mEnumAttributes[nsSVGFilterElement::FILTERUNITS].GetAnimValue(filter);
+    filter->mEnumAttributes[nsSVGFilterElement::FILTERUNITS].GetAnimValue();
   PRUint16 primitiveUnits =
-    filter->mEnumAttributes[nsSVGFilterElement::PRIMITIVEUNITS].GetAnimValue(filter);
+    filter->mEnumAttributes[nsSVGFilterElement::PRIMITIVEUNITS].GetAnimValue();
 
   gfxRect bbox;
   if (aOverrideSourceBBox) {
     bbox = gfxRect(aOverrideSourceBBox->x, aOverrideSourceBBox->y,
                    aOverrideSourceBBox->width, aOverrideSourceBBox->height);
   } else {
     bbox = nsSVGUtils::GetBBox(aTarget);
   }
--- a/layout/svg/base/src/nsSVGGradientFrame.cpp
+++ b/layout/svg/base/src/nsSVGGradientFrame.cpp
@@ -188,17 +188,17 @@ nsSVGGradientFrame::GetGradientTransform
 }
 
 PRUint16
 nsSVGGradientFrame::GetSpreadMethod()
 {
   nsSVGGradientElement *element =
     GetGradientWithAttr(nsGkAtoms::spreadMethod, mContent);
 
-  return element->mEnumAttributes[nsSVGGradientElement::SPREADMETHOD].GetAnimValue(element);
+  return element->mEnumAttributes[nsSVGGradientElement::SPREADMETHOD].GetAnimValue();
 }
 
 //----------------------------------------------------------------------
 // nsSVGPaintServerFrame methods:
 
 PRBool
 nsSVGGradientFrame::SetupPaintServer(gfxContext *aContext,
                                      nsSVGGeometryFrame *aSource,
@@ -397,17 +397,17 @@ nsSVGGradientFrame::GetStopFrame(PRInt32
 
 PRUint16
 nsSVGGradientFrame::GetGradientUnits()
 {
   // This getter is called every time the others are called - maybe cache it?
 
   nsSVGGradientElement *element =
     GetGradientWithAttr(nsGkAtoms::gradientUnits, mContent);
-  return element->mEnumAttributes[nsSVGGradientElement::GRADIENTUNITS].GetAnimValue(element);
+  return element->mEnumAttributes[nsSVGGradientElement::GRADIENTUNITS].GetAnimValue();
 }
 
 // -------------------------------------------------------------------------
 // Linear Gradients
 // -------------------------------------------------------------------------
 
 #ifdef DEBUG
 NS_IMETHODIMP
--- a/layout/svg/base/src/nsSVGMaskFrame.cpp
+++ b/layout/svg/base/src/nsSVGMaskFrame.cpp
@@ -72,17 +72,17 @@ nsSVGMaskFrame::ComputeMaskAlpha(nsSVGRe
   gfxContext *gfx = aContext->GetGfxContext();
 
   gfx->PushGroup(gfxASurface::CONTENT_COLOR_ALPHA);
 
   {
     nsSVGMaskElement *mask = static_cast<nsSVGMaskElement*>(mContent);
 
     PRUint16 units =
-      mask->mEnumAttributes[nsSVGMaskElement::MASKUNITS].GetAnimValue(mask);
+      mask->mEnumAttributes[nsSVGMaskElement::MASKUNITS].GetAnimValue();
     gfxRect bbox;
     if (units == nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
       bbox = nsSVGUtils::GetBBox(aParent);
     }
 
     gfxRect maskArea = nsSVGUtils::GetRelativeRect(units,
       &mask->mLengthAttributes[nsSVGMaskElement::X], bbox, aParent);
 
--- a/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/base/src/nsSVGOuterSVGFrame.cpp
@@ -279,17 +279,17 @@ nsSVGOuterSVGFrame::GetIntrinsicRatio()
     }
     if (ratio.height < 0) {
       ratio.height = 0;
     }
     return ratio;
   }
 
   if (content->mViewBox.IsValid()) {
-    const nsSVGViewBoxRect viewbox = content->mViewBox.GetAnimValue(content);
+    const nsSVGViewBoxRect viewbox = content->mViewBox.GetAnimValue();
     float viewBoxWidth = viewbox.width;
     float viewBoxHeight = viewbox.height;
 
     if (viewBoxWidth < 0.0f) {
       viewBoxWidth = 0.0f;
     }
     if (viewBoxHeight < 0.0f) {
       viewBoxHeight = 0.0f;
--- a/layout/svg/base/src/nsSVGPatternFrame.cpp
+++ b/layout/svg/base/src/nsSVGPatternFrame.cpp
@@ -335,25 +335,25 @@ nsSVGPatternFrame::GetPatternFirstChild(
 }
 
 PRUint16
 nsSVGPatternFrame::GetPatternUnits()
 {
   // See if we need to get the value from another pattern
   nsSVGPatternElement *patternElement =
     GetPatternWithAttr(nsGkAtoms::patternUnits, mContent);
-  return patternElement->mEnumAttributes[nsSVGPatternElement::PATTERNUNITS].GetAnimValue(patternElement);
+  return patternElement->mEnumAttributes[nsSVGPatternElement::PATTERNUNITS].GetAnimValue();
 }
 
 PRUint16
 nsSVGPatternFrame::GetPatternContentUnits()
 {
   nsSVGPatternElement *patternElement =
     GetPatternWithAttr(nsGkAtoms::patternContentUnits, mContent);
-  return patternElement->mEnumAttributes[nsSVGPatternElement::PATTERNCONTENTUNITS].GetAnimValue(patternElement);
+  return patternElement->mEnumAttributes[nsSVGPatternElement::PATTERNCONTENTUNITS].GetAnimValue();
 }
 
 gfxMatrix
 nsSVGPatternFrame::GetPatternTransform()
 {
   nsSVGPatternElement *patternElement =
     GetPatternWithAttr(nsGkAtoms::patternTransform, mContent);
 
@@ -537,17 +537,17 @@ nsSVGPatternFrame::ConstructCTM(const gf
   } else {
     float scale = nsSVGUtils::MaxExpansion(callerCTM);
     tCTM.Scale(scale, scale);
   }
 
   nsSVGPatternElement *patternElement =
     static_cast<nsSVGPatternElement*>(mContent);
   gfxMatrix tm;
-  const nsSVGViewBoxRect viewBox = GetViewBox().GetAnimValue(patternElement);
+  const nsSVGViewBoxRect viewBox = GetViewBox().GetAnimValue();
 
   if (viewBox.height > 0.0f && viewBox.width > 0.0f) {
     nsSVGSVGElement *ctx = aTargetContent->GetCtx();
     float viewportWidth = GetWidth()->GetAnimValue(ctx);
     float viewportHeight = GetHeight()->GetAnimValue(ctx);
     gfxMatrix viewBoxTM = nsSVGUtils::GetViewBoxTransform(patternElement,
                                                           viewportWidth, viewportHeight,
                                                           viewBox.x, viewBox.y,
--- a/layout/svg/base/src/nsSVGTextPathFrame.cpp
+++ b/layout/svg/base/src/nsSVGTextPathFrame.cpp
@@ -182,17 +182,17 @@ nsSVGTextPathFrame::GetStartOffset()
 gfxFloat
 nsSVGTextPathFrame::GetPathScale() 
 {
   nsIFrame *pathFrame = GetPathFrame();
   if (!pathFrame)
     return 1.0;
 
   nsSVGPathElement *path = static_cast<nsSVGPathElement*>(pathFrame->GetContent());
-  float pl = path->mPathLength.GetAnimValue(path);
+  float pl = path->mPathLength.GetAnimValue();
 
   if (pl == 0.0f)
     return 1.0;
 
   nsRefPtr<gfxFlattenedPath> data = GetFlattenedPath(pathFrame);
   return data ? data->GetLength() / pl : 1.0; 
 }
 
--- a/layout/svg/base/src/nsSVGUtils.cpp
+++ b/layout/svg/base/src/nsSVGUtils.cpp
@@ -804,18 +804,18 @@ nsSVGUtils::GetViewBoxTransform(nsSVGEle
                                 float aViewboxX, float aViewboxY,
                                 float aViewboxWidth, float aViewboxHeight,
                                 const nsSVGPreserveAspectRatio &aPreserveAspectRatio,
                                 PRBool aIgnoreAlign)
 {
   NS_ASSERTION(aViewboxWidth > 0, "viewBox width must be greater than zero!");
   NS_ASSERTION(aViewboxHeight > 0, "viewBox height must be greater than zero!");
 
-  PRUint16 align = aPreserveAspectRatio.GetAnimValue(aElement).GetAlign();
-  PRUint16 meetOrSlice = aPreserveAspectRatio.GetAnimValue(aElement).GetMeetOrSlice();
+  PRUint16 align = aPreserveAspectRatio.GetAnimValue().GetAlign();
+  PRUint16 meetOrSlice = aPreserveAspectRatio.GetAnimValue().GetMeetOrSlice();
 
   // default to the defaults
   if (align == nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_UNKNOWN)
     align = nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_XMIDYMID;
   if (meetOrSlice == nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_UNKNOWN)
     meetOrSlice = nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET;
 
   // alignment disabled for this matrix setup
@@ -1432,17 +1432,17 @@ nsSVGUtils::MaxExpansion(const gfxMatrix
 }
 
 gfxMatrix
 nsSVGUtils::AdjustMatrixForUnits(const gfxMatrix &aMatrix,
                                  nsSVGEnum *aUnits,
                                  nsIFrame *aFrame)
 {
   if (aFrame &&
-      aUnits->GetAnimValue(static_cast<nsSVGElement*>(aFrame->GetContent())) ==
+      aUnits->GetAnimValue() ==
       nsIDOMSVGUnitTypes::SVG_UNIT_TYPE_OBJECTBOUNDINGBOX) {
     gfxRect bbox = GetBBox(aFrame);
     return gfxMatrix().Scale(bbox.Width(), bbox.Height()) *
            gfxMatrix().Translate(gfxPoint(bbox.X(), bbox.Y())) *
            aMatrix;
   }
   return aMatrix;
 }