if (!str_weight.IsEmpty()) { val->SetIdent(str_weight); } else { val->SetNumber(font->mFont.weight);
if(str_weight.Length()>0) { val->SetString(str_weight); } else { nsAutoString num_weight; num_weight.AppendInt(font->mFont.weight, 10); val->SetString(num_weight);
nsComputedDOMStyle::GetFontWeight(nsIFrame *aFrame,                                  nsIDOMCSSValue** aValue){  nsROCSSPrimitiveValue* val = GetROCSSPrimitiveValue();  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);  const nsStyleFont* font = nsnull;  GetStyleData(eStyleStruct_Font, (const nsStyleStruct*&)font, aFrame);  if (font) {    const nsAFlatCString& str_weight=      nsCSSProps::SearchKeywordTable(font->mFont.weight,                                     nsCSSProps::kFontWeightKTable);    if (!str_weight.IsEmpty()) {      val->SetIdent(str_weight);    } else {      val->SetNumber(font->mFont.weight);    }  }  return CallQueryInterface(val, aValue);}