if (val) { rv = val->QueryInterface(NS_GET_IID(nsIDOMCSSValue), (void **)aReturn);
nsComputedDOMStyle::GetPropertyCSSValue(const nsAReadableString& aPropertyName,                                        nsIDOMCSSValue** aReturn){  NS_ENSURE_ARG_POINTER(aReturn);  *aReturn = nsnull;  nsCOMPtr<nsIPresShell> presShell=do_QueryReferent(mPresShellWeak);  NS_ENSURE_TRUE(presShell, NS_ERROR_FAILURE);  nsIFrame *frame = nsnull;  presShell->GetPrimaryFrameFor(mContent, &frame);  nsCOMPtr<nsIDOMCSSPrimitiveValue> val;  nsresult rv = NS_OK;  // XXX FIX THIS!!!  nsCSSProperty prop = nsCSSProps::LookupProperty(aPropertyName);  switch (prop) {    case eCSSProperty_binding :      rv = GetBehavior(frame, *getter_AddRefs(val)); break;    case eCSSProperty_display :      rv = GetDisplay(frame, *getter_AddRefs(val)); break;    case eCSSProperty_position :      rv = GetPosition(frame, *getter_AddRefs(val)); break;    case eCSSProperty_float :      rv = GetCssFloat(frame, *getter_AddRefs(val)); break;    case eCSSProperty_width :      rv = GetWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_height :      rv = GetHeight(frame, *getter_AddRefs(val)); break;    case eCSSProperty_max_height :      rv = GetMaxHeight(frame, *getter_AddRefs(val)); break;    case eCSSProperty_max_width :      rv = GetMaxWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_min_height :      rv = GetMinHeight(frame, *getter_AddRefs(val)); break;    case eCSSProperty_min_width :      rv = GetMinWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_left :      rv = GetLeft(frame, *getter_AddRefs(val)); break;    case eCSSProperty_top :      rv = GetTop(frame, *getter_AddRefs(val)); break;    case eCSSProperty_right :      rv = GetRight(frame, *getter_AddRefs(val)); break;    case eCSSProperty_bottom :      rv = GetBottom(frame, *getter_AddRefs(val)); break;      // Font properties    case eCSSProperty_color :      rv = GetColor(frame, *getter_AddRefs(val)); break;    case eCSSProperty_font_family :      rv = GetFontFamily(frame, *getter_AddRefs(val)); break;    case eCSSProperty_font_size :      rv = GetFontSize(frame, *getter_AddRefs(val)); break;    case eCSSProperty_font_style :      rv = GetFontStyle(frame, *getter_AddRefs(val)); break;    case eCSSProperty_font_weight :      rv = GetFontWeight(frame, *getter_AddRefs(val)); break;    case eCSSProperty_font_variant :      rv = GetFontVariant(frame, *getter_AddRefs(val)); break;      // Background properties    case eCSSProperty_background_color :      rv = GetBackgroundColor(frame, *getter_AddRefs(val)); break;    case eCSSProperty_background_image :      rv = GetBackgroundImage(frame, *getter_AddRefs(val)); break;      // Padding properties    case eCSSProperty_padding :      rv = GetPadding(frame, *getter_AddRefs(val)); break;    case eCSSProperty_padding_top :      rv = GetPaddingTop(frame, *getter_AddRefs(val)); break;    case eCSSProperty_padding_bottom :      rv = GetPaddingBottom(frame, *getter_AddRefs(val)); break;    case eCSSProperty_padding_left :      rv = GetPaddingLeft(frame, *getter_AddRefs(val)); break;    case eCSSProperty_padding_right :      rv = GetPaddingRight(frame, *getter_AddRefs(val)); break;      // Border properties    case eCSSProperty_border_collapse :      rv = GetBorderCollapse(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_top_style :      rv = GetBorderTopStyle(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_bottom_style :      rv = GetBorderBottomStyle(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_left_style :      rv = GetBorderLeftStyle(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_right_style :      rv = GetBorderRightStyle(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_top_width :      rv = GetBorderTopWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_bottom_width :      rv = GetBorderBottomWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_left_width :      rv = GetBorderLeftWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_right_width :      rv = GetBorderRightWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_top_color :      rv = GetBorderTopColor(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_bottom_color :      rv = GetBorderBottomColor(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_left_color :      rv = GetBorderLeftColor(frame, *getter_AddRefs(val)); break;    case eCSSProperty_border_right_color :      rv = GetBorderRightColor(frame, *getter_AddRefs(val)); break;      // Margin properties    case eCSSProperty_margin_top :      rv = GetMarginTopWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_margin_bottom :      rv = GetMarginBottomWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_margin_left :      rv = GetMarginLeftWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_margin_right :      rv = GetMarginRightWidth(frame, *getter_AddRefs(val)); break;      // Marker property    case eCSSProperty_marker_offset :      rv = GetMarkerOffset(frame, *getter_AddRefs(val)); break;      // Outline properties    case eCSSProperty_outline_width :      rv = GetOutlineWidth(frame, *getter_AddRefs(val)); break;    case eCSSProperty_outline_style :      rv = GetOutlineStyle(frame, *getter_AddRefs(val)); break;    case eCSSProperty_outline_color:      rv = GetOutlineColor(frame, *getter_AddRefs(val)); break;      // Text properties    case eCSSProperty_text_align:      rv = GetTextAlign(frame, *getter_AddRefs(val)); break;    case eCSSProperty_text_decoration:      rv = GetTextDecoration(frame, *getter_AddRefs(val)); break;    case eCSSProperty_text_indent:      rv = GetTextIndent(frame, *getter_AddRefs(val)); break;    case eCSSProperty_text_transform:      rv = GetTextTransform(frame, *getter_AddRefs(val)); break;    case eCSSProperty_letter_spacing:      rv = GetLetterSpacing(frame, *getter_AddRefs(val)); break;    case eCSSProperty_word_spacing:      rv = GetWordSpacing(frame, *getter_AddRefs(val)); break;    case eCSSProperty_white_space:      rv = GetWhiteSpace(frame, *getter_AddRefs(val)); break;            // List properties    case eCSSProperty_list_style_image:      rv = GetListStyleImage(frame, *getter_AddRefs(val)); break;       // Display properties    case eCSSProperty_visibility:      rv = GetVisibility(frame, *getter_AddRefs(val)); break;      // Z-Index property    case eCSSProperty_z_index:      rv = GetZIndex(frame, *getter_AddRefs(val)); break;      // Clip    case eCSSProperty_clip:      rv = GetClip(frame, *getter_AddRefs(val)); break;    case eCSSProperty_overflow:      rv = GetOverflow(frame, *getter_AddRefs(val)); break;    default :      break;  }  if (val) {    rv = val->QueryInterface(NS_GET_IID(nsIDOMCSSValue), (void **)aReturn);  }  // Release the current style context for it should be re-resolved  // whenever a frame is not available.  mStyleContextHolder=nsnull;  return rv;}