NS_ASSERTION(nsnull != aBaseURL, "need base URL"); NS_ASSERTION(nsnull != aDeclaration, "Need declaration to parse into!"); *aChanged = PR_FALSE;
switch (aPropID) { case eCSSProperty_background: return ParseBackground(aErrorCode); case eCSSProperty_background_position: return ParseBackgroundPosition(aErrorCode); case eCSSProperty_border: return ParseBorderSide(aErrorCode, kBorderTopIDs, PR_TRUE); case eCSSProperty_border_color: return ParseBorderColor(aErrorCode); case eCSSProperty_border_spacing: return ParseBorderSpacing(aErrorCode); case eCSSProperty_border_style: return ParseBorderStyle(aErrorCode); case eCSSProperty_border_bottom: return ParseBorderSide(aErrorCode, kBorderBottomIDs, PR_FALSE); case eCSSProperty_border_left: return ParseBorderSide(aErrorCode, kBorderLeftIDs, PR_FALSE); case eCSSProperty_border_right: return ParseBorderSide(aErrorCode, kBorderRightIDs, PR_FALSE); case eCSSProperty_border_top: return ParseBorderSide(aErrorCode, kBorderTopIDs, PR_FALSE); case eCSSProperty_border_bottom_colors: return ParseBorderColors(aErrorCode, &mTempData.mMargin.mBorderColors.mBottom, aPropID); case eCSSProperty_border_left_colors: return ParseBorderColors(aErrorCode, &mTempData.mMargin.mBorderColors.mLeft, aPropID); case eCSSProperty_border_right_colors: return ParseBorderColors(aErrorCode, &mTempData.mMargin.mBorderColors.mRight, aPropID); case eCSSProperty_border_top_colors: return ParseBorderColors(aErrorCode, &mTempData.mMargin.mBorderColors.mTop, aPropID); case eCSSProperty_border_width: return ParseBorderWidth(aErrorCode); case eCSSProperty__moz_border_radius: return ParseBorderRadius(aErrorCode); #ifdef ENABLE_OUTLINE case eCSSProperty__moz_outline_radius: return ParseOutlineRadius(aErrorCode); #endif case eCSSProperty_clip: return ParseRect(mTempData.mDisplay.mClip, aErrorCode, eCSSProperty_clip); case eCSSProperty_content: return ParseContent(aErrorCode); case eCSSProperty__moz_counter_increment: return ParseCounterData(aErrorCode, &mTempData.mContent.mCounterIncrement, aPropID); case eCSSProperty__moz_counter_reset: return ParseCounterData(aErrorCode, &mTempData.mContent.mCounterReset, aPropID); case eCSSProperty_cue: return ParseCue(aErrorCode); case eCSSProperty_cursor: return ParseCursor(aErrorCode); case eCSSProperty_font: return ParseFont(aErrorCode); case eCSSProperty_image_region: return ParseRect(mTempData.mList.mImageRegion, aErrorCode, eCSSProperty_image_region); case eCSSProperty_list_style: return ParseListStyle(aErrorCode); case eCSSProperty_margin: return ParseMargin(aErrorCode); case eCSSProperty_margin_end: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_margin_end, NS_BOXPROP_SOURCE_LOGICAL); case eCSSProperty_margin_left: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_margin_left, NS_BOXPROP_SOURCE_PHYSICAL); case eCSSProperty_margin_right: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_margin_right, NS_BOXPROP_SOURCE_PHYSICAL); case eCSSProperty_margin_start: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_margin_start, NS_BOXPROP_SOURCE_LOGICAL); #ifdef ENABLE_OUTLINE case eCSSProperty__moz_outline: return ParseOutline(aErrorCode); #endif case eCSSProperty_overflow: return ParseOverflow(aErrorCode); case eCSSProperty_padding: return ParsePadding(aErrorCode); case eCSSProperty_padding_end: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_padding_end, NS_BOXPROP_SOURCE_LOGICAL); case eCSSProperty_padding_left: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_padding_left, NS_BOXPROP_SOURCE_PHYSICAL); case eCSSProperty_padding_right: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_padding_right, NS_BOXPROP_SOURCE_PHYSICAL); case eCSSProperty_padding_start: return ParseDirectionalBoxProperty(aErrorCode, eCSSProperty_padding_start, NS_BOXPROP_SOURCE_LOGICAL); case eCSSProperty_pause: return ParsePause(aErrorCode); case eCSSProperty_quotes: return ParseQuotes(aErrorCode); case eCSSProperty_size: return ParseSize(aErrorCode); case eCSSProperty_text_shadow: return ParseTextShadow(aErrorCode);
CSSParserImpl::ParseProperty(const nsCSSProperty aPropID,                             const nsAString& aPropValue,                             nsIURI* aSheetURL,                             nsIURI* aBaseURL,                             nsCSSDeclaration* aDeclaration,                             PRBool* aChanged){  NS_ASSERTION(nsnull != aBaseURL, "need base URL");  NS_ASSERTION(nsnull != aDeclaration, "Need declaration to parse into!");  *aChanged = PR_FALSE;  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, aSheetURL, 0, aBaseURL);  if (NS_FAILED(rv)) {    return rv;  }  mSection = eCSSSection_General;  nsresult errorCode = NS_OK;  if (eCSSProperty_UNKNOWN == aPropID) { // unknown property    NS_ConvertASCIItoUTF16 propName(nsCSSProps::GetStringValue(aPropID));    const PRUnichar *params[] = {      propName.get()    };    REPORT_UNEXPECTED_P(PEUnknownProperty, params);    REPORT_UNEXPECTED(PEDeclDropped);    OUTPUT_ERROR();    ReleaseScanner();    return NS_OK;  }    mData.AssertInitialState();  mTempData.AssertInitialState();  aDeclaration->ExpandTo(&mData);  nsresult result = NS_OK;  if (ParseProperty(errorCode, aPropID)) {    TransferTempData(aDeclaration, aPropID, PR_FALSE, aChanged);  } else {    NS_ConvertASCIItoUTF16 propName(nsCSSProps::GetStringValue(aPropID));    const PRUnichar *params[] = {      propName.get()    };    REPORT_UNEXPECTED_P(PEPropertyParsingError, params);    REPORT_UNEXPECTED(PEDeclDropped);    OUTPUT_ERROR();    ClearTempData(aPropID);    NS_ASSERTION(errorCode != nsresult(-1), "-1 is no longer used for EOF");    result = errorCode;  }  CLEAR_ERROR();    aDeclaration->CompressFrom(&mData);    ReleaseScanner();  return result;}