NS_ADD_SVGVALUE_OBSERVER(mPreserveAspectRatio);
nsSVGSVGElement::Init(){  nsresult rv = nsSVGSVGElementBase::Init();  NS_ENSURE_SUCCESS(rv,rv);  // parent viewport. this will be initialized properly by our frame.  {    nsCOMPtr<nsIDOMSVGNumber> scalex;    nsCOMPtr<nsIDOMSVGNumber> scaley;    nsCOMPtr<nsIDOMSVGNumber> lengthx;    nsCOMPtr<nsIDOMSVGNumber> lengthy;    rv = NS_NewSVGNumber(getter_AddRefs(scalex));    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGNumber(getter_AddRefs(scaley));    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGNumber(getter_AddRefs(lengthx));    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGNumber(getter_AddRefs(lengthy));    NS_ENSURE_SUCCESS(rv,rv);        rv = NS_NewSVGViewportRect(getter_AddRefs(mParentViewport),                               scalex, scaley, lengthx, lengthy);    NS_ENSURE_SUCCESS(rv,rv);  }    // nsIDOMSVGSVGElement attributes ------:    // DOM property: width ,  #IMPLIED attrib: width  {    nsCOMPtr<nsISVGLength> length;    rv = NS_NewSVGLength(getter_AddRefs(length),                         100.0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE);    NS_ENSURE_SUCCESS(rv,rv);    nsCOMPtr<nsISVGViewportAxis> ctx;    mParentViewport->GetXAxis(getter_AddRefs(ctx));        length->SetContext(ctx);        rv = NS_NewSVGAnimatedLength(getter_AddRefs(mWidth), length);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::width, mWidth);    NS_ENSURE_SUCCESS(rv,rv);  }  // DOM property: height , #IMPLIED attrib: height  {    nsCOMPtr<nsISVGLength> length;    rv = NS_NewSVGLength(getter_AddRefs(length),                         100.0, nsIDOMSVGLength::SVG_LENGTHTYPE_PERCENTAGE);    NS_ENSURE_SUCCESS(rv,rv);    nsCOMPtr<nsISVGViewportAxis> ctx;    mParentViewport->GetYAxis(getter_AddRefs(ctx));        length->SetContext(ctx);    rv = NS_NewSVGAnimatedLength(getter_AddRefs(mHeight), length);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::height, mHeight);    NS_ENSURE_SUCCESS(rv,rv);  }  // readonly DOM property: viewport  {    nsCOMPtr<nsIDOMSVGNumber> scalex;    nsCOMPtr<nsIDOMSVGNumber> scaley;    nsCOMPtr<nsIDOMSVGNumber> lengthx;    nsCOMPtr<nsIDOMSVGNumber> lengthy;    rv = NS_NewSVGNumber(getter_AddRefs(scalex));    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGNumber(getter_AddRefs(scaley));    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGNumber(getter_AddRefs(lengthx));    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGNumber(getter_AddRefs(lengthy));    NS_ENSURE_SUCCESS(rv,rv);        rv = NS_NewSVGViewportRect(getter_AddRefs(mViewport),                               scalex, scaley, lengthx, lengthy);    NS_ENSURE_SUCCESS(rv,rv);  }  // DOM property: x ,  #IMPLIED attrib: x  {    nsCOMPtr<nsISVGLength> length;    rv = NS_NewSVGLength(getter_AddRefs(length),                         0.0f);    NS_ENSURE_SUCCESS(rv,rv);    // XXXXXXX//     nsCOMPtr<nsISVGLengthContext> ctx;//     GetLengthContextX(getter_AddRefs(ctx));    //     length->SetContext(ctx);    rv = NS_NewSVGAnimatedLength(getter_AddRefs(mX), length);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::x, mX);    NS_ENSURE_SUCCESS(rv,rv);  }  // DOM property: y ,  #IMPLIED attrib: y  {    nsCOMPtr<nsISVGLength> length;    rv = NS_NewSVGLength(getter_AddRefs(length),                         0.0f);    NS_ENSURE_SUCCESS(rv,rv);    // XXXXXXX//     nsCOMPtr<nsISVGLengthContext> ctx;//     GetLengthContextY(getter_AddRefs(ctx));    //     length->SetContext(ctx);    rv = NS_NewSVGAnimatedLength(getter_AddRefs(mY), length);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::y, mY);    NS_ENSURE_SUCCESS(rv,rv);  }    // nsIDOMSVGFitToViewBox attributes ------:    // DOM property: viewBox , #IMPLIED attrib: viewBox  {    //      -----------------    //     | SVGAnimatedRect |    //      -----------------    //             < >    //              |    //  -------------------------    // | SVGRectPrototypeWrapper |    //  -------------------------    //             < >    //              |    //              | prototype    //         -----------    //        | mViewport |    //         -----------        nsCOMPtr<nsIDOMSVGRect> wrapperRect;    rv = NS_NewSVGRectPrototypeWrapper(getter_AddRefs(wrapperRect), mViewport);    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGAnimatedRect(getter_AddRefs(mViewBox), wrapperRect);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::viewBox, mViewBox);    NS_ENSURE_SUCCESS(rv,rv);  }  // add observers -------------------------- :  NS_ADD_SVGVALUE_OBSERVER(mViewport);  NS_ADD_SVGVALUE_OBSERVER(mViewBox);  return rv;}