Bug 619516 Patch 1: Rename nsSVGPreserveAspectRatio and its inner class to SVGAnimatedPreserveAspectRatio / SVGPreserveAspectRatio. r=jwatt a=roc
authorDaniel Holbert <dholbert@cs.stanford.edu>
Sun, 19 Dec 2010 16:45:29 -0800
changeset 59469 5ce6da5198708af69b07c504935ad7837fecbbe8
parent 59468 99b19e566bbfda6b74a7bafa34145c5e98de4b4d
child 59470 9235ac6b60533387bee0974fa730e928da9506c0
push id17637
push userdholbert@mozilla.com
push dateMon, 20 Dec 2010 00:53:32 +0000
treeherdermozilla-central@150af817b65d [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjwatt, roc
bugs619516
milestone2.0b9pre
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
Bug 619516 Patch 1: Rename nsSVGPreserveAspectRatio and its inner class to SVGAnimatedPreserveAspectRatio / SVGPreserveAspectRatio. r=jwatt a=roc
content/svg/content/src/nsSVGElement.h
content/svg/content/src/nsSVGPreserveAspectRatio.cpp
content/svg/content/src/nsSVGPreserveAspectRatio.h
layout/svg/base/src/nsSVGPatternFrame.h
layout/svg/base/src/nsSVGUtils.h
--- a/content/svg/content/src/nsSVGElement.h
+++ b/content/svg/content/src/nsSVGElement.h
@@ -63,27 +63,29 @@ class nsSVGSVGElement;
 class nsSVGLength2;
 class nsSVGNumber2;
 class nsSVGInteger;
 class nsSVGAngle;
 class nsSVGBoolean;
 class nsSVGEnum;
 struct nsSVGEnumMapping;
 class nsSVGViewBox;
-class nsSVGPreserveAspectRatio;
 class nsSVGString;
 struct gfxMatrix;
 namespace mozilla {
 class SVGAnimatedNumberList;
 class SVGNumberList;
 class SVGAnimatedLengthList;
 class SVGUserUnitList;
 class SVGAnimatedPointList;
 class SVGAnimatedPathSegList;
+class SVGAnimatedPreserveAspectRatio;
 }
+// XXXdholbert TEMPORARY TYPEDEF
+typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
 
 typedef nsStyledElement nsSVGElementBase;
 
 class nsSVGElement : public nsSVGElementBase,    // nsIContent
                      public nsISVGValueObserver  // :nsISupportsWeakReference
 {
 protected:
   nsSVGElement(already_AddRefed<nsINodeInfo> aNodeInfo);
--- a/content/svg/content/src/nsSVGPreserveAspectRatio.cpp
+++ b/content/svg/content/src/nsSVGPreserveAspectRatio.cpp
@@ -41,51 +41,56 @@
 #ifdef MOZ_SMIL
 #include "nsSMILValue.h"
 #include "SMILEnumType.h"
 #endif // MOZ_SMIL
 
 using namespace mozilla;
 
 ////////////////////////////////////////////////////////////////////////
-// nsSVGPreserveAspectRatio class
+// SVGAnimatedPreserveAspectRatio class
 
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION(
-  nsSVGPreserveAspectRatio::DOMBaseVal, mSVGElement)
+  SVGAnimatedPreserveAspectRatio::DOMBaseVal, mSVGElement)
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION(
-  nsSVGPreserveAspectRatio::DOMAnimVal, mSVGElement)
+  SVGAnimatedPreserveAspectRatio::DOMAnimVal, mSVGElement)
 NS_SVG_VAL_IMPL_CYCLE_COLLECTION(
-  nsSVGPreserveAspectRatio::DOMAnimPAspectRatio, mSVGElement)
+  SVGAnimatedPreserveAspectRatio::DOMAnimPAspectRatio, mSVGElement)
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGPreserveAspectRatio::DOMBaseVal)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGPreserveAspectRatio::DOMBaseVal)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedPreserveAspectRatio::DOMBaseVal)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedPreserveAspectRatio::DOMBaseVal)
+
+NS_IMPL_CYCLE_COLLECTING_ADDREF(SVGAnimatedPreserveAspectRatio::DOMAnimVal)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(SVGAnimatedPreserveAspectRatio::DOMAnimVal)
 
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGPreserveAspectRatio::DOMAnimVal)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGPreserveAspectRatio::DOMAnimVal)
-
-NS_IMPL_CYCLE_COLLECTING_ADDREF(nsSVGPreserveAspectRatio::DOMAnimPAspectRatio)
-NS_IMPL_CYCLE_COLLECTING_RELEASE(nsSVGPreserveAspectRatio::DOMAnimPAspectRatio)
+NS_IMPL_CYCLE_COLLECTING_ADDREF(
+  SVGAnimatedPreserveAspectRatio::DOMAnimPAspectRatio)
+NS_IMPL_CYCLE_COLLECTING_RELEASE(
+  SVGAnimatedPreserveAspectRatio::DOMAnimPAspectRatio)
 
