@@ -38,7 +38,7 @@ JSObject* SVGRect::WrapObject(JSContext* aCx,
3838float SVGRect::X () {
3939 switch (mType ) {
4040 case RectType::AnimValue:
41- static_cast <SVGElement*>(mParent -> AsElement ())->FlushAnimations ();
41+ static_cast <SVGElement*>(mParent . get ())->FlushAnimations ();
4242 return mVal ->GetAnimValue ().x ;
4343 case RectType::BaseValue:
4444 return mVal ->GetBaseValue ().x ;
@@ -50,7 +50,7 @@ float SVGRect::X() {
5050float SVGRect::Y () {
5151 switch (mType ) {
5252 case RectType::AnimValue:
53- static_cast <SVGElement*>(mParent -> AsElement ())->FlushAnimations ();
53+ static_cast <SVGElement*>(mParent . get ())->FlushAnimations ();
5454 return mVal ->GetAnimValue ().y ;
5555 case RectType::BaseValue:
5656 return mVal ->GetBaseValue ().y ;
@@ -62,7 +62,7 @@ float SVGRect::Y() {
6262float SVGRect::Width () {
6363 switch (mType ) {
6464 case RectType::AnimValue:
65- static_cast <SVGElement*>(mParent -> AsElement ())->FlushAnimations ();
65+ static_cast <SVGElement*>(mParent . get ())->FlushAnimations ();
6666 return mVal ->GetAnimValue ().width ;
6767 case RectType::BaseValue:
6868 return mVal ->GetBaseValue ().width ;
@@ -74,7 +74,7 @@ float SVGRect::Width() {
7474float SVGRect::Height () {
7575 switch (mType ) {
7676 case RectType::AnimValue:
77- static_cast <SVGElement*>(mParent -> AsElement ())->FlushAnimations ();
77+ static_cast <SVGElement*>(mParent . get ())->FlushAnimations ();
7878 return mVal ->GetAnimValue ().height ;
7979 case RectType::BaseValue:
8080 return mVal ->GetBaseValue ().height ;
@@ -88,12 +88,9 @@ void SVGRect::SetX(float aX, ErrorResult& aRv) {
8888 case RectType::AnimValue:
8989 aRv.ThrowNoModificationAllowedError (" Animated values cannot be set" );
9090 return ;
91- case RectType::BaseValue: {
92- SVGViewBox rect = mVal ->GetBaseValue ();
93- rect.x = aX;
94- mVal ->SetBaseValue (rect, static_cast <SVGElement*>(mParent ->AsElement ()));
91+ case RectType::BaseValue:
92+ mVal ->SetBaseX (aX, static_cast <SVGElement*>(mParent .get ()));
9593 return ;
96- }
9794 default :
9895 mRect .x = aX;
9996 }
@@ -104,12 +101,9 @@ void SVGRect::SetY(float aY, ErrorResult& aRv) {
104101 case RectType::AnimValue:
105102 aRv.ThrowNoModificationAllowedError (" Animated values cannot be set" );
106103 return ;
107- case RectType::BaseValue: {
108- SVGViewBox rect = mVal ->GetBaseValue ();
109- rect.y = aY;
110- mVal ->SetBaseValue (rect, static_cast <SVGElement*>(mParent ->AsElement ()));
104+ case RectType::BaseValue:
105+ mVal ->SetBaseY (aY, static_cast <SVGElement*>(mParent .get ()));
111106 return ;
112- }
113107 default :
114108 mRect .y = aY;
115109 }
@@ -121,9 +115,7 @@ void SVGRect::SetWidth(float aWidth, ErrorResult& aRv) {
121115 aRv.ThrowNoModificationAllowedError (" Animated values cannot be set" );
122116 return ;
123117 case RectType::BaseValue: {
124- SVGViewBox rect = mVal ->GetBaseValue ();
125- rect.width = aWidth;
126- mVal ->SetBaseValue (rect, static_cast <SVGElement*>(mParent ->AsElement ()));
118+ mVal ->SetBaseWidth (aWidth, static_cast <SVGElement*>(mParent .get ()));
127119 return ;
128120 }
129121 default :
@@ -136,12 +128,9 @@ void SVGRect::SetHeight(float aHeight, ErrorResult& aRv) {
136128 case RectType::AnimValue:
137129 aRv.ThrowNoModificationAllowedError (" Animated values cannot be set" );
138130 return ;
139- case RectType::BaseValue: {
140- SVGViewBox rect = mVal ->GetBaseValue ();
141- rect.height = aHeight;
142- mVal ->SetBaseValue (rect, static_cast <SVGElement*>(mParent ->AsElement ()));
131+ case RectType::BaseValue:
132+ mVal ->SetBaseHeight (aHeight, static_cast <SVGElement*>(mParent .get ()));
143133 return ;
144- }
145134 default :
146135 mRect .height = aHeight;
147136 }
0 commit comments