default: { nsCSSValue value; if (ParseSingleValueProperty(aErrorCode, value, aPropID)) { if (ExpectEndProperty(aErrorCode, PR_TRUE)) { AppendValue(aPropID, value, aChangeHint); aErrorCode = NS_OK; return PR_TRUE; }  }
nsCOMPtr<nsIUnicharInputStream> input; nsresult rv = NS_NewStringUnicharInputStream(getter_AddRefs(input), str); if (NS_FAILED(rv)) { delete str; return rv; }  rv = InitScanner(input, aBaseURL); if (NS_FAILED(rv)) { return rv; }  mSection = eCSSSection_General; PRInt32 errorCode = NS_OK;  nsChangeHint hint = NS_STYLE_HINT_NONE;  if (aHint) { *aHint = hint; } nsCSSProperty propID = nsCSSProps::LookupProperty(aPropName); if (eCSSProperty_UNKNOWN == propID) { REPORT_UNEXPECTED(NS_LITERAL_STRING("Unknown property '") + aPropName + NS_LITERAL_STRING("'.  Declaration dropped.")); OUTPUT_ERROR(); ReleaseScanner(); return NS_OK; }  mData.AssertInitialState(); mTempData.AssertInitialState(); aDeclaration->ExpandTo(&mData); nsresult result = NS_OK; if (ParseProperty(errorCode, propID, hint)) { TransferTempData(aDeclaration, propID, PR_FALSE); } else { REPORT_UNEXPECTED( NS_LITERAL_STRING("Error in parsing value for property '") + aPropName + NS_LITERAL_STRING("'.  Declaration dropped.")); OUTPUT_ERROR(); ClearTempData(propID); if (errorCode != -1) { result = errorCode;
PRBool CSSParserImpl::ParseProperty(PRInt32& aErrorCode,                                    nsCSSProperty aPropID,                                    nsChangeHint& aChangeHint){  switch (aPropID) {  // handle shorthand or multiple properties  case eCSSProperty_background:    return ParseBackground(aErrorCode, aChangeHint);  case eCSSProperty_background_position:    return ParseBackgroundPosition(aErrorCode, aChangeHint);  case eCSSProperty_border:    return ParseBorder(aErrorCode, aChangeHint);  case eCSSProperty_border_color:    return ParseBorderColor(aErrorCode, aChangeHint);  case eCSSProperty_border_spacing:    return ParseBorderSpacing(aErrorCode, aChangeHint);  case eCSSProperty_border_style:    return ParseBorderStyle(aErrorCode, aChangeHint);  case eCSSProperty_border_bottom:    return ParseBorderSide(aErrorCode, kBorderBottomIDs, aChangeHint);  case eCSSProperty_border_left:    return ParseBorderSide(aErrorCode, kBorderLeftIDs, aChangeHint);  case eCSSProperty_border_right:    return ParseBorderSide(aErrorCode, kBorderRightIDs, aChangeHint);  case eCSSProperty_border_top:    return ParseBorderSide(aErrorCode, kBorderTopIDs, aChangeHint);  case eCSSProperty_border_bottom_colors:    return ParseBorderColors(aErrorCode,                             &mTempData.mMargin.mBorderColors.mBottom,                             aChangeHint, aPropID);  case eCSSProperty_border_left_colors:    return ParseBorderColors(aErrorCode,                             &mTempData.mMargin.mBorderColors.mLeft,                             aChangeHint, aPropID);  case eCSSProperty_border_right_colors:    return ParseBorderColors(aErrorCode,                             &mTempData.mMargin.mBorderColors.mRight,                             aChangeHint, aPropID);  case eCSSProperty_border_top_colors:    return ParseBorderColors(aErrorCode,                             &mTempData.mMargin.mBorderColors.mTop,                             aChangeHint, aPropID);  case eCSSProperty_border_width:    return ParseBorderWidth(aErrorCode, aChangeHint);  case eCSSProperty__moz_border_radius:    return ParseBorderRadius(aErrorCode, aChangeHint);#ifdef ENABLE_OUTLINE  case eCSSProperty__moz_outline_radius:    return ParseOutlineRadius(aErrorCode, aChangeHint);#endif  case eCSSProperty_clip:    return ParseRect(mTempData.mDisplay.mClip, aErrorCode,                     eCSSProperty_clip, aChangeHint);  case eCSSProperty_content:    return ParseContent(aErrorCode, aChangeHint);  case eCSSProperty__moz_counter_increment:    return ParseCounterData(aErrorCode, &mTempData.mContent.mCounterIncrement,                            aPropID, aChangeHint);  case eCSSProperty__moz_counter_reset:    return ParseCounterData(aErrorCode, &mTempData.mContent.mCounterReset,                            aPropID, aChangeHint);  case eCSSProperty_cue:    return ParseCue(aErrorCode, aChangeHint);  case eCSSProperty_cursor:    return ParseCursor(aErrorCode, aChangeHint);  case eCSSProperty_font:    return ParseFont(aErrorCode, aChangeHint);  case eCSSProperty_image_region:    return ParseRect(mTempData.mList.mImageRegion, aErrorCode,                     eCSSProperty_image_region, aChangeHint);  case eCSSProperty_list_style:    return ParseListStyle(aErrorCode, aChangeHint);  case eCSSProperty_margin:    return ParseMargin(aErrorCode, aChangeHint);#ifdef ENABLE_OUTLINE  case eCSSProperty__moz_outline:    return ParseOutline(aErrorCode, aChangeHint);#endif  case eCSSProperty_padding:    return ParsePadding(aErrorCode, aChangeHint);  case eCSSProperty_pause:    return ParsePause(aErrorCode, aChangeHint);  case eCSSProperty_play_during:    return ParsePlayDuring(aErrorCode, aChangeHint);  case eCSSProperty_quotes:    return ParseQuotes(aErrorCode, aChangeHint);  case eCSSProperty_size:    return ParseSize(aErrorCode, aChangeHint);  case eCSSProperty_text_shadow:    return ParseTextShadow(aErrorCode, aChangeHint);  // Strip out properties we use internally. These properties are used  // by compound property parsing routines (e.g. "background-position").  case eCSSProperty_background_x_position:  case eCSSProperty_background_y_position:  case eCSSProperty_border_x_spacing:  case eCSSProperty_border_y_spacing:  case eCSSProperty_play_during_flags:  case eCSSProperty_size_height:  case eCSSProperty_size_width:    // The user can't use these    REPORT_UNEXPECTED(NS_LITERAL_STRING("Attempt to use inaccessible property"));    return PR_FALSE;  default:  // must be single property    {      nsCSSValue value;      if (ParseSingleValueProperty(aErrorCode, value, aPropID)) {        if (ExpectEndProperty(aErrorCode, PR_TRUE)) {          AppendValue(aPropID, value, aChangeHint);          aErrorCode = NS_OK;          return PR_TRUE;        }        // XXX Report errors?      }      // XXX Report errors?    }  }  return PR_FALSE;}