-DOMCI_DATA(SVGPreserveAspectRatio, nsSVGPreserveAspectRatio::DOMBaseVal)
+DOMCI_DATA(SVGPreserveAspectRatio, SVGAnimatedPreserveAspectRatio::DOMBaseVal)
 DOMCI_DATA(SVGAnimatedPreserveAspectRatio,
-           nsSVGPreserveAspectRatio::DOMAnimPAspectRatio)
+           SVGAnimatedPreserveAspectRatio::DOMAnimPAspectRatio)
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGPreserveAspectRatio::DOMBaseVal)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
+  SVGAnimatedPreserveAspectRatio::DOMBaseVal)
   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPreserveAspectRatio)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPreserveAspectRatio)
 NS_INTERFACE_MAP_END
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGPreserveAspectRatio::DOMAnimVal)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
+  SVGAnimatedPreserveAspectRatio::DOMAnimVal)
   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGPreserveAspectRatio)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGPreserveAspectRatio)
 NS_INTERFACE_MAP_END
 
-NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(nsSVGPreserveAspectRatio::DOMAnimPAspectRatio)
+NS_INTERFACE_MAP_BEGIN_CYCLE_COLLECTION(
+  SVGAnimatedPreserveAspectRatio::DOMAnimPAspectRatio)
   NS_INTERFACE_MAP_ENTRY(nsIDOMSVGAnimatedPreserveAspectRatio)
   NS_INTERFACE_MAP_ENTRY(nsISupports)
   NS_DOM_INTERFACE_MAP_ENTRY_CLASSINFO(SVGAnimatedPreserveAspectRatio)
 NS_INTERFACE_MAP_END
 
 /* Implementation */
 
 static const char *sAlignStrings[] =
@@ -140,55 +145,57 @@ GetMeetOrSliceString(nsAString& aMeetOrS
     "Unknown meetOrSlice");
 
   aMeetOrSliceString.AssignASCII(
     sMeetOrSliceStrings[aMeetOrSlice -
                         nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET]);
 }
 
 nsresult
-nsSVGPreserveAspectRatio::ToDOMBaseVal(nsIDOMSVGPreserveAspectRatio **aResult,
-                                       nsSVGElement *aSVGElement)
+SVGAnimatedPreserveAspectRatio::ToDOMBaseVal(
+  nsIDOMSVGPreserveAspectRatio **aResult,
+  nsSVGElement *aSVGElement)
 {
   *aResult = new DOMBaseVal(this, aSVGElement);
   if (!*aResult)
     return NS_ERROR_OUT_OF_MEMORY;
 
   NS_ADDREF(*aResult);
   return NS_OK;
 }
 
 nsresult
-nsSVGPreserveAspectRatio::ToDOMAnimVal(nsIDOMSVGPreserveAspectRatio **aResult,
-                                       nsSVGElement *aSVGElement)
+SVGAnimatedPreserveAspectRatio::ToDOMAnimVal(
+  nsIDOMSVGPreserveAspectRatio **aResult,
+  nsSVGElement *aSVGElement)
 {
   *aResult = new DOMAnimVal(this, aSVGElement);
   if (!*aResult)
     return NS_ERROR_OUT_OF_MEMORY;
 
   NS_ADDREF(*aResult);
   return NS_OK;
 }
 
 static nsresult
 ToPreserveAspectRatio(const nsAString &aString,
-                      nsSVGPreserveAspectRatio::PreserveAspectRatio *aValue)
+                      SVGPreserveAspectRatio *aValue)
 {
   if (aString.IsEmpty() || NS_IsAsciiWhitespace(aString[0])) {
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
 
   nsWhitespaceTokenizer tokenizer(aString);
   if (!tokenizer.hasMoreTokens()) {
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
   const nsAString &token = tokenizer.nextToken();
 
   nsresult rv;
-  nsSVGPreserveAspectRatio::PreserveAspectRatio val;
+  SVGPreserveAspectRatio val;
 
   val.SetDefer(token.EqualsLiteral("defer"));
 
   if (val.GetDefer()) {
     if (!tokenizer.hasMoreTokens()) {
       return NS_ERROR_DOM_SYNTAX_ERR;
     }
     rv = val.SetAlign(GetAlignForString(tokenizer.nextToken()));
@@ -213,21 +220,22 @@ ToPreserveAspectRatio(const nsAString &a
     return NS_ERROR_DOM_SYNTAX_ERR;
   }
 
   *aValue = val;
   return NS_OK;
 }
 
 nsresult
-nsSVGPreserveAspectRatio::SetBaseValueString(const nsAString &aValueAsString,
-                                             nsSVGElement *aSVGElement,
-                                             PRBool aDoSetAttr)
+SVGAnimatedPreserveAspectRatio::SetBaseValueString(
+  const nsAString &aValueAsString,
+  nsSVGElement *aSVGElement,
+  PRBool aDoSetAttr)
 {
-  PreserveAspectRatio val;
+  SVGPreserveAspectRatio val;
   nsresult res = ToPreserveAspectRatio(aValueAsString, &val);
   if (NS_FAILED(res)) {
     return res;
   }
 
   mBaseVal = val;
   if (!mIsAnimated) {
     mAnimVal = mBaseVal;
@@ -240,17 +248,17 @@ nsSVGPreserveAspectRatio::SetBaseValueSt
 
   // We don't need to call DidChange* here - we're only called by
   // nsSVGElement::ParseAttribute under nsGenericElement::SetAttr,
   // which takes care of notifying.
   return NS_OK;
 }
 
 void
-nsSVGPreserveAspectRatio::GetBaseValueString(nsAString & aValueAsString)
+SVGAnimatedPreserveAspectRatio::GetBaseValueString(nsAString & aValueAsString)
 {
   nsAutoString tmpString;
 
   aValueAsString.Truncate();
 
   if (mBaseVal.mDefer) {
     aValueAsString.AppendLiteral("defer ");
   }
@@ -263,130 +271,135 @@ nsSVGPreserveAspectRatio::GetBaseValueSt
 
     aValueAsString.AppendLiteral(" ");
     GetMeetOrSliceString(tmpString, mBaseVal.mMeetOrSlice);
     aValueAsString.Append(tmpString);
   }
 }
 
 nsresult
-nsSVGPreserveAspectRatio::SetBaseAlign(PRUint16 aAlign,
-                                       nsSVGElement *aSVGElement)
+SVGAnimatedPreserveAspectRatio::SetBaseAlign(PRUint16 aAlign,
+                                             nsSVGElement *aSVGElement)
 {
   nsresult rv = mBaseVal.SetAlign(aAlign);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mAnimVal.mAlign = mBaseVal.mAlign;
   aSVGElement->DidChangePreserveAspectRatio(PR_TRUE);
 #ifdef MOZ_SMIL
   if (mIsAnimated) {
     aSVGElement->AnimationNeedsResample();
   }
 #endif
   
   return NS_OK;
 }
 
 nsresult
-nsSVGPreserveAspectRatio::SetBaseMeetOrSlice(PRUint16 aMeetOrSlice,
-                                             nsSVGElement *aSVGElement)
+SVGAnimatedPreserveAspectRatio::SetBaseMeetOrSlice(PRUint16 aMeetOrSlice,
+                                                   nsSVGElement *aSVGElement)
 {
   nsresult rv = mBaseVal.SetMeetOrSlice(aMeetOrSlice);
   NS_ENSURE_SUCCESS(rv, rv);
 
   mAnimVal.mMeetOrSlice = mBaseVal.mMeetOrSlice;
   aSVGElement->DidChangePreserveAspectRatio(PR_TRUE);
 #ifdef MOZ_SMIL
   if (mIsAnimated) {
     aSVGElement->AnimationNeedsResample();
   }
 #endif
   
   return NS_OK;
 }
 
 void
-nsSVGPreserveAspectRatio::SetAnimValue(PRUint64 aPackedValue, nsSVGElement *aSVGElement)
+SVGAnimatedPreserveAspectRatio::SetAnimValue(PRUint64 aPackedValue,
+                                             nsSVGElement *aSVGElement)
 {
   mAnimVal.SetDefer(((aPackedValue & 0xff0000) >> 16) ? PR_TRUE : PR_FALSE);
   mAnimVal.SetAlign(PRUint16((aPackedValue & 0xff00) >> 8));
   mAnimVal.SetMeetOrSlice(PRUint16(aPackedValue & 0xff));
   mIsAnimated = PR_TRUE;
   aSVGElement->DidAnimatePreserveAspectRatio();
 }
 
 nsresult
-nsSVGPreserveAspectRatio::ToDOMAnimatedPreserveAspectRatio(
+SVGAnimatedPreserveAspectRatio::ToDOMAnimatedPreserveAspectRatio(
   nsIDOMSVGAnimatedPreserveAspectRatio **aResult,
   nsSVGElement *aSVGElement)
 {
   *aResult = new DOMAnimPAspectRatio(this, aSVGElement);
   if (!*aResult)
     return NS_ERROR_OUT_OF_MEMORY;
 
   NS_ADDREF(*aResult);
   return NS_OK;
 }
 
 #ifdef MOZ_SMIL
 nsISMILAttr*
-nsSVGPreserveAspectRatio::ToSMILAttr(nsSVGElement *aSVGElement)
+SVGAnimatedPreserveAspectRatio::ToSMILAttr(nsSVGElement *aSVGElement)
 {
   return new SMILPreserveAspectRatio(this, aSVGElement);
 }
 
 static PRUint64
-PackPreserveAspectRatio(const nsSVGPreserveAspectRatio::PreserveAspectRatio& par)
+PackPreserveAspectRatio(const SVGPreserveAspectRatio& par)
 {
   // All preserveAspectRatio values are enum values (do not interpolate), so we
   // can safely collate them and treat them as a single enum as for SMIL.
   PRUint64 packed = 0;
   packed |= PRUint64(par.GetDefer() ? 1 : 0) << 16;
   packed |= PRUint64(par.GetAlign()) << 8;
   packed |= PRUint64(par.GetMeetOrSlice());
   return packed;
 }
 
+// typedef for inner class, to make function signatures shorter below:
+typedef SVGAnimatedPreserveAspectRatio::SMILPreserveAspectRatio
+  SMILPreserveAspectRatio;
+
 nsresult
-nsSVGPreserveAspectRatio::SMILPreserveAspectRatio
-                        ::ValueFromString(const nsAString& aStr,
-                                          const nsISMILAnimationElement* /*aSrcElement*/,
-                                          nsSMILValue& aValue,
-                                          PRBool& aPreventCachingOfSandwich) const
+SMILPreserveAspectRatio::ValueFromString(const nsAString& aStr,
+                                         const nsISMILAnimationElement* /*aSrcElement*/,
+                                         nsSMILValue& aValue,
+                                         PRBool& aPreventCachingOfSandwich) const
 {
-  PreserveAspectRatio par;
+  SVGPreserveAspectRatio par;
   nsresult res = ToPreserveAspectRatio(aStr, &par);
   NS_ENSURE_SUCCESS(res, res);
 
   nsSMILValue val(&SMILEnumType::sSingleton);
   val.mU.mUint = PackPreserveAspectRatio(par);
   aValue = val;
   aPreventCachingOfSandwich = PR_FALSE;
   return NS_OK;
 }
 
 nsSMILValue
-nsSVGPreserveAspectRatio::SMILPreserveAspectRatio::GetBaseValue() const
+SMILPreserveAspectRatio::GetBaseValue() const
 {
   nsSMILValue val(&SMILEnumType::sSingleton);
   val.mU.mUint = PackPreserveAspectRatio(mVal->GetBaseValue());
   return val;
 }
 
 void
-nsSVGPreserveAspectRatio::SMILPreserveAspectRatio::ClearAnimValue()
+SMILPreserveAspectRatio::ClearAnimValue()
 {
   if (mVal->mIsAnimated) {
-    mVal->SetAnimValue(PackPreserveAspectRatio(mVal->GetBaseValue()), mSVGElement);
+    mVal->SetAnimValue(PackPreserveAspectRatio(mVal->GetBaseValue()),
+                       mSVGElement);
     mVal->mIsAnimated = PR_FALSE;
   }
 }
 
 nsresult
-nsSVGPreserveAspectRatio::SMILPreserveAspectRatio::SetAnimValue(const nsSMILValue& aValue)
+SMILPreserveAspectRatio::SetAnimValue(const nsSMILValue& aValue)
 {
   NS_ASSERTION(aValue.mType == &SMILEnumType::sSingleton,
                "Unexpected type to assign animated value");
   if (aValue.mType == &SMILEnumType::sSingleton) {
     mVal->SetAnimValue(aValue.mU.mUint, mSVGElement);
   }
   return NS_OK;
 }
--- a/content/svg/content/src/nsSVGPreserveAspectRatio.h
+++ b/content/svg/content/src/nsSVGPreserveAspectRatio.h
@@ -39,62 +39,66 @@
 #ifndef __NS_SVGPRESERVEASPECTRATIO_H__
 #define __NS_SVGPRESERVEASPECTRATIO_H__
 
 #include "nsIDOMSVGPresAspectRatio.h"
 #include "nsIDOMSVGAnimPresAspRatio.h"
 #include "nsSVGElement.h"
 #include "nsDOMError.h"
 
-class nsSVGPreserveAspectRatio
+namespace mozilla {
+
+class SVGAnimatedPreserveAspectRatio;
+
+class SVGPreserveAspectRatio
+{
+  friend class SVGAnimatedPreserveAspectRatio;
+
+public:
+  nsresult SetAlign(PRUint16 aAlign) {
+    if (aAlign < nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE ||
+        aAlign > nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_XMAXYMAX)
+      return NS_ERROR_FAILURE;
+    mAlign = static_cast<PRUint8>(aAlign);
+    return NS_OK;
+  };
+
+  PRUint16 GetAlign() const {
+    return mAlign;
+  };
+
+  nsresult SetMeetOrSlice(PRUint16 aMeetOrSlice) {
+    if (aMeetOrSlice < nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET ||
+        aMeetOrSlice > nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_SLICE)
+      return NS_ERROR_FAILURE;
+    mMeetOrSlice = static_cast<PRUint8>(aMeetOrSlice);
+    return NS_OK;
+  };
+
+  PRUint16 GetMeetOrSlice() const {
+    return mMeetOrSlice;
+  };
+
+  void SetDefer(PRBool aDefer) {
+    mDefer = aDefer;
+  };
+
+  PRBool GetDefer() const {
+    return mDefer;
+  };
+
+private:
+  PRUint8 mAlign;
+  PRUint8 mMeetOrSlice;
+  PRPackedBool mDefer;
+};
+
+class SVGAnimatedPreserveAspectRatio
 {
 public:
-  class PreserveAspectRatio
-  {
-  friend class nsSVGPreserveAspectRatio;
-
-  public:
-    nsresult SetAlign(PRUint16 aAlign) {
-      if (aAlign < nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_NONE ||
-          aAlign > nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_XMAXYMAX)
-        return NS_ERROR_FAILURE;
-      mAlign = static_cast<PRUint8>(aAlign);
-      return NS_OK;
-    };
-
-    PRUint16 GetAlign() const {
-      return mAlign;
-    };
-
-    nsresult SetMeetOrSlice(PRUint16 aMeetOrSlice) {
-      if (aMeetOrSlice < nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET ||
-          aMeetOrSlice > nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_SLICE)
-        return NS_ERROR_FAILURE;
-      mMeetOrSlice = static_cast<PRUint8>(aMeetOrSlice);
-      return NS_OK;
-    };
-
-    PRUint16 GetMeetOrSlice() const {
-      return mMeetOrSlice;
-    };
-
-    void SetDefer(PRBool aDefer) {
-      mDefer = aDefer;
-    };
-
-    PRBool GetDefer() const {
-      return mDefer;
-    };
-
-  private:
-    PRUint8 mAlign;
-    PRUint8 mMeetOrSlice;
-    PRPackedBool mDefer;
-  };
-
   void Init() {
     mBaseVal.mAlign = nsIDOMSVGPreserveAspectRatio::SVG_PRESERVEASPECTRATIO_XMIDYMID;
     mBaseVal.mMeetOrSlice = nsIDOMSVGPreserveAspectRatio::SVG_MEETORSLICE_MEET;
     mBaseVal.mDefer = PR_FALSE;
     mAnimVal = mBaseVal;
     mIsAnimated = PR_FALSE;
   }
 
@@ -102,50 +106,50 @@ public:
                               nsSVGElement *aSVGElement,
                               PRBool aDoSetAttr);
   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
+  const SVGPreserveAspectRatio &GetBaseValue() const
     { return mBaseVal; }
-  const PreserveAspectRatio &GetAnimValue() const
+  const SVGPreserveAspectRatio &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
 
 private:
 
-  PreserveAspectRatio mAnimVal;
-  PreserveAspectRatio mBaseVal;
+  SVGPreserveAspectRatio mAnimVal;
+  SVGPreserveAspectRatio mBaseVal;
   PRPackedBool mIsAnimated;
 
   nsresult ToDOMBaseVal(nsIDOMSVGPreserveAspectRatio **aResult,
                         nsSVGElement* aSVGElement);
   nsresult ToDOMAnimVal(nsIDOMSVGPreserveAspectRatio **aResult,
                         nsSVGElement* aSVGElement);
 
 public:
   struct DOMBaseVal : public nsIDOMSVGPreserveAspectRatio
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMBaseVal)
 
-    DOMBaseVal(nsSVGPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
+    DOMBaseVal(SVGAnimatedPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
-    nsSVGPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement
+    SVGAnimatedPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement
     nsRefPtr<nsSVGElement> mSVGElement;
     
     NS_IMETHOD GetAlign(PRUint16* aAlign)
       { *aAlign = mVal->GetBaseValue().GetAlign(); return NS_OK; }
     NS_IMETHOD SetAlign(PRUint16 aAlign)
       { return mVal->SetBaseAlign(aAlign, mSVGElement); }
 
     NS_IMETHOD GetMeetOrSlice(PRUint16* aMeetOrSlice)
@@ -154,20 +158,20 @@ public:
       { return mVal->SetBaseMeetOrSlice(aMeetOrSlice, mSVGElement); }
   };
 
   struct DOMAnimVal : public nsIDOMSVGPreserveAspectRatio
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimVal)
 
-    DOMAnimVal(nsSVGPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
+    DOMAnimVal(SVGAnimatedPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
     
-    nsSVGPreserveAspectRatio* mVal; // kept alive because it belongs to mSVGElement
+    SVGAnimatedPreserveAspectRatio* 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)
     {
 #ifdef MOZ_SMIL
       mSVGElement->FlushAnimations();
@@ -190,47 +194,56 @@ public:
       { return NS_ERROR_DOM_NO_MODIFICATION_ALLOWED_ERR; }
   };
 
   struct DOMAnimPAspectRatio : public nsIDOMSVGAnimatedPreserveAspectRatio
   {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_CLASS(DOMAnimPAspectRatio)
 
-    DOMAnimPAspectRatio(nsSVGPreserveAspectRatio* aVal, nsSVGElement *aSVGElement)
+    DOMAnimPAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,
+                        nsSVGElement *aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
-    
-    nsSVGPreserveAspectRatio* mVal; // kept alive because it belongs to content
+
+    // kept alive because it belongs to content:
+    SVGAnimatedPreserveAspectRatio* mVal;
+
     nsRefPtr<nsSVGElement> mSVGElement;
 
     NS_IMETHOD GetBaseVal(nsIDOMSVGPreserveAspectRatio **aBaseVal)
       { return mVal->ToDOMBaseVal(aBaseVal, mSVGElement); }
 
     NS_IMETHOD GetAnimVal(nsIDOMSVGPreserveAspectRatio **aAnimVal)
       { return mVal->ToDOMAnimVal(aAnimVal, mSVGElement); }
   };
 
 #ifdef MOZ_SMIL
   struct SMILPreserveAspectRatio : public nsISMILAttr
   {
   public:
-    SMILPreserveAspectRatio(nsSVGPreserveAspectRatio* aVal, nsSVGElement* aSVGElement)
+    SMILPreserveAspectRatio(SVGAnimatedPreserveAspectRatio* aVal,
+                            nsSVGElement* aSVGElement)
       : mVal(aVal), mSVGElement(aSVGElement) {}
 
     // These will stay alive because a nsISMILAttr only lives as long
     // as the Compositing step, and DOM elements don't get a chance to
     // die during that.
-    nsSVGPreserveAspectRatio* mVal;
+    SVGAnimatedPreserveAspectRatio* mVal;
     nsSVGElement* mSVGElement;
 
     // nsISMILAttr methods
     virtual nsresult ValueFromString(const nsAString& aStr,
                                      const nsISMILAnimationElement* aSrcElement,
                                      nsSMILValue& aValue,
                                      PRBool& aPreventCachingOfSandwich) const;
     virtual nsSMILValue GetBaseValue() const;
     virtual void ClearAnimValue();
     virtual nsresult SetAnimValue(const nsSMILValue& aValue);
   };
 #endif // MOZ_SMIL
 };
 
+} // namespace mozilla
+
+// XXXdholbert TEMPORARY TYPEDEF
+typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
+
 #endif //__NS_SVGPRESERVEASPECTRATIO_H__
--- a/layout/svg/base/src/nsSVGPatternFrame.h
+++ b/layout/svg/base/src/nsSVGPatternFrame.h
@@ -38,23 +38,28 @@
 
 #ifndef __NS_SVGPATTERNFRAME_H__
 #define __NS_SVGPATTERNFRAME_H__
 
 #include "nsIDOMSVGMatrix.h"
 #include "nsSVGPaintServerFrame.h"
 #include "gfxMatrix.h"
 
-class nsSVGPreserveAspectRatio;
 class nsIFrame;
 class nsSVGLength2;
 class nsSVGElement;
 class gfxContext;
 class gfxASurface;
 
+// XXXdholbert TEMPORARY TYPEDEF
+namespace mozilla {
+class SVGAnimatedPreserveAspectRatio;
+}
+typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
+
 typedef nsSVGPaintServerFrame  nsSVGPatternFrameBase;
 
 /**
  * Patterns can refer to other patterns. We create an nsSVGPaintingProperty
  * with property type nsGkAtoms::href to track the referenced pattern.
  */
 class nsSVGPatternFrame : public nsSVGPatternFrameBase
 {
--- a/layout/svg/base/src/nsSVGUtils.h
+++ b/layout/svg/base/src/nsSVGUtils.h
@@ -57,17 +57,16 @@ class nsStyleContext;
 class nsStyleCoord;
 class nsFrameList;
 class nsIFrame;
 struct nsStyleSVGPaint;
 class nsIDOMSVGElement;
 class nsIDOMSVGLength;
 class nsIURI;
 class nsSVGOuterSVGFrame;
-class nsSVGPreserveAspectRatio;
 class nsIAtom;
 class nsSVGLength2;
 class nsSVGElement;
 class nsSVGSVGElement;
 class nsAttrValue;
 class gfxContext;
 class gfxASurface;
 class gfxPattern;
@@ -76,21 +75,25 @@ struct gfxSize;
 struct gfxIntSize;
 struct nsStyleFont;
 class nsSVGEnum;
 class nsISVGChildFrame;
 class nsSVGGeometryFrame;
 class nsSVGDisplayContainerFrame;
 
 namespace mozilla {
+class SVGAnimatedPreserveAspectRatio;
 namespace dom {
 class Element;
 } // namespace dom
 } // namespace mozilla
 
+// XXXdholbert TEMPORARY TYPEDEF
+typedef mozilla::SVGAnimatedPreserveAspectRatio nsSVGPreserveAspectRatio;
+
 #ifndef M_PI
 #define M_PI 3.14159265358979323846
 #endif
 
 // SVG Frame state bits
 #define NS_STATE_IS_OUTER_SVG                    NS_FRAME_STATE_BIT(20)
 
 #define NS_STATE_SVG_DIRTY                       NS_FRAME_STATE_BIT(21)