nscoord width = GetMarginWidthCoordFor(aSide, aFrame); val->SetTwips(width);
if(margin) { nsStyleCoord coord; switch(aSide) { case NS_SIDE_TOP    : margin->mMargin.GetTop(coord);    break; case NS_SIDE_BOTTOM : margin->mMargin.GetBottom(coord); break; case NS_SIDE_LEFT   : margin->mMargin.GetLeft(coord);   break; case NS_SIDE_RIGHT  : margin->mMargin.GetRight(coord);  break; default: NS_WARNING("double check the side"); break; }
nsComputedDOMStyle::GetMarginWidthFor(PRUint8 aSide, nsIFrame *aFrame,                                      nsIDOMCSSValue** aValue){  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);  FlushPendingReflows();  nscoord width = GetMarginWidthCoordFor(aSide, aFrame);  val->SetTwips(width);  return CallQueryInterface(val, aValue);}