Bug 1540408 Part 3 - Rename SVGViewBoxRect to SVGViewBox r=dholbert
authorlongsonr <longsonr@gmail.com>
Wed, 10 Apr 2019 05:08:14 +0100
changeset 527535 0d9193a6224f7ac96209fa3d0824cf4a94fe8812
parent 527534 dc16ac6795e0a14b18172197470183978dd369e5
child 527536 a1eb490ba4480b756fcc4f92f8dbc753c66d7900
child 527627 fe062eac74d9d71fdb1fb3ebc8d75c2572f47c98
push id11265
push userffxbld-merge
push dateMon, 13 May 2019 10:53:39 +0000
treeherdermozilla-beta@77e0fe8dbdd3 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdholbert
bugs1540408
milestone68.0a1
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 1540408 Part 3 - Rename SVGViewBoxRect to SVGViewBox r=dholbert
dom/svg/SVGAnimatedViewBox.cpp
dom/svg/SVGAnimatedViewBox.h
dom/svg/SVGElement.cpp
dom/svg/SVGElement.h
dom/svg/SVGFEImageElement.cpp
dom/svg/SVGFEImageElement.h
dom/svg/SVGImageElement.cpp
dom/svg/SVGImageElement.h
dom/svg/SVGMarkerElement.cpp
dom/svg/SVGMarkerElement.h
dom/svg/SVGPatternElement.cpp
dom/svg/SVGPatternElement.h
dom/svg/SVGSVGElement.cpp
dom/svg/SVGViewBoxSMILType.cpp
dom/svg/SVGViewElement.cpp
dom/svg/SVGViewElement.h
dom/svg/SVGViewportElement.cpp
dom/svg/SVGViewportElement.h
layout/base/nsLayoutUtils.cpp
layout/svg/nsSVGMarkerFrame.cpp
layout/svg/nsSVGOuterSVGFrame.cpp
layout/svg/nsSVGPatternFrame.cpp
layout/svg/nsSVGViewportFrame.cpp
--- a/dom/svg/SVGAnimatedViewBox.cpp
+++ b/dom/svg/SVGAnimatedViewBox.cpp
@@ -14,29 +14,28 @@
 #include "nsTextFormatter.h"
 
 using namespace mozilla::dom;
 
 namespace mozilla {
 
 #define NUM_VIEWBOX_COMPONENTS 4
 
-/* Implementation of SVGViewBoxRect methods */
+/* Implementation of SVGViewBox methods */
 
-bool SVGViewBoxRect::operator==(const SVGViewBoxRect& aOther) const {
+bool SVGViewBox::operator==(const SVGViewBox& aOther) const {
   if (&aOther == this) return true;
 
   return (none && aOther.none) ||
          (!none && !aOther.none && x == aOther.x && y == aOther.y &&
           width == aOther.width && height == aOther.height);
 }
 
 /* static */
-nsresult SVGViewBoxRect::FromString(const nsAString& aStr,
-                                    SVGViewBoxRect* aViewBox) {
+nsresult SVGViewBox::FromString(const nsAString& aStr, SVGViewBox* aViewBox) {
   if (aStr.EqualsLiteral("none")) {
     aViewBox->none = true;
     return NS_OK;
   }
 
   nsCharSeparatedTokenizerTemplate<nsContentUtils::IsHTMLWhitespace> tokenizer(
       aStr, ',', nsCharSeparatedTokenizer::SEPARATOR_OPTIONAL);
   float vals[NUM_VIEWBOX_COMPONENTS];
@@ -102,43 +101,43 @@ void SVGAnimatedViewBox::Init() {
   mBaseVal.none = true;
 
   mAnimVal = nullptr;
 }
 
 bool SVGAnimatedViewBox::HasRect() const {
   // Check mAnimVal if we have one; otherwise, check mBaseVal if we have one;
   // otherwise, just return false (we clearly do not have a rect).
-  const SVGViewBoxRect* rect = mAnimVal;
+  const SVGViewBox* rect = mAnimVal;
   if (!rect) {
     if (!mHasBaseVal) {
       // no anim val, no base val --> no viewbox rect
       return false;
     }
     rect = &mBaseVal;
   }
 
   return !rect->none && rect->width >= 0 && rect->height >= 0;
 }
 
-void SVGAnimatedViewBox::SetAnimValue(const SVGViewBoxRect& aRect,
+void SVGAnimatedViewBox::SetAnimValue(const SVGViewBox& aRect,
                                       SVGElement* aSVGElement) {
   if (!mAnimVal) {
     // it's okay if allocation fails - and no point in reporting that
-    mAnimVal = new SVGViewBoxRect(aRect);
+    mAnimVal = new SVGViewBox(aRect);
   } else {
     if (aRect == *mAnimVal) {
       return;
     }
     *mAnimVal = aRect;
   }
   aSVGElement->DidAnimateViewBox();
 }
 
-void SVGAnimatedViewBox::SetBaseValue(const SVGViewBoxRect& aRect,
+void SVGAnimatedViewBox::SetBaseValue(const SVGViewBox& aRect,
                                       SVGElement* aSVGElement) {
   if (!mHasBaseVal || mBaseVal == aRect) {
     // This method is used to set a single x, y, width
     // or height value. It can't create a base value
     // as the other components may be undefined. We record
     // the new value though, so as not to lose data.
     mBaseVal = aRect;
     return;
@@ -153,19 +152,19 @@ void SVGAnimatedViewBox::SetBaseValue(co
   if (mAnimVal) {
     aSVGElement->AnimationNeedsResample();
   }
 }
 
 nsresult SVGAnimatedViewBox::SetBaseValueString(const nsAString& aValue,
                                                 SVGElement* aSVGElement,
                                                 bool aDoSetAttr) {
-  SVGViewBoxRect viewBox;
+  SVGViewBox viewBox;
 
-  nsresult rv = SVGViewBoxRect::FromString(aValue, &viewBox);
+  nsresult rv = SVGViewBox::FromString(aValue, &viewBox);
   if (NS_FAILED(rv)) {
     return rv;
   }
   // Comparison against mBaseVal is only valid if we currently have a base val.
   if (mHasBaseVal && viewBox == mBaseVal) {
     return NS_OK;
   }
 
@@ -242,77 +241,77 @@ already_AddRefed<SVGIRect> SVGAnimatedVi
   return domAnimVal.forget();
 }
 
 SVGAnimatedViewBox::DOMAnimVal::~DOMAnimVal() {
   sAnimSVGViewBoxTearoffTable.RemoveTearoff(mVal);
 }
 
 void SVGAnimatedViewBox::DOMBaseVal::SetX(float aX, ErrorResult& aRv) {
-  SVGViewBoxRect rect = mVal->GetBaseValue();
+  SVGViewBox rect = mVal->GetBaseValue();
   rect.x = aX;
   mVal->SetBaseValue(rect, mSVGElement);
 }
 
 void SVGAnimatedViewBox::DOMBaseVal::SetY(float aY, ErrorResult& aRv) {
-  SVGViewBoxRect rect = mVal->GetBaseValue();
+  SVGViewBox rect = mVal->GetBaseValue();
   rect.y = aY;
   mVal->SetBaseValue(rect, mSVGElement);
 }
 
 void SVGAnimatedViewBox::DOMBaseVal::SetWidth(float aWidth, ErrorResult& aRv) {
-  SVGViewBoxRect rect = mVal->GetBaseValue();
+  SVGViewBox rect = mVal->GetBaseValue();
   rect.width = aWidth;
   mVal->SetBaseValue(rect, mSVGElement);
 }
 
 void SVGAnimatedViewBox::DOMBaseVal::SetHeight(float aHeight,
                                                ErrorResult& aRv) {
-  SVGViewBoxRect rect = mVal->GetBaseValue();
+  SVGViewBox rect = mVal->GetBaseValue();
   rect.height = aHeight;
   mVal->SetBaseValue(rect, mSVGElement);
 }
 
 UniquePtr<SMILAttr> SVGAnimatedViewBox::ToSMILAttr(SVGElement* aSVGElement) {
   return MakeUnique<SMILViewBox>(this, aSVGElement);
 }
 
 nsresult SVGAnimatedViewBox::SMILViewBox ::ValueFromString(
     const nsAString& aStr, const SVGAnimationElement* /*aSrcElement*/,
     SMILValue& aValue, bool& aPreventCachingOfSandwich) const {
-  SVGViewBoxRect viewBox;
-  nsresult res = SVGViewBoxRect::FromString(aStr, &viewBox);
+  SVGViewBox viewBox;
+  nsresult res = SVGViewBox::FromString(aStr, &viewBox);
   if (NS_FAILED(res)) {
     return res;
   }
   SMILValue val(&SVGViewBoxSMILType::sSingleton);
-  *static_cast<SVGViewBoxRect*>(val.mU.mPtr) = viewBox;
+  *static_cast<SVGViewBox*>(val.mU.mPtr) = viewBox;
   aValue = std::move(val);
   aPreventCachingOfSandwich = false;
 
   return NS_OK;
 }
 
 SMILValue SVGAnimatedViewBox::SMILViewBox::GetBaseValue() const {
   SMILValue val(&SVGViewBoxSMILType::sSingleton);
-  *static_cast<SVGViewBoxRect*>(val.mU.mPtr) = mVal->mBaseVal;
+  *static_cast<SVGViewBox*>(val.mU.mPtr) = mVal->mBaseVal;
   return val;
 }
 
 void SVGAnimatedViewBox::SMILViewBox::ClearAnimValue() {
   if (mVal->mAnimVal) {
     mVal->mAnimVal = nullptr;
     mSVGElement->DidAnimateViewBox();
   }
 }
 
 nsresult SVGAnimatedViewBox::SMILViewBox::SetAnimValue(
     const SMILValue& aValue) {
   NS_ASSERTION(aValue.mType == &SVGViewBoxSMILType::sSingleton,
                "Unexpected type to assign animated value");
   if (aValue.mType == &SVGViewBoxSMILType::sSingleton) {
-    SVGViewBoxRect& vb = *static_cast<SVGViewBoxRect*>(aValue.mU.mPtr);
+    SVGViewBox& vb = *static_cast<SVGViewBox*>(aValue.mU.mPtr);
     mVal->SetAnimValue(vb, mSVGElement);
   }
   return NS_OK;
 }
 
 }  // namespace mozilla
--- a/dom/svg/SVGAnimatedViewBox.h
+++ b/dom/svg/SVGAnimatedViewBox.h
@@ -21,33 +21,33 @@ namespace mozilla {
 
 class SMILValue;
 
 namespace dom {
 class SVGAnimationElement;
 class SVGElement;
 }  // namespace dom
 
-struct SVGViewBoxRect {
+struct SVGViewBox {
   float x, y;
   float width, height;
   bool none;
 
-  SVGViewBoxRect() : x(0.0), y(0.0), width(0.0), height(0.0), none(true) {}
-  SVGViewBoxRect(float aX, float aY, float aWidth, float aHeight)
+  SVGViewBox() : x(0.0), y(0.0), width(0.0), height(0.0), none(true) {}
+  SVGViewBox(float aX, float aY, float aWidth, float aHeight)
       : x(aX), y(aY), width(aWidth), height(aHeight), none(false) {}
-  SVGViewBoxRect(const SVGViewBoxRect& rhs)
+  SVGViewBox(const SVGViewBox& rhs)
       : x(rhs.x),
         y(rhs.y),
         width(rhs.width),
         height(rhs.height),
         none(rhs.none) {}
-  bool operator==(const SVGViewBoxRect& aOther) const;
+  bool operator==(const SVGViewBox& aOther) const;
 
-  static nsresult FromString(const nsAString& aStr, SVGViewBoxRect* aViewBox);
+  static nsresult FromString(const nsAString& aStr, SVGViewBox* aViewBox);
 };
 
 class SVGAnimatedViewBox {
  public:
   typedef mozilla::dom::SVGElement SVGElement;
 
   void Init();
 
@@ -61,28 +61,28 @@ class SVGAnimatedViewBox {
   bool HasRect() const;
 
   /**
    * Returns true if the corresponding "viewBox" attribute either defined a
    * rectangle with finite values or the special "none" value.
    */
   bool IsExplicitlySet() const {
     if (mAnimVal || mHasBaseVal) {
-      const SVGViewBoxRect& rect = GetAnimValue();
+      const SVGViewBox& rect = GetAnimValue();
       return rect.none || (rect.width >= 0 && rect.height >= 0);
     }
     return false;
   }
 
-  const SVGViewBoxRect& GetBaseValue() const { return mBaseVal; }
-  void SetBaseValue(const SVGViewBoxRect& aRect, SVGElement* aSVGElement);
-  const SVGViewBoxRect& GetAnimValue() const {
+  const SVGViewBox& GetBaseValue() const { return mBaseVal; }
+  void SetBaseValue(const SVGViewBox& aRect, SVGElement* aSVGElement);
+  const SVGViewBox& GetAnimValue() const {
     return mAnimVal ? *mAnimVal : mBaseVal;
   }
-  void SetAnimValue(const SVGViewBoxRect& aRect, SVGElement* aSVGElement);
+  void SetAnimValue(const SVGViewBox& aRect, SVGElement* aSVGElement);
 
   nsresult SetBaseValueString(const nsAString& aValue, SVGElement* aSVGElement,
                               bool aDoSetAttr);
   void GetBaseValueString(nsAString& aValue) const;
 
   already_AddRefed<mozilla::dom::SVGAnimatedRect> ToSVGAnimatedRect(
       SVGElement* aSVGElement);
 
@@ -90,18 +90,18 @@ class SVGAnimatedViewBox {
       SVGElement* aSVGElement);
 
   already_AddRefed<mozilla::dom::SVGIRect> ToDOMAnimVal(
       SVGElement* aSVGElement);
 
   mozilla::UniquePtr<SMILAttr> ToSMILAttr(SVGElement* aSVGElement);
 
  private:
-  SVGViewBoxRect mBaseVal;
-  nsAutoPtr<SVGViewBoxRect> mAnimVal;
+  SVGViewBox mBaseVal;
+  nsAutoPtr<SVGViewBox> mAnimVal;
   bool mHasBaseVal;
 
  public:
   struct DOMBaseVal final : public mozilla::dom::SVGIRect {
     NS_DECL_CYCLE_COLLECTING_ISUPPORTS
     NS_DECL_CYCLE_COLLECTION_SCRIPT_HOLDER_CLASS(DOMBaseVal)
 
     DOMBaseVal(SVGAnimatedViewBox* aVal, SVGElement* aSVGElement)
--- a/dom/svg/SVGElement.cpp
+++ b/dom/svg/SVGElement.cpp
@@ -168,30 +168,30 @@ nsresult SVGElement::Init() {
   }
 
   EnumAttributesInfo enumInfo = GetEnumInfo();
 
   for (i = 0; i < enumInfo.mEnumCount; i++) {
     enumInfo.Reset(i);
   }
 
-  SVGAnimatedOrient* orient = GetOrient();
+  SVGAnimatedOrient* orient = GetAnimatedOrient();
 
   if (orient) {
     orient->Init();
   }
 
-  SVGAnimatedViewBox* viewBox = GetViewBox();
+  SVGAnimatedViewBox* viewBox = GetAnimatedViewBox();
 
   if (viewBox) {
     viewBox->Init();
   }
 
   SVGAnimatedPreserveAspectRatio* preserveAspectRatio =
-      GetPreserveAspectRatio();
+      GetAnimatedPreserveAspectRatio();
 
   if (preserveAspectRatio) {
     preserveAspectRatio->Init();
   }
 
   LengthListAttributesInfo lengthListInfo = GetLengthListInfo();
 
   for (i = 0; i < lengthListInfo.mLengthListCount; i++) {
@@ -527,44 +527,44 @@ bool SVGElement::ParseAttribute(int32_t 
           break;
         }
       }
     }
 
     if (!foundMatch) {
       // Check for orient attribute
       if (aAttribute == nsGkAtoms::orient) {
-        SVGAnimatedOrient* orient = GetOrient();
+        SVGAnimatedOrient* orient = GetAnimatedOrient();
         if (orient) {
           rv = orient->SetBaseValueString(aValue, this, false);
           if (NS_FAILED(rv)) {
             orient->Init();
           } else {
             aResult.SetTo(*orient, &aValue);
             didSetResult = true;
           }
           foundMatch = true;
         }
         // Check for viewBox attribute
       } else if (aAttribute == nsGkAtoms::viewBox) {
-        SVGAnimatedViewBox* viewBox = GetViewBox();
+        SVGAnimatedViewBox* viewBox = GetAnimatedViewBox();
         if (viewBox) {
           rv = viewBox->SetBaseValueString(aValue, this, false);
           if (NS_FAILED(rv)) {
             viewBox->Init();
           } else {
             aResult.SetTo(*viewBox, &aValue);
             didSetResult = true;
           }
           foundMatch = true;
         }
         // Check for preserveAspectRatio attribute
       } else if (aAttribute == nsGkAtoms::preserveAspectRatio) {
         SVGAnimatedPreserveAspectRatio* preserveAspectRatio =
-            GetPreserveAspectRatio();
+            GetAnimatedPreserveAspectRatio();
         if (preserveAspectRatio) {
           rv = preserveAspectRatio->SetBaseValueString(aValue, this, false);
           if (NS_FAILED(rv)) {
             preserveAspectRatio->Init();
           } else {
             aResult.SetTo(*preserveAspectRatio, &aValue);
             didSetResult = true;
           }
@@ -763,38 +763,38 @@ void SVGElement::UnsetAttrInternal(int32
       if (aName == enumInfo.mEnumInfo[i].mName) {
         enumInfo.Reset(i);
         return;
       }
     }
 
     // Check if this is an orient attribute going away
     if (aName == nsGkAtoms::orient) {
-      SVGAnimatedOrient* orient = GetOrient();
+      SVGAnimatedOrient* orient = GetAnimatedOrient();
       if (orient) {
         MaybeSerializeAttrBeforeRemoval(aName, aNotify);
         orient->Init();
         return;
       }
     }
 
     // Check if this is a viewBox attribute going away
     if (aName == nsGkAtoms::viewBox) {
-      SVGAnimatedViewBox* viewBox = GetViewBox();
+      SVGAnimatedViewBox* viewBox = GetAnimatedViewBox();
       if (viewBox) {
         MaybeSerializeAttrBeforeRemoval(aName, aNotify);
         viewBox->Init();
         return;
       }
     }
 
     // Check if this is a preserveAspectRatio attribute going away
     if (aName == nsGkAtoms::preserveAspectRatio) {
       SVGAnimatedPreserveAspectRatio* preserveAspectRatio =
-          GetPreserveAspectRatio();
+          GetAnimatedPreserveAspectRatio();
       if (preserveAspectRatio) {
         MaybeSerializeAttrBeforeRemoval(aName, aNotify);
         preserveAspectRatio->Init();
         return;
       }
     }
 
     // Check if this is a transform list attribute going away
@@ -1880,24 +1880,24 @@ void SVGElement::DidAnimateEnum(uint8_t 
 
   if (frame) {
     EnumAttributesInfo info = GetEnumInfo();
     frame->AttributeChanged(kNameSpaceID_None, info.mEnumInfo[aAttrEnum].mName,
                             MutationEvent_Binding::SMIL);
   }
 }
 
-SVGAnimatedOrient* SVGElement::GetOrient() { return nullptr; }
+SVGAnimatedOrient* SVGElement::GetAnimatedOrient() { return nullptr; }
 
 nsAttrValue SVGElement::WillChangeOrient() {
   return WillChangeValue(nsGkAtoms::orient);
 }
 
 void SVGElement::DidChangeOrient(const nsAttrValue& aEmptyOrOldValue) {
-  SVGAnimatedOrient* orient = GetOrient();
+  SVGAnimatedOrient* orient = GetAnimatedOrient();
 
   NS_ASSERTION(orient, "DidChangeOrient on element with no orient attrib");
 
   nsAttrValue newValue;
   newValue.SetTo(*orient, nullptr);
 
   DidChangeValue(nsGkAtoms::orient, aEmptyOrOldValue, newValue);
 }
@@ -1906,24 +1906,24 @@ void SVGElement::DidAnimateOrient() {
   nsIFrame* frame = GetPrimaryFrame();
 
   if (frame) {
     frame->AttributeChanged(kNameSpaceID_None, nsGkAtoms::orient,
                             MutationEvent_Binding::SMIL);
   }
 }
 
-SVGAnimatedViewBox* SVGElement::GetViewBox() { return nullptr; }
+SVGAnimatedViewBox* SVGElement::GetAnimatedViewBox() { return nullptr; }
 
 nsAttrValue SVGElement::WillChangeViewBox() {
   return WillChangeValue(nsGkAtoms::viewBox);
 }
 
 void SVGElement::DidChangeViewBox(const nsAttrValue& aEmptyOrOldValue) {
-  SVGAnimatedViewBox* viewBox = GetViewBox();
+  SVGAnimatedViewBox* viewBox = GetAnimatedViewBox();
 
   NS_ASSERTION(viewBox, "DidChangeViewBox on element with no viewBox attrib");
 
   nsAttrValue newValue;
   newValue.SetTo(*viewBox, nullptr);
 
   DidChangeValue(nsGkAtoms::viewBox, aEmptyOrOldValue, newValue);
 }
@@ -1932,28 +1932,28 @@ void SVGElement::DidAnimateViewBox() {
   nsIFrame* frame = GetPrimaryFrame();
 
   if (frame) {
     frame->AttributeChanged(kNameSpaceID_None, nsGkAtoms::viewBox,
                             MutationEvent_Binding::SMIL);
   }
 }
 
-SVGAnimatedPreserveAspectRatio* SVGElement::GetPreserveAspectRatio() {
+SVGAnimatedPreserveAspectRatio* SVGElement::GetAnimatedPreserveAspectRatio() {
   return nullptr;
 }
 
 nsAttrValue SVGElement::WillChangePreserveAspectRatio() {
   return WillChangeValue(nsGkAtoms::preserveAspectRatio);
 }
 
 void SVGElement::DidChangePreserveAspectRatio(
     const nsAttrValue& aEmptyOrOldValue) {
   SVGAnimatedPreserveAspectRatio* preserveAspectRatio =
-      GetPreserveAspectRatio();
+      GetAnimatedPreserveAspectRatio();
 
   NS_ASSERTION(preserveAspectRatio,
                "DidChangePreserveAspectRatio on element with no "
                "preserveAspectRatio attrib");
 
   nsAttrValue newValue;
   newValue.SetTo(*preserveAspectRatio, nullptr);
 
@@ -2217,30 +2217,30 @@ UniquePtr<SMILAttr> SVGElement::GetAnima
         if (aName == info.mBooleanInfo[i].mName) {
           return info.mBooleans[i].ToSMILAttr(this);
         }
       }
     }
 
     // orient:
     if (aName == nsGkAtoms::orient) {
-      SVGAnimatedOrient* orient = GetOrient();
+      SVGAnimatedOrient* orient = GetAnimatedOrient();
       return orient ? orient->ToSMILAttr(this) : nullptr;
     }
 
     // viewBox:
     if (aName == nsGkAtoms::viewBox) {
-      SVGAnimatedViewBox* viewBox = GetViewBox();
+      SVGAnimatedViewBox* viewBox = GetAnimatedViewBox();
       return viewBox ? viewBox->ToSMILAttr(this) : nullptr;
     }
 
     // preserveAspectRatio:
     if (aName == nsGkAtoms::preserveAspectRatio) {
       SVGAnimatedPreserveAspectRatio* preserveAspectRatio =
-          GetPreserveAspectRatio();
+          GetAnimatedPreserveAspectRatio();
       return preserveAspectRatio ? preserveAspectRatio->ToSMILAttr(this)
                                  : nullptr;
     }
 
     // NumberLists:
     {
       NumberListAttributesInfo info = GetNumberListInfo();
       for (uint32_t i = 0; i < info.mNumberListCount; i++) {
--- a/dom/svg/SVGElement.h
+++ b/dom/svg/SVGElement.h
@@ -562,19 +562,19 @@ class SVGElement : public SVGElementBase
   virtual NumberAttributesInfo GetNumberInfo();
   virtual NumberPairAttributesInfo GetNumberPairInfo();
   virtual IntegerAttributesInfo GetIntegerInfo();
   virtual IntegerPairAttributesInfo GetIntegerPairInfo();
   virtual BooleanAttributesInfo GetBooleanInfo();
   virtual EnumAttributesInfo GetEnumInfo();
   // We assume all orients, viewboxes and preserveAspectRatios are alike
   // so we don't need to wrap the class
-  virtual SVGAnimatedOrient* GetOrient();
-  virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio();
-  virtual SVGAnimatedViewBox* GetViewBox();
+  virtual SVGAnimatedOrient* GetAnimatedOrient();
+  virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio();
+  virtual SVGAnimatedViewBox* GetAnimatedViewBox();
   virtual NumberListAttributesInfo GetNumberListInfo();
   virtual LengthListAttributesInfo GetLengthListInfo();
   virtual StringAttributesInfo GetStringInfo();
   virtual StringListAttributesInfo GetStringListInfo();
 
   static SVGEnumMapping sSVGUnitTypesMap[];
 
  private:
--- a/dom/svg/SVGFEImageElement.cpp
+++ b/dom/svg/SVGFEImageElement.cpp
@@ -279,17 +279,18 @@ bool SVGFEImageElement::OutputIsTainted(
 //----------------------------------------------------------------------
 // SVGElement methods
 
 already_AddRefed<DOMSVGAnimatedPreserveAspectRatio>
 SVGFEImageElement::PreserveAspectRatio() {
   return mPreserveAspectRatio.ToDOMAnimatedPreserveAspectRatio(this);
 }
 
-SVGAnimatedPreserveAspectRatio* SVGFEImageElement::GetPreserveAspectRatio() {
+SVGAnimatedPreserveAspectRatio*
+SVGFEImageElement::GetAnimatedPreserveAspectRatio() {
   return &mPreserveAspectRatio;
 }
 
 SVGElement::StringAttributesInfo SVGFEImageElement::GetStringInfo() {
   return StringAttributesInfo(mStringAttributes, sStringInfo,
                               ArrayLength(sStringInfo));
 }
 
--- a/dom/svg/SVGFEImageElement.h
+++ b/dom/svg/SVGFEImageElement.h
@@ -83,17 +83,18 @@ class SVGFEImageElement final : public S
   already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
 
  private:
   nsresult LoadSVGImage(bool aForce, bool aNotify);
 
  protected:
   virtual bool ProducesSRGB() override { return true; }
 
-  virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
+  virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio()
+      override;
   virtual StringAttributesInfo GetStringInfo() override;
 
   // Override for nsImageLoadingContent.
   nsIContent* AsContent() override { return this; }
 
   enum { RESULT, HREF, XLINK_HREF };
   SVGAnimatedString mStringAttributes[3];
   static StringInfo sStringInfo[3];
--- a/dom/svg/SVGImageElement.cpp
+++ b/dom/svg/SVGImageElement.cpp
@@ -274,17 +274,18 @@ bool SVGImageElement::HasValidDimensions
          mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0;
 }
 
 SVGElement::LengthAttributesInfo SVGImageElement::GetLengthInfo() {
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               ArrayLength(sLengthInfo));
 }
 
-SVGAnimatedPreserveAspectRatio* SVGImageElement::GetPreserveAspectRatio() {
+SVGAnimatedPreserveAspectRatio*
+SVGImageElement::GetAnimatedPreserveAspectRatio() {
   return &mPreserveAspectRatio;
 }
 
 SVGElement::StringAttributesInfo SVGImageElement::GetStringInfo() {
   return StringAttributesInfo(mStringAttributes, sStringInfo,
                               ArrayLength(sStringInfo));
 }
 
--- a/dom/svg/SVGImageElement.h
+++ b/dom/svg/SVGImageElement.h
@@ -94,17 +94,18 @@ class SVGImageElement : public SVGImageE
   void GetDecoding(nsAString& aValue);
 
   already_AddRefed<Promise> Decode(ErrorResult& aRv);
 
  protected:
   nsresult LoadSVGImage(bool aForce, bool aNotify);
 
   virtual LengthAttributesInfo GetLengthInfo() override;
-  virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
+  virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio()
+      override;
   virtual StringAttributesInfo GetStringInfo() override;
 
   // Override for nsImageLoadingContent.
   nsIContent* AsContent() override { return this; }
 
   enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
   SVGAnimatedLength mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
--- a/dom/svg/SVGMarkerElement.cpp
+++ b/dom/svg/SVGMarkerElement.cpp
@@ -160,21 +160,22 @@ SVGElement::LengthAttributesInfo SVGMark
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               ArrayLength(sLengthInfo));
 }
 
 SVGElement::EnumAttributesInfo SVGMarkerElement::GetEnumInfo() {
   return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
 }
 
-SVGAnimatedOrient* SVGMarkerElement::GetOrient() { return &mOrient; }
+SVGAnimatedOrient* SVGMarkerElement::GetAnimatedOrient() { return &mOrient; }
 
-SVGAnimatedViewBox* SVGMarkerElement::GetViewBox() { return &mViewBox; }
+SVGAnimatedViewBox* SVGMarkerElement::GetAnimatedViewBox() { return &mViewBox; }
 
-SVGAnimatedPreserveAspectRatio* SVGMarkerElement::GetPreserveAspectRatio() {
+SVGAnimatedPreserveAspectRatio*
+SVGMarkerElement::GetAnimatedPreserveAspectRatio() {
   return &mPreserveAspectRatio;
 }
 
 //----------------------------------------------------------------------
 // public helpers
 
 gfx::Matrix SVGMarkerElement::GetMarkerTransform(float aStrokeWidth,
                                                  const SVGMark& aMark) {
@@ -195,33 +196,33 @@ gfx::Matrix SVGMarkerElement::GetMarkerT
       angle = mOrient.GetAnimValue() * M_PI / 180.0f;
       break;
   }
 
   return gfx::Matrix(cos(angle) * scale, sin(angle) * scale,
                      -sin(angle) * scale, cos(angle) * scale, aMark.x, aMark.y);
 }
 
-SVGViewBoxRect SVGMarkerElement::GetViewBoxRect() {
+SVGViewBox SVGMarkerElement::GetViewBox() {
   if (mViewBox.HasRect()) {
     return mViewBox.GetAnimValue();
   }
-  return SVGViewBoxRect(
-      0, 0, mLengthAttributes[MARKERWIDTH].GetAnimValue(mCoordCtx),
-      mLengthAttributes[MARKERHEIGHT].GetAnimValue(mCoordCtx));
+  return SVGViewBox(0, 0,
+                    mLengthAttributes[MARKERWIDTH].GetAnimValue(mCoordCtx),
+                    mLengthAttributes[MARKERHEIGHT].GetAnimValue(mCoordCtx));
 }
 
 gfx::Matrix SVGMarkerElement::GetViewBoxTransform() {
   if (!mViewBoxToViewportTransform) {
     float viewportWidth =
         mLengthAttributes[MARKERWIDTH].GetAnimValue(mCoordCtx);
     float viewportHeight =
         mLengthAttributes[MARKERHEIGHT].GetAnimValue(mCoordCtx);
 
-    SVGViewBoxRect viewbox = GetViewBoxRect();
+    SVGViewBox viewbox = GetViewBox();
 
     MOZ_ASSERT(viewbox.width > 0.0f && viewbox.height > 0.0f,
                "Rendering should be disabled");
 
     gfx::Matrix viewBoxTM = SVGContentUtils::GetViewBoxTransform(
         viewportWidth, viewportHeight, viewbox.x, viewbox.y, viewbox.width,
         viewbox.height, mPreserveAspectRatio);
 
--- a/dom/svg/SVGMarkerElement.h
+++ b/dom/svg/SVGMarkerElement.h
@@ -51,17 +51,17 @@ class SVGMarkerElement : public SVGMarke
   // nsIContent interface
   NS_IMETHOD_(bool) IsAttributeMapped(const nsAtom* name) const override;
 
   // nsSVGSVGElement methods:
   virtual bool HasValidDimensions() const override;
 
   // public helpers
   gfx::Matrix GetMarkerTransform(float aStrokeWidth, const SVGMark& aMark);
-  SVGViewBoxRect GetViewBoxRect();
+  SVGViewBox GetViewBox();
   gfx::Matrix GetViewBoxTransform();
 
   virtual nsresult Clone(dom::NodeInfo*, nsINode** aResult) const override;
 
   // WebIDL
   already_AddRefed<SVGAnimatedRect> ViewBox();
   already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
   already_AddRefed<DOMSVGAnimatedLength> RefX();
@@ -74,19 +74,20 @@ class SVGMarkerElement : public SVGMarke
   void SetOrientToAuto();
   void SetOrientToAngle(DOMSVGAngle& angle, ErrorResult& rv);
 
  protected:
   void SetParentCoordCtxProvider(SVGViewportElement* aContext);
 
   virtual LengthAttributesInfo GetLengthInfo() override;
   virtual EnumAttributesInfo GetEnumInfo() override;
-  virtual SVGAnimatedOrient* GetOrient() override;
-  virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
-  virtual SVGAnimatedViewBox* GetViewBox() override;
+  virtual SVGAnimatedOrient* GetAnimatedOrient() override;
+  virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio()
+      override;
+  virtual SVGAnimatedViewBox* GetAnimatedViewBox() override;
 
   enum { REFX, REFY, MARKERWIDTH, MARKERHEIGHT };
   SVGAnimatedLength mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
 
   enum { MARKERUNITS };
   SVGAnimatedEnumeration mEnumAttributes[1];
   static SVGEnumMapping sUnitsMap[];
--- a/dom/svg/SVGPatternElement.cpp
+++ b/dom/svg/SVGPatternElement.cpp
@@ -157,19 +157,22 @@ SVGElement::LengthAttributesInfo SVGPatt
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               ArrayLength(sLengthInfo));
 }
 
 SVGElement::EnumAttributesInfo SVGPatternElement::GetEnumInfo() {
   return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
 }
 
-SVGAnimatedViewBox* SVGPatternElement::GetViewBox() { return &mViewBox; }
+SVGAnimatedViewBox* SVGPatternElement::GetAnimatedViewBox() {
+  return &mViewBox;
+}
 
-SVGAnimatedPreserveAspectRatio* SVGPatternElement::GetPreserveAspectRatio() {
+SVGAnimatedPreserveAspectRatio*
+SVGPatternElement::GetAnimatedPreserveAspectRatio() {
   return &mPreserveAspectRatio;
 }
 
 SVGElement::StringAttributesInfo SVGPatternElement::GetStringInfo() {
   return StringAttributesInfo(mStringAttributes, sStringInfo,
                               ArrayLength(sStringInfo));
 }
 
--- a/dom/svg/SVGPatternElement.h
+++ b/dom/svg/SVGPatternElement.h
@@ -68,18 +68,19 @@ class SVGPatternElement final : public S
   already_AddRefed<DOMSVGAnimatedLength> Width();
   already_AddRefed<DOMSVGAnimatedLength> Height();
   already_AddRefed<DOMSVGAnimatedString> Href();
 
  protected:
   virtual LengthAttributesInfo GetLengthInfo() override;
   virtual EnumAttributesInfo GetEnumInfo() override;
   virtual StringAttributesInfo GetStringInfo() override;
-  virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
-  virtual SVGAnimatedViewBox* GetViewBox() override;
+  virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio()
+      override;
+  virtual SVGAnimatedViewBox* GetAnimatedViewBox() override;
 
   enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
   SVGAnimatedLength mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
 
   enum { PATTERNUNITS, PATTERNCONTENTUNITS };
   SVGAnimatedEnumeration mEnumAttributes[2];
   static EnumInfo sEnumInfo[2];
--- a/dom/svg/SVGSVGElement.cpp
+++ b/dom/svg/SVGSVGElement.cpp
@@ -519,38 +519,38 @@ SVGElement::EnumAttributesInfo SVGSVGEle
   return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
 }
 
 void SVGSVGElement::SetImageOverridePreserveAspectRatio(
     const SVGPreserveAspectRatio& aPAR) {
   MOZ_ASSERT(OwnerDoc()->IsBeingUsedAsImage(),
              "should only override preserveAspectRatio in images");
 
-  bool hasViewBoxRect = HasViewBoxRect();
-  if (!hasViewBoxRect && ShouldSynthesizeViewBox()) {
+  bool hasViewBox = HasViewBox();
+  if (!hasViewBox && ShouldSynthesizeViewBox()) {
     // My non-<svg:image> clients will have been painting me with a synthesized
     // viewBox, but my <svg:image> client that's about to paint me now does NOT
     // want that.  Need to tell ourselves to flush our transform.
     mImageNeedsTransformInvalidation = true;
   }
 
-  if (!hasViewBoxRect) {
+  if (!hasViewBox) {
     return;  // preserveAspectRatio irrelevant (only matters if we have viewBox)
   }
 
   if (SetPreserveAspectRatioProperty(aPAR)) {
     mImageNeedsTransformInvalidation = true;
   }
 }
 
 void SVGSVGElement::ClearImageOverridePreserveAspectRatio() {
   MOZ_ASSERT(OwnerDoc()->IsBeingUsedAsImage(),
              "should only override image preserveAspectRatio in images");
 
-  if (!HasViewBoxRect() && ShouldSynthesizeViewBox()) {
+  if (!HasViewBox() && ShouldSynthesizeViewBox()) {
     // My non-<svg:image> clients will want to paint me with a synthesized
     // viewBox, but my <svg:image> client that just painted me did NOT
     // use that.  Need to tell ourselves to flush our transform.
     mImageNeedsTransformInvalidation = true;
   }
 
   if (ClearPreserveAspectRatioProperty()) {
     mImageNeedsTransformInvalidation = true;
@@ -598,19 +598,19 @@ SVGPreserveAspectRatio SVGSVGElement::Ge
         GetPreserveAspectRatioProperty();
     if (pAROverridePtr) {
       return *pAROverridePtr;
     }
   }
 
   SVGViewElement* viewElement = GetCurrentViewElement();
 
-  // This check is equivalent to "!HasViewBoxRect() &&
+  // This check is equivalent to "!HasViewBox() &&
   // ShouldSynthesizeViewBox()". We're just holding onto the viewElement that
-  // HasViewBoxRect() would look up, so that we don't have to look it up again
+  // HasViewBox() would look up, so that we don't have to look it up again
   // later.
   if (!((viewElement && viewElement->mViewBox.HasRect()) ||
         (mSVGView && mSVGView->mViewBox.HasRect()) || mViewBox.HasRect()) &&
       ShouldSynthesizeViewBox()) {
     // If we're synthesizing a viewBox, use preserveAspectRatio="none";
     return SVGPreserveAspectRatio(SVG_PRESERVEASPECTRATIO_NONE,
                                   SVG_MEETORSLICE_SLICE);
   }
--- a/dom/svg/SVGViewBoxSMILType.cpp
+++ b/dom/svg/SVGViewBoxSMILType.cpp
@@ -14,46 +14,45 @@
 namespace mozilla {
 
 /*static*/
 SVGViewBoxSMILType SVGViewBoxSMILType::sSingleton;
 
 void SVGViewBoxSMILType::Init(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.IsNull(), "Unexpected value type");
 
-  aValue.mU.mPtr = new SVGViewBoxRect();
+  aValue.mU.mPtr = new SVGViewBox();
   aValue.mType = this;
 }
 
 void SVGViewBoxSMILType::Destroy(SMILValue& aValue) const {
   MOZ_ASSERT(aValue.mType == this, "Unexpected SMIL value");
-  delete static_cast<SVGViewBoxRect*>(aValue.mU.mPtr);
+  delete static_cast<SVGViewBox*>(aValue.mU.mPtr);
   aValue.mU.mPtr = nullptr;
   aValue.mType = SMILNullType::Singleton();
 }
 
 nsresult SVGViewBoxSMILType::Assign(SMILValue& aDest,
                                     const SMILValue& aSrc) const {
   MOZ_ASSERT(aDest.mType == aSrc.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aDest.mType == this, "Unexpected SMIL value");
 
-  const SVGViewBoxRect* src = static_cast<const SVGViewBoxRect*>(aSrc.mU.mPtr);
-  SVGViewBoxRect* dst = static_cast<SVGViewBoxRect*>(aDest.mU.mPtr);
+  const SVGViewBox* src = static_cast<const SVGViewBox*>(aSrc.mU.mPtr);
+  SVGViewBox* dst = static_cast<SVGViewBox*>(aDest.mU.mPtr);
   *dst = *src;
   return NS_OK;
 }
 
 bool SVGViewBoxSMILType::IsEqual(const SMILValue& aLeft,
                                  const SMILValue& aRight) const {
   MOZ_ASSERT(aLeft.mType == aRight.mType, "Incompatible SMIL types");
   MOZ_ASSERT(aLeft.mType == this, "Unexpected type for SMIL value");
 
-  const SVGViewBoxRect* leftBox =
-      static_cast<const SVGViewBoxRect*>(aLeft.mU.mPtr);
-  const SVGViewBoxRect* rightBox = static_cast<SVGViewBoxRect*>(aRight.mU.mPtr);
+  const SVGViewBox* leftBox = static_cast<const SVGViewBox*>(aLeft.mU.mPtr);
+  const SVGViewBox* rightBox = static_cast<SVGViewBox*>(aRight.mU.mPtr);
   return *leftBox == *rightBox;
 }
 
 nsresult SVGViewBoxSMILType::Add(SMILValue& aDest, const SMILValue& aValueToAdd,
                                  uint32_t aCount) const {
   MOZ_ASSERT(aValueToAdd.mType == aDest.mType, "Trying to add invalid types");
   MOZ_ASSERT(aValueToAdd.mType == this, "Unexpected source type");
 
@@ -65,19 +64,18 @@ nsresult SVGViewBoxSMILType::Add(SMILVal
 }
 
 nsresult SVGViewBoxSMILType::ComputeDistance(const SMILValue& aFrom,
                                              const SMILValue& aTo,
                                              double& aDistance) const {
   MOZ_ASSERT(aFrom.mType == aTo.mType, "Trying to compare different types");
   MOZ_ASSERT(aFrom.mType == this, "Unexpected source type");
 
-  const SVGViewBoxRect* from =
-      static_cast<const SVGViewBoxRect*>(aFrom.mU.mPtr);
-  const SVGViewBoxRect* to = static_cast<const SVGViewBoxRect*>(aTo.mU.mPtr);
+  const SVGViewBox* from = static_cast<const SVGViewBox*>(aFrom.mU.mPtr);
+  const SVGViewBox* to = static_cast<const SVGViewBox*>(aTo.mU.mPtr);
 
   if (from->none || to->none) {
     return NS_ERROR_FAILURE;
   }
 
   // We use the distances between the edges rather than the difference between
   // the x, y, width and height for the "distance". This is necessary in
   // order for the "distance" result that we calculate to be the same for a
@@ -99,31 +97,29 @@ nsresult SVGViewBoxSMILType::Interpolate
                                          const SMILValue& aEndVal,
                                          double aUnitDistance,
                                          SMILValue& aResult) const {
   MOZ_ASSERT(aStartVal.mType == aEndVal.mType,
              "Trying to interpolate different types");
   MOZ_ASSERT(aStartVal.mType == this, "Unexpected types for interpolation");
   MOZ_ASSERT(aResult.mType == this, "Unexpected result type");
 
-  const SVGViewBoxRect* start =
-      static_cast<const SVGViewBoxRect*>(aStartVal.mU.mPtr);
-  const SVGViewBoxRect* end =
-      static_cast<const SVGViewBoxRect*>(aEndVal.mU.mPtr);
+  const SVGViewBox* start = static_cast<const SVGViewBox*>(aStartVal.mU.mPtr);
+  const SVGViewBox* end = static_cast<const SVGViewBox*>(aEndVal.mU.mPtr);
 
   if (start->none || end->none) {
     return NS_ERROR_FAILURE;
   }
 
-  SVGViewBoxRect* current = static_cast<SVGViewBoxRect*>(aResult.mU.mPtr);
+  SVGViewBox* current = static_cast<SVGViewBox*>(aResult.mU.mPtr);
 
   float x = (start->x + (end->x - start->x) * aUnitDistance);
   float y = (start->y + (end->y - start->y) * aUnitDistance);
   float width = (start->width + (end->width - start->width) * aUnitDistance);
   float height =
       (start->height + (end->height - start->height) * aUnitDistance);
 
-  *current = SVGViewBoxRect(x, y, width, height);
+  *current = SVGViewBox(x, y, width, height);
 
   return NS_OK;
 }
 
 }  // namespace mozilla
--- a/dom/svg/SVGViewElement.cpp
+++ b/dom/svg/SVGViewElement.cpp
@@ -62,16 +62,17 @@ SVGViewElement::PreserveAspectRatio() {
 
 //----------------------------------------------------------------------
 // SVGElement methods
 
 SVGElement::EnumAttributesInfo SVGViewElement::GetEnumInfo() {
   return EnumAttributesInfo(mEnumAttributes, sEnumInfo, ArrayLength(sEnumInfo));
 }
 
-SVGAnimatedViewBox* SVGViewElement::GetViewBox() { return &mViewBox; }
+SVGAnimatedViewBox* SVGViewElement::GetAnimatedViewBox() { return &mViewBox; }
 
-SVGAnimatedPreserveAspectRatio* SVGViewElement::GetPreserveAspectRatio() {
+SVGAnimatedPreserveAspectRatio*
+SVGViewElement::GetAnimatedPreserveAspectRatio() {
   return &mPreserveAspectRatio;
 }
 
 }  // namespace dom
 }  // namespace mozilla
--- a/dom/svg/SVGViewElement.h
+++ b/dom/svg/SVGViewElement.h
@@ -53,18 +53,19 @@ class SVGViewElement : public SVGViewEle
 
   virtual EnumAttributesInfo GetEnumInfo() override;
 
   enum { ZOOMANDPAN };
   SVGAnimatedEnumeration mEnumAttributes[1];
   static SVGEnumMapping sZoomAndPanMap[];
   static EnumInfo sEnumInfo[1];
 
-  virtual SVGAnimatedViewBox* GetViewBox() override;
-  virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
+  virtual SVGAnimatedViewBox* GetAnimatedViewBox() override;
+  virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio()
+      override;
 
   SVGAnimatedViewBox mViewBox;
   SVGAnimatedPreserveAspectRatio mPreserveAspectRatio;
 };
 
 }  // namespace dom
 }  // namespace mozilla
 
--- a/dom/svg/SVGViewportElement.cpp
+++ b/dom/svg/SVGViewportElement.cpp
@@ -180,34 +180,33 @@ gfx::Matrix SVGViewportElement::GetViewB
     viewportWidth = mViewportWidth;
     viewportHeight = mViewportHeight;
   }
 
   if (viewportWidth <= 0.0f || viewportHeight <= 0.0f) {
     return gfx::Matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);  // singular
   }
 
-  SVGViewBoxRect viewBox =
-      GetViewBoxWithSynthesis(viewportWidth, viewportHeight);
+  SVGViewBox viewBox = GetViewBoxWithSynthesis(viewportWidth, viewportHeight);
 
   if (viewBox.width <= 0.0f || viewBox.height <= 0.0f) {
     return gfx::Matrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);  // singular
   }
 
   return SVGContentUtils::GetViewBoxTransform(
       viewportWidth, viewportHeight, viewBox.x, viewBox.y, viewBox.width,
       viewBox.height, GetPreserveAspectRatioWithOverride());
 }
 //----------------------------------------------------------------------
 // SVGViewportElement
 
 float SVGViewportElement::GetLength(uint8_t aCtxType) {
-  const SVGViewBoxRect* viewbox = GetViewBoxInternal().HasRect()
-                                      ? &GetViewBoxInternal().GetAnimValue()
-                                      : nullptr;
+  const SVGViewBox* viewbox = GetViewBoxInternal().HasRect()
+                                  ? &GetViewBoxInternal().GetAnimValue()
+                                  : nullptr;
 
   float h = 0.0f, w = 0.0f;
   bool shouldComputeWidth =
            (aCtxType == SVGContentUtils::X || aCtxType == SVGContentUtils::XY),
        shouldComputeHeight =
            (aCtxType == SVGContentUtils::Y || aCtxType == SVGContentUtils::XY);
 
   if (viewbox) {
@@ -305,51 +304,54 @@ gfxMatrix SVGViewportElement::PrependLoc
 bool SVGViewportElement::HasValidDimensions() const {
   return !IsInner() ||
          ((!mLengthAttributes[ATTR_WIDTH].IsExplicitlySet() ||
            mLengthAttributes[ATTR_WIDTH].GetAnimValInSpecifiedUnits() > 0) &&
           (!mLengthAttributes[ATTR_HEIGHT].IsExplicitlySet() ||
            mLengthAttributes[ATTR_HEIGHT].GetAnimValInSpecifiedUnits() > 0));
 }
 
-SVGAnimatedViewBox* SVGViewportElement::GetViewBox() { return &mViewBox; }
+SVGAnimatedViewBox* SVGViewportElement::GetAnimatedViewBox() {
+  return &mViewBox;
+}
 
-SVGAnimatedPreserveAspectRatio* SVGViewportElement::GetPreserveAspectRatio() {
+SVGAnimatedPreserveAspectRatio*
+SVGViewportElement::GetAnimatedPreserveAspectRatio() {
   return &mPreserveAspectRatio;
 }
 
 bool SVGViewportElement::ShouldSynthesizeViewBox() const {
-  MOZ_ASSERT(!HasViewBoxRect(), "Should only be called if we lack a viewBox");
+  MOZ_ASSERT(!HasViewBox(), "Should only be called if we lack a viewBox");
 
   return IsRoot() && OwnerDoc()->IsBeingUsedAsImage();
 }
 
 //----------------------------------------------------------------------
 // implementation helpers
 
-SVGViewBoxRect SVGViewportElement::GetViewBoxWithSynthesis(
+SVGViewBox SVGViewportElement::GetViewBoxWithSynthesis(
     float aViewportWidth, float aViewportHeight) const {
   if (GetViewBoxInternal().HasRect()) {
     return GetViewBoxInternal().GetAnimValue();
   }
 
   if (ShouldSynthesizeViewBox()) {
     // Special case -- fake a viewBox, using height & width attrs.
     // (Use |this| as context, since if we get here, we're outermost <svg>.)
-    return SVGViewBoxRect(
+    return SVGViewBox(
         0, 0,
         ComputeSynthesizedViewBoxDimension(mLengthAttributes[ATTR_WIDTH],
                                            mViewportWidth, this),
         ComputeSynthesizedViewBoxDimension(mLengthAttributes[ATTR_HEIGHT],
                                            mViewportHeight, this));
   }
 
   // No viewBox attribute, so we shouldn't auto-scale. This is equivalent
   // to having a viewBox that exactly matches our viewport size.
-  return SVGViewBoxRect(0, 0, aViewportWidth, aViewportHeight);
+  return SVGViewBox(0, 0, aViewportWidth, aViewportHeight);
 }
 
 SVGElement::LengthAttributesInfo SVGViewportElement::GetLengthInfo() {
   return LengthAttributesInfo(mLengthAttributes, sLengthInfo,
                               ArrayLength(sLengthInfo));
 }
 
 }  // namespace dom
--- a/dom/svg/SVGViewportElement.h
+++ b/dom/svg/SVGViewportElement.h
@@ -74,29 +74,29 @@ class SVGViewportElement : public SVGGra
    * has a valid viewBox.
    *
    * Note that this does not check whether we need to synthesize a viewBox,
    * so you must call ShouldSynthesizeViewBox() if you need to chck that too.
    *
    * Note also that this method does not pay attention to whether the width or
    * height values of the viewBox rect are positive!
    */
-  bool HasViewBoxRect() const { return GetViewBoxInternal().HasRect(); }
+  bool HasViewBox() const { return GetViewBoxInternal().HasRect(); }
 
   /**
    * Returns true if we should synthesize a viewBox for ourselves (that is, if
    * we're the root element in an image document, and we're not currently being
    * painted for an <svg:image> element).
    *
-   * Only call this method if HasViewBoxRect() returns false.
+   * Only call this method if HasViewBox() returns false.
    */
   bool ShouldSynthesizeViewBox() const;
 
   bool HasViewBoxOrSyntheticViewBox() const {
-    return HasViewBoxRect() || ShouldSynthesizeViewBox();
+    return HasViewBox() || ShouldSynthesizeViewBox();
   }
 
   bool HasChildrenOnlyTransform() const { return mHasChildrenOnlyTransform; }
 
   void UpdateHasChildrenOnlyTransform();
 
   enum ChildrenOnlyTransformChangedFlags { eDuringReflow = 1 };
 
@@ -121,17 +121,17 @@ class SVGViewportElement : public SVGGra
   void SetViewportSize(const svgFloatSize& aSize) {
     mViewportWidth = aSize.width;
     mViewportHeight = aSize.height;
   }
 
   // WebIDL
   already_AddRefed<SVGAnimatedRect> ViewBox();
   already_AddRefed<DOMSVGAnimatedPreserveAspectRatio> PreserveAspectRatio();
-  virtual SVGAnimatedViewBox* GetViewBox() override;
+  virtual SVGAnimatedViewBox* GetAnimatedViewBox() override;
 
  protected:
   // implementation helpers:
 
   bool IsRoot() const {
     NS_ASSERTION((IsInUncomposedDoc() && !GetParent()) ==
                      (OwnerDoc()->GetRootElement() == this),
                  "Can't determine if we're root");
@@ -157,31 +157,32 @@ class SVGViewportElement : public SVGGra
     return mPreserveAspectRatio.GetAnimValue();
   }
 
   /**
    * Returns the explicit viewBox rect, if specified, or else a synthesized
    * viewBox, if appropriate, or else a viewBox matching the dimensions of the
    * SVG viewport.
    */
-  SVGViewBoxRect GetViewBoxWithSynthesis(float aViewportWidth,
-                                         float aViewportHeight) const;
+  SVGViewBox GetViewBoxWithSynthesis(float aViewportWidth,
+                                     float aViewportHeight) const;
 
   /**
    * Retrieve the value of currentScale and currentTranslate.
    */
   virtual SVGPoint GetCurrentTranslate() const { return SVGPoint(0.0f, 0.0f); }
   virtual float GetCurrentScale() const { return 1.0f; }
 
   enum { ATTR_X, ATTR_Y, ATTR_WIDTH, ATTR_HEIGHT };
   SVGAnimatedLength mLengthAttributes[4];
   static LengthInfo sLengthInfo[4];
   virtual LengthAttributesInfo GetLengthInfo() override;
 
-  virtual SVGAnimatedPreserveAspectRatio* GetPreserveAspectRatio() override;
+  virtual SVGAnimatedPreserveAspectRatio* GetAnimatedPreserveAspectRatio()
+      override;
 
   virtual const SVGAnimatedViewBox& GetViewBoxInternal() const {
     return mViewBox;
   }
   virtual SVGAnimatedTransformList* GetTransformInternal() const {
     return mTransforms;
   }
   SVGAnimatedViewBox mViewBox;
--- a/layout/base/nsLayoutUtils.cpp
+++ b/layout/base/nsLayoutUtils.cpp
@@ -9584,24 +9584,25 @@ static nsRect ComputeSVGReferenceRect(ns
       break;
     }
     case StyleGeometryBox::ViewBox: {
       nsIContent* content = aFrame->GetContent();
       SVGElement* element = static_cast<SVGElement*>(content);
       SVGViewportElement* svgElement = element->GetCtx();
       MOZ_ASSERT(svgElement);
 
-      if (svgElement && svgElement->HasViewBoxRect()) {
+      if (svgElement && svgElement->HasViewBox()) {
         // If a `viewBox` attribute is specified for the SVG viewport creating
         // element:
         // 1. The reference box is positioned at the origin of the coordinate
         //    system established by the `viewBox` attribute.
         // 2. The dimension of the reference box is set to the width and height
         //    values of the `viewBox` attribute.
-        const SVGViewBoxRect& value = svgElement->GetViewBox()->GetAnimValue();
+        const SVGViewBox& value =
+            svgElement->GetAnimatedViewBox()->GetAnimValue();
         r = nsRect(nsPresContext::CSSPixelsToAppUnits(value.x),
                    nsPresContext::CSSPixelsToAppUnits(value.y),
                    nsPresContext::CSSPixelsToAppUnits(value.width),
                    nsPresContext::CSSPixelsToAppUnits(value.height));
       } else {
         // No viewBox is specified, uses the nearest SVG viewport as reference
         // box.
         svgFloatSize viewportSize = svgElement->GetViewportSize();
--- a/layout/svg/nsSVGMarkerFrame.cpp
+++ b/layout/svg/nsSVGMarkerFrame.cpp
@@ -100,17 +100,17 @@ void nsSVGMarkerFrame::PaintMark(gfxCont
 
   AutoMarkerReferencer markerRef(this, aMarkedFrame);
 
   SVGMarkerElement* marker = static_cast<SVGMarkerElement*>(GetContent());
   if (!marker->HasValidDimensions()) {
     return;
   }
 
-  const SVGViewBoxRect viewBox = marker->GetViewBoxRect();
+  const SVGViewBox viewBox = marker->GetViewBox();
 
   if (viewBox.width <= 0.0f || viewBox.height <= 0.0f) {
     // We must disable rendering if the viewBox width or height are zero.
     return;
   }
 
   Matrix viewBoxTM = marker->GetViewBoxTransform();
 
@@ -149,17 +149,17 @@ SVGBBox nsSVGMarkerFrame::GetMarkBBoxCon
 
   AutoMarkerReferencer markerRef(this, aMarkedFrame);
 
   SVGMarkerElement* content = static_cast<SVGMarkerElement*>(GetContent());
   if (!content->HasValidDimensions()) {
     return bbox;
   }
 
-  const SVGViewBoxRect viewBox = content->GetViewBoxRect();
+  const SVGViewBox viewBox = content->GetViewBox();
 
   if (viewBox.width <= 0.0f || viewBox.height <= 0.0f) {
     return bbox;
   }
 
   mMarkerTM = content->GetMarkerTransform(aStrokeWidth, aMark);
   Matrix viewBoxTM = content->GetViewBoxTransform();
 
--- a/layout/svg/nsSVGOuterSVGFrame.cpp
+++ b/layout/svg/nsSVGOuterSVGFrame.cpp
@@ -252,17 +252,17 @@ nsSize nsSVGOuterSVGFrame::GetIntrinsicR
     }
     if (ratio.height < 0) {
       ratio.height = 0;
     }
     return ratio;
   }
 
   SVGViewElement* viewElement = content->GetCurrentViewElement();
-  const SVGViewBoxRect* viewbox = nullptr;
+  const SVGViewBox* viewbox = nullptr;
 
   // The logic here should match HasViewBox().
   if (viewElement && viewElement->mViewBox.HasRect()) {
     viewbox = &viewElement->mViewBox.GetAnimValue();
   } else if (content->mViewBox.HasRect()) {
     viewbox = &content->mViewBox.GetAnimValue();
   }
 
@@ -776,17 +776,17 @@ void nsSVGOuterSVGFrame::NotifyViewportO
   // No point in doing anything when were not init'ed yet:
   if (!mViewportInitialized) {
     return;
   }
 
   SVGSVGElement* content = static_cast<SVGSVGElement*>(GetContent());
 
   if (aFlags & COORD_CONTEXT_CHANGED) {
-    if (content->HasViewBoxRect()) {
+    if (content->HasViewBox()) {
       // Percentage lengths on children resolve against the viewBox rect so we
       // don't need to notify them of the viewport change, but the viewBox
       // transform will have changed, so we need to notify them of that instead.
       aFlags = TRANSFORM_CHANGED;
     } else if (content->ShouldSynthesizeViewBox()) {
       // In the case of a synthesized viewBox, the synthetic viewBox's rect
       // changes as the viewport changes. As a result we need to maintain the
       // COORD_CONTEXT_CHANGED flag.
--- a/layout/svg/nsSVGPatternFrame.cpp
+++ b/layout/svg/nsSVGPatternFrame.cpp
@@ -631,19 +631,19 @@ gfxMatrix nsSVGPatternFrame::ConstructCT
       ctx = static_cast<SVGElement *>(targetContent)->GetCtx();
     }
     scaleX = scaleY = MaxExpansion(callerCTM);
   }
 
   if (!aViewBox.IsExplicitlySet()) {
     return gfxMatrix(scaleX, 0.0, 0.0, scaleY, 0.0, 0.0);
   }
-  const SVGViewBoxRect viewBoxRect = aViewBox.GetAnimValue();
+  const SVGViewBox viewBox = aViewBox.GetAnimValue();
 
-  if (viewBoxRect.height <= 0.0f || viewBoxRect.width <= 0.0f) {
+  if (viewBox.height <= 0.0f || viewBox.width <= 0.0f) {
     return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);  // singular
   }
 
   float viewportWidth, viewportHeight;
   if (targetContent->IsSVGElement()) {
     // If we're dealing with an SVG target only retrieve the context once.
     // Calling the nsIFrame* variant of GetAnimValue would look it up on
     // every call.
@@ -659,19 +659,18 @@ gfxMatrix nsSVGPatternFrame::ConstructCT
         GetLengthValue(SVGPatternElement::ATTR_HEIGHT)->GetAnimValue(aTarget);
   }
 
   if (viewportWidth <= 0.0f || viewportHeight <= 0.0f) {
     return gfxMatrix(0.0, 0.0, 0.0, 0.0, 0.0, 0.0);  // singular
   }
 
   Matrix tm = SVGContentUtils::GetViewBoxTransform(
-      viewportWidth * scaleX, viewportHeight * scaleY, viewBoxRect.x,
-      viewBoxRect.y, viewBoxRect.width, viewBoxRect.height,
-      GetPreserveAspectRatio());
+      viewportWidth * scaleX, viewportHeight * scaleY, viewBox.x, viewBox.y,
+      viewBox.width, viewBox.height, GetPreserveAspectRatio());
 
   return ThebesMatrix(tm);
 }
 
 //----------------------------------------------------------------------
 // nsSVGPaintServerFrame methods:
 already_AddRefed<gfxPattern> nsSVGPatternFrame::GetPaintServerPattern(
     nsIFrame *aSource, const DrawTarget *aDrawTarget,
--- a/layout/svg/nsSVGViewportFrame.cpp
+++ b/layout/svg/nsSVGViewportFrame.cpp
@@ -97,21 +97,21 @@ void nsSVGViewportFrame::NotifySVGChange
     }
 
     // Coordinate context changes affect mCanvasTM if we have a
     // percentage 'x' or 'y', or if we have a percentage 'width' or 'height' AND
     // a 'viewBox'.
 
     if (!(aFlags & TRANSFORM_CHANGED) &&
         (xOrYIsPercentage ||
-         (widthOrHeightIsPercentage && svg->HasViewBoxRect()))) {
+         (widthOrHeightIsPercentage && svg->HasViewBox()))) {
       aFlags |= TRANSFORM_CHANGED;
     }
 
-    if (svg->HasViewBoxRect() || !widthOrHeightIsPercentage) {
+    if (svg->HasViewBox() || !widthOrHeightIsPercentage) {
       // Remove COORD_CONTEXT_CHANGED, since we establish the coordinate
       // context for our descendants and this notification won't change its
       // dimensions:
       aFlags &= ~COORD_CONTEXT_CHANGED;
 
       if (!aFlags) {
         return;  // No notification flags left
       }