nsCSSValue  value; GetValue(aProperty, value); return AppendValueToString(aProperty, value, aResult);
nsCSSUnit unit = aValue.GetUnit();  if (eCSSUnit_Null == unit) { return PR_FALSE; }  if ((eCSSUnit_String <= unit) && (unit <= eCSSUnit_Counters)) { switch (unit) { case eCSSUnit_URL:      aResult.Append(NS_LITERAL_STRING("url(")); break; case eCSSUnit_Attr:     aResult.Append(NS_LITERAL_STRING("attr(")); break; case eCSSUnit_Counter:  aResult.Append(NS_LITERAL_STRING("counter(")); break; case eCSSUnit_Counters: aResult.Append(NS_LITERAL_STRING("counters(")); break; default:  break; } nsAutoString  buffer; aValue.GetStringValue(buffer); aResult.Append(buffer); } else if (eCSSUnit_Integer == unit) { switch (aProperty) { case eCSSProperty_color: case eCSSProperty_background_color: {   nsAutoString tmpStr; nsCAutoString str; if (nsCSSProps::GetColorName(aValue.GetIntValue(), str)){ aResult.Append(NS_ConvertASCIItoUCS2(str)); } else { tmpStr.AppendInt(aValue.GetIntValue(), 10); aResult.Append(tmpStr); } } break;  default: { nsAutoString tmpStr; tmpStr.AppendInt(aValue.GetIntValue(), 10); aResult.Append(tmpStr); } } } else if (eCSSUnit_Enumerated == unit) { if (eCSSProperty_text_decoration == aProperty) { PRInt32 intValue = aValue.GetIntValue(); if (NS_STYLE_TEXT_DECORATION_NONE != intValue) { PRInt32 mask; for (mask = NS_STYLE_TEXT_DECORATION_UNDERLINE; mask <= NS_STYLE_TEXT_DECORATION_BLINK; mask <<= 1) { if ((mask & intValue) == mask) { aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, mask))); intValue &= ~mask; if (0 != intValue) { aResult.Append(PRUnichar(' ')); } } } } else { aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_TEXT_DECORATION_NONE))); } } else if (eCSSProperty_azimuth == aProperty) { PRInt32 intValue = aValue.GetIntValue(); aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, (intValue & ~NS_STYLE_AZIMUTH_BEHIND)))); if ((NS_STYLE_AZIMUTH_BEHIND & intValue) != 0) { aResult.Append(PRUnichar(' ')); aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_AZIMUTH_BEHIND))); } } else if (eCSSProperty_play_during_flags == aProperty) { PRInt32 intValue = aValue.GetIntValue(); if ((NS_STYLE_PLAY_DURING_MIX & intValue) != 0) { aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PLAY_DURING_MIX))); } if ((NS_STYLE_PLAY_DURING_REPEAT & intValue) != 0) { if (NS_STYLE_PLAY_DURING_REPEAT != intValue) { aResult.Append(PRUnichar(' ')); } aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PLAY_DURING_REPEAT))); } } else if (eCSSProperty_marks == aProperty) { PRInt32 intValue = aValue.GetIntValue(); if ((NS_STYLE_PAGE_MARKS_CROP & intValue) != 0) { aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PAGE_MARKS_CROP))); } if ((NS_STYLE_PAGE_MARKS_REGISTER & intValue) != 0) { if ((NS_STYLE_PAGE_MARKS_CROP & intValue) != 0) { aResult.Append(PRUnichar(' ')); } aResult.Append(NS_ConvertASCIItoUCS2(nsCSSProps::LookupPropertyValue(aProperty, NS_STYLE_PAGE_MARKS_REGISTER))); } } else { const nsCString& name = nsCSSProps::LookupPropertyValue(aProperty, aValue.GetIntValue()); aResult.Append(NS_ConvertASCIItoUCS2(name)); } } else if (eCSSUnit_Color == unit){ nsAutoString tmpStr; nscolor color = aValue.GetColorValue();  aResult.Append(NS_LITERAL_STRING("rgb("));  tmpStr.AppendInt(NS_GET_R(color), 10); aResult.Append(tmpStr);  aResult.Append(PRUnichar(','));  tmpStr.Truncate(); tmpStr.AppendInt(NS_GET_G(color), 10); aResult.Append(tmpStr);  aResult.Append(PRUnichar(','));  tmpStr.Truncate(); tmpStr.AppendInt(NS_GET_B(color), 10); aResult.Append(tmpStr);  aResult.Append(PRUnichar(')')); } else if (eCSSUnit_Percent == unit) { nsAutoString tmpStr; tmpStr.AppendFloat(aValue.GetPercentValue() * 100.0f); aResult.Append(tmpStr); } else if (eCSSUnit_Percent < unit) { nsAutoString tmpStr; tmpStr.AppendFloat(aValue.GetFloatValue()); aResult.Append(tmpStr); }  switch (unit) { case eCSSUnit_Null:         break; case eCSSUnit_Auto:         aResult.Append(NS_LITERAL_STRING("auto"));     break; case eCSSUnit_Inherit:      aResult.Append(NS_LITERAL_STRING("inherit"));  break; case eCSSUnit_None:         aResult.Append(NS_LITERAL_STRING("none"));     break; case eCSSUnit_Normal:       aResult.Append(NS_LITERAL_STRING("normal"));   break;  case eCSSUnit_String:       break; case eCSSUnit_URL: case eCSSUnit_Attr: case eCSSUnit_Counter: case eCSSUnit_Counters:     aResult.Append(PRUnichar(')'));    break; case eCSSUnit_Integer:      break; case eCSSUnit_Enumerated:   break; case eCSSUnit_Color:        break; case eCSSUnit_Percent:      aResult.Append(PRUnichar('%'));    break; case eCSSUnit_Number:       break;  case eCSSUnit_Inch:         aResult.Append(NS_LITERAL_STRING("in"));   break; case eCSSUnit_Foot:         aResult.Append(NS_LITERAL_STRING("ft"));   break; case eCSSUnit_Mile:         aResult.Append(NS_LITERAL_STRING("mi"));   break; case eCSSUnit_Millimeter:   aResult.Append(NS_LITERAL_STRING("mm"));   break; case eCSSUnit_Centimeter:   aResult.Append(NS_LITERAL_STRING("cm"));   break; case eCSSUnit_Meter:        aResult.Append(NS_LITERAL_STRING("m"));    break; case eCSSUnit_Kilometer:    aResult.Append(NS_LITERAL_STRING("km"));   break; case eCSSUnit_Point:        aResult.Append(NS_LITERAL_STRING("pt"));   break; case eCSSUnit_Pica:         aResult.Append(NS_LITERAL_STRING("pc"));   break; case eCSSUnit_Didot:        aResult.Append(NS_LITERAL_STRING("dt"));   break; case eCSSUnit_Cicero:       aResult.Append(NS_LITERAL_STRING("cc"));   break;  case eCSSUnit_EM:           aResult.Append(NS_LITERAL_STRING("em"));   break; case eCSSUnit_EN:           aResult.Append(NS_LITERAL_STRING("en"));   break; case eCSSUnit_XHeight:      aResult.Append(NS_LITERAL_STRING("ex"));   break; case eCSSUnit_CapHeight:    aResult.Append(NS_LITERAL_STRING("cap"));  break; case eCSSUnit_Char:         aResult.Append(NS_LITERAL_STRING("ch"));   break;  case eCSSUnit_Pixel:        aResult.Append(NS_LITERAL_STRING("px"));   break;  case eCSSUnit_Degree:       aResult.Append(NS_LITERAL_STRING("deg"));  break; case eCSSUnit_Grad:         aResult.Append(NS_LITERAL_STRING("grad")); break; case eCSSUnit_Radian:       aResult.Append(NS_LITERAL_STRING("rad"));  break;  case eCSSUnit_Hertz:        aResult.Append(NS_LITERAL_STRING("Hz"));   break; case eCSSUnit_Kilohertz:    aResult.Append(NS_LITERAL_STRING("kHz"));  break;  case eCSSUnit_Seconds:      aResult.Append(PRUnichar('s'));    break; case eCSSUnit_Milliseconds: aResult.Append(NS_LITERAL_STRING("ms"));   break; }  return PR_TRUE;
PRBool CSSDeclarationImpl::AppendValueToString(nsCSSProperty aProperty, nsString& aResult){  nsCSSValue  value;  GetValue(aProperty, value);  return AppendValueToString(aProperty, value, aResult);}