void nsSVGLength2::ConvertToSpecifiedUnits(PRUint16 unitType, nsSVGElement *aSVGElement) { if (!IsValidUnitType(unitType)) return; float valueInUserUnits = mBaseVal / GetUnitScaleFactor(aSVGElement); mSpecifiedUnitType = PRUint8(unitType); SetBaseValue(valueInUserUnits, aSVGElement); }
nsresult nsSVGLength2::ConvertToSpecifiedUnits(PRUint16 unitType, nsSVGElement *aSVGElement) { if (!IsValidUnitType(unitType)) return NS_ERROR_DOM_NOT_SUPPORTED_ERR; float valueInUserUnits = mBaseVal / GetUnitScaleFactor(aSVGElement, mSpecifiedUnitType); mSpecifiedUnitType = PRUint8(unitType); SetBaseValue(valueInUserUnits, aSVGElement); return NS_OK; }
nsresult nsSVGOrientType::SetBaseValue(PRUint16 aValue, nsSVGElement *aSVGElement) { if (aValue == nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_AUTO || aValue == nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_ANGLE) { SetBaseValue(aValue); aSVGElement->SetAttr( kNameSpaceID_None, nsGkAtoms::orient, nsnull, (aValue ==nsIDOMSVGMarkerElement::SVG_MARKER_ORIENT_AUTO ? NS_LITERAL_STRING("auto") : NS_LITERAL_STRING("0")), PR_TRUE); return NS_OK; } return NS_ERROR_DOM_SYNTAX_ERR; }