NS_ASSERTION(nsnull != aBaseURL, "need base URL"); NS_ASSERTION(nsnull != aDeclaration, "Need declaration to parse into!");
switch (aPropID) { case eCSSProperty_appearance: return ParseAppearance(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_background: return ParseBackground(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_background_position: return ParseBackgroundPosition(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_border: return ParseBorder(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_border_color: return ParseBorderColor(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_border_spacing: return ParseBorderSpacing(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_border_style: return ParseBorderStyle(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_border_bottom: return ParseBorderSide(aErrorCode, aDeclaration, kBorderBottomIDs, aChangeHint); case eCSSProperty_border_left: return ParseBorderSide(aErrorCode, aDeclaration, kBorderLeftIDs, aChangeHint); case eCSSProperty_border_right: return ParseBorderSide(aErrorCode, aDeclaration, kBorderRightIDs, aChangeHint); case eCSSProperty_border_top: return ParseBorderSide(aErrorCode, aDeclaration, kBorderTopIDs, aChangeHint); case eCSSProperty_border_bottom_colors: case eCSSProperty_border_left_colors: case eCSSProperty_border_right_colors: case eCSSProperty_border_top_colors: return ParseBorderColors(aErrorCode, aDeclaration, aChangeHint, aPropID); case eCSSProperty_border_width: return ParseBorderWidth(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty__moz_border_radius: return ParseBorderRadius(aErrorCode, aDeclaration, aChangeHint); #ifdef ENABLE_OUTLINE case eCSSProperty__moz_outline_radius: return ParseOutlineRadius(aErrorCode, aDeclaration, aChangeHint); #endif case eCSSProperty_clip: return ParseClip(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_content: return ParseContent(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty__moz_counter_increment: case eCSSProperty__moz_counter_reset: return ParseCounterData(aErrorCode, aDeclaration, aPropID, aChangeHint); case eCSSProperty_cue: return ParseCue(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_cursor: return ParseCursor(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_font: return ParseFont(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_image_region: return ParseImageRegion(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_list_style: return ParseListStyle(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_margin: return ParseMargin(aErrorCode, aDeclaration, aChangeHint); #ifdef ENABLE_OUTLINE case eCSSProperty__moz_outline: return ParseOutline(aErrorCode, aDeclaration, aChangeHint); #endif case eCSSProperty_padding: return ParsePadding(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_pause: return ParsePause(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_play_during: return ParsePlayDuring(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_quotes: return ParseQuotes(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_size: return ParseSize(aErrorCode, aDeclaration, aChangeHint); case eCSSProperty_text_shadow: return ParseTextShadow(aErrorCode, aDeclaration, aChangeHint);
CSSParserImpl::ParseProperty(const nsAString& aPropName,                             const nsAString& aPropValue,                             nsIURI* aBaseURL,                             nsCSSDeclaration* aDeclaration,                             nsChangeHint* aHint){  NS_ASSERTION(nsnull != aBaseURL, "need base URL");  NS_ASSERTION(nsnull != aDeclaration, "Need declaration to parse into!");  nsString* str = new nsAutoString(aPropValue);  if (!str) {    return NS_ERROR_OUT_OF_MEMORY;  }  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) { // unknown property    REPORT_UNEXPECTED(NS_LITERAL_STRING("Unknown property '") +                      aPropName +                      NS_LITERAL_STRING("'.  Declaration dropped."));    OUTPUT_ERROR();    ReleaseScanner();    return NS_OK;  }    if (! ParseProperty(errorCode, aDeclaration, propID, hint)) {    REPORT_UNEXPECTED(      NS_LITERAL_STRING("Error in parsing value for property '") +      aPropName +      NS_LITERAL_STRING("'.  Declaration dropped."));    OUTPUT_ERROR();    if (errorCode != -1) { // -1 means EOF which we ignore      ReleaseScanner();      return errorCode;    }  }  CLEAR_ERROR();    if (aHint) {    NS_UpdateHint(*aHint, hint);  }    ReleaseScanner();  return NS_OK;}