nsAutoString hex; ColorToHex(color->mBackgroundColor, hex); val->SetString(hex);
nsDOMCSSRGBColor *rgb = nsnull; rgb = GetDOMCSSRGBColor(color->mBackgroundColor); if (rgb) { val->SetColor(rgb); } else { delete val; return NS_ERROR_OUT_OF_MEMORY; }
nsComputedDOMStyle::GetBackgroundColor(nsIFrame *aFrame,                             nsIDOMCSSPrimitiveValue*& aValue){  nsROCSSPrimitiveValue* val=GetROCSSPrimitiveValue();  NS_ENSURE_TRUE(val, NS_ERROR_OUT_OF_MEMORY);  const nsStyleBackground* color=nsnull;  GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&)color, aFrame);  if(color) {    if ((color->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) &&        !(color->mBackgroundFlags & NS_STYLE_BG_PROPAGATED_TO_PARENT)) {      const nsCString& backgroundColor =        nsCSSProps::SearchKeywordTable(NS_STYLE_BG_COLOR_TRANSPARENT,                                       nsCSSProps::kBackgroundColorKTable);      val->SetString(backgroundColor);    }    else {      nsAutoString hex;      ColorToHex(color->mBackgroundColor, hex);      val->SetString(hex);    }  }  else {    val->SetString("");  }  return val->QueryInterface(NS_GET_IID(nsIDOMCSSPrimitiveValue),                             (void **)&aValue);}