if(font) { if (font->mFont.style == NS_STYLE_FONT_STYLE_NORMAL) { val->SetString(NS_LITERAL_STRING("normal")); } else { const nsAFlatCString& style= nsCSSProps::SearchKeywordTable(font->mFont.style, nsCSSProps::kFontStyleKTable); val->SetString(style); } } else { val->SetString(NS_LITERAL_STRING(""));
if (font && font->mFont.style != NS_STYLE_FONT_STYLE_NORMAL) { const nsAFlatCString& style= nsCSSProps::ValueToKeyword(font->mFont.style, nsCSSProps::kFontStyleKTable); val->SetIdent(style); } else { val->SetIdent(nsLayoutAtoms::normal);
nsComputedDOMStyle::GetFontStyle(nsIFrame *aFrame,                                 nsIDOMCSSPrimitiveValue*& 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) {    if (font->mFont.style == NS_STYLE_FONT_STYLE_NORMAL) {      val->SetString(NS_LITERAL_STRING("normal"));    } else {      const nsAFlatCString& style=        nsCSSProps::SearchKeywordTable(font->mFont.style,                                       nsCSSProps::kFontStyleKTable);      val->SetString(style);    }  }  else {    val->SetString(NS_LITERAL_STRING(""));  }  return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),                             (void **)&aValue);}