PRUint8 borderStyle = border->GetBorderStyle(aSide); if (borderStyle == NS_STYLE_BORDER_STYLE_NONE) { coord.SetCoordValue(0); } else { switch(aSide) { case NS_SIDE_TOP: border->mBorder.GetTop(coord); break; case NS_SIDE_BOTTOM : border->mBorder.GetBottom(coord); break; case NS_SIDE_LEFT : border->mBorder.GetLeft(coord); break; case NS_SIDE_RIGHT : border->mBorder.GetRight(coord); break; default: NS_WARNING("double check the side"); break; } }
switch(aSide) { case NS_SIDE_TOP: border->mBorder.GetTop(coord); break; case NS_SIDE_BOTTOM : border->mBorder.GetBottom(coord); break; case NS_SIDE_LEFT : border->mBorder.GetLeft(coord); break; case NS_SIDE_RIGHT : border->mBorder.GetRight(coord); break; default: NS_WARNING("double check the side"); break; }
nsComputedDOMStyle::GetBorderWidthFor(PRUint8 aSide, nsIFrame *aFrame,                                      nsIDOMCSSValue** aValue){  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);  const nsStyleBorder* border = nsnull;  GetStyleData(eStyleStruct_Border, (const nsStyleStruct*&)border, aFrame);  if (border) {    nsStyleCoord coord;    PRUint8 borderStyle = border->GetBorderStyle(aSide);    if (borderStyle == NS_STYLE_BORDER_STYLE_NONE) {      coord.SetCoordValue(0);    } else {      switch(aSide) {        case NS_SIDE_TOP:          border->mBorder.GetTop(coord); break;        case NS_SIDE_BOTTOM :          border->mBorder.GetBottom(coord); break;        case NS_SIDE_LEFT :          border->mBorder.GetLeft(coord); break;        case NS_SIDE_RIGHT :          border->mBorder.GetRight(coord); break;        default:          NS_WARNING("double check the side");          break;      }   }    switch(coord.GetUnit()) {      case eStyleUnit_Coord:        val->SetTwips(coord.GetCoordValue());  break;      case eStyleUnit_Integer:      case eStyleUnit_Proportional:      case eStyleUnit_Enumerated:      case eStyleUnit_Chars:        {          const nsAFlatCString& width=            nsCSSProps::SearchKeywordTable(coord.GetIntValue(),                                           nsCSSProps::kBorderWidthKTable);          val->SetIdent(width);          break;        }      default:        NS_WARNING("double check the unit");        break;    }  }  return CallQueryInterface(val, aValue);}