RecordCurrentScaleTranslate(); mZooming = PR_FALSE;
nsSVGSVGElement::Init(){  nsresult rv = nsSVGSVGElementBase::Init();  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);    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);    rv = NS_NewSVGAnimatedLength(getter_AddRefs(mHeight), length);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::height, mHeight);    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);    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);    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  {    nsCOMPtr<nsIDOMSVGRect> viewbox;    nsCOMPtr<nsIDOMSVGLength> animWidth, animHeight;    mWidth->GetAnimVal(getter_AddRefs(animWidth));    mHeight->GetAnimVal(getter_AddRefs(animHeight));    rv = NS_NewSVGViewBox(getter_AddRefs(viewbox), animWidth, animHeight);    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGAnimatedRect(getter_AddRefs(mViewBox), viewbox);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::viewBox, mViewBox);    NS_ENSURE_SUCCESS(rv,rv);    // initialize coordinate context with viewbox:    SetCoordCtxRect(viewbox);  }  // DOM property: preserveAspectRatio , #IMPLIED attrib: preserveAspectRatio  {    nsCOMPtr<nsIDOMSVGPreserveAspectRatio> preserveAspectRatio;    rv = NS_NewSVGPreserveAspectRatio(getter_AddRefs(preserveAspectRatio));    NS_ENSURE_SUCCESS(rv,rv);    rv = NS_NewSVGAnimatedPreserveAspectRatio(                                          getter_AddRefs(mPreserveAspectRatio),                                          preserveAspectRatio);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::preserveAspectRatio,                           mPreserveAspectRatio);    NS_ENSURE_SUCCESS(rv,rv);  }    // nsIDOMSVGZoomAndPan attribute ------:  // Define enumeration mappings  static struct nsSVGEnumMapping zoomMap[] = {        {&nsSVGAtoms::disable, nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_DISABLE},        {&nsSVGAtoms::magnify, nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY},        {nsnull, 0}  };  // DOM property: zoomAndPan ,  #IMPLIED attrib: zoomAndPan  {    rv = NS_NewSVGEnum(getter_AddRefs(mZoomAndPan),                       nsIDOMSVGZoomAndPan::SVG_ZOOMANDPAN_MAGNIFY, zoomMap);    NS_ENSURE_SUCCESS(rv,rv);    rv = AddMappedSVGValue(nsSVGAtoms::zoomAndPan, mZoomAndPan);    NS_ENSURE_SUCCESS(rv,rv);  }  // DOM property: currentScale  {    rv = NS_NewSVGNumber(getter_AddRefs(mCurrentScale), 1.0f);    NS_ENSURE_SUCCESS(rv,rv);    NS_ADD_SVGVALUE_OBSERVER(mCurrentScale);  }  // DOM property: currentTranslate  {    rv = NS_NewSVGPoint(getter_AddRefs(mCurrentTranslate));    NS_ENSURE_SUCCESS(rv,rv);    NS_ADD_SVGVALUE_OBSERVER(mCurrentTranslate);  }  return rv;}