CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue)
CSSDeclarationImpl::GetValue(const nsString& aProperty, nsString& aValue)
CSSDeclarationImpl::GetValue(nsCSSProperty aProperty, nsCSSValue& aValue){  nsresult result = NS_OK;  switch (aProperty) {    // nsCSSFont    case eCSSProperty_font_family:    case eCSSProperty_font_style:    case eCSSProperty_font_variant:    case eCSSProperty_font_weight:    case eCSSProperty_font_size:    case eCSSProperty_font_size_adjust:    case eCSSProperty_font_stretch:      if (nsnull != mFont) {        switch (aProperty) {          case eCSSProperty_font_family:      aValue = mFont->mFamily;      break;          case eCSSProperty_font_style:       aValue = mFont->mStyle;       break;          case eCSSProperty_font_variant:     aValue = mFont->mVariant;     break;          case eCSSProperty_font_weight:      aValue = mFont->mWeight;      break;          case eCSSProperty_font_size:        aValue = mFont->mSize;        break;          case eCSSProperty_font_size_adjust: aValue = mFont->mSizeAdjust;  break;          case eCSSProperty_font_stretch:     aValue = mFont->mStretch;     break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    // nsCSSColor    case eCSSProperty_color:    case eCSSProperty_background_color:    case eCSSProperty_background_image:    case eCSSProperty_background_repeat:    case eCSSProperty_background_attachment:    case eCSSProperty_background_x_position:    case eCSSProperty_background_y_position:    case eCSSProperty_cursor:    case eCSSProperty_opacity:      if (nsnull != mColor) {        switch (aProperty) {          case eCSSProperty_color:                  aValue = mColor->mColor;           break;          case eCSSProperty_background_color:       aValue = mColor->mBackColor;       break;          case eCSSProperty_background_image:       aValue = mColor->mBackImage;       break;          case eCSSProperty_background_repeat:      aValue = mColor->mBackRepeat;      break;          case eCSSProperty_background_attachment:  aValue = mColor->mBackAttachment;  break;          case eCSSProperty_background_x_position:  aValue = mColor->mBackPositionX;   break;          case eCSSProperty_background_y_position:  aValue = mColor->mBackPositionY;   break;          case eCSSProperty_cursor:            if (nsnull != mColor->mCursor) {              aValue = mColor->mCursor->mValue;            }            break;          case eCSSProperty_opacity:                aValue = mColor->mOpacity;         break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    // nsCSSText    case eCSSProperty_word_spacing:    case eCSSProperty_letter_spacing:    case eCSSProperty_text_decoration:    case eCSSProperty_vertical_align:    case eCSSProperty_text_transform:    case eCSSProperty_text_align:    case eCSSProperty_text_indent:    case eCSSProperty_unicode_bidi:    case eCSSProperty_line_height:    case eCSSProperty_white_space:      if (nsnull != mText) {        switch (aProperty) {          case eCSSProperty_word_spacing:     aValue = mText->mWordSpacing;    break;          case eCSSProperty_letter_spacing:   aValue = mText->mLetterSpacing;  break;          case eCSSProperty_text_decoration:  aValue = mText->mDecoration;     break;          case eCSSProperty_vertical_align:   aValue = mText->mVerticalAlign;  break;          case eCSSProperty_text_transform:   aValue = mText->mTextTransform;  break;          case eCSSProperty_text_align:       aValue = mText->mTextAlign;      break;          case eCSSProperty_text_indent:      aValue = mText->mTextIndent;     break;          case eCSSProperty_unicode_bidi:     aValue = mText->mUnicodeBidi;    break;          case eCSSProperty_line_height:      aValue = mText->mLineHeight;     break;          case eCSSProperty_white_space:      aValue = mText->mWhiteSpace;     break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_text_shadow_color:    case eCSSProperty_text_shadow_x:    case eCSSProperty_text_shadow_y:    case eCSSProperty_text_shadow_radius:      if ((nsnull != mText) && (nsnull != mText->mTextShadow)) {        switch (aProperty) {          case eCSSProperty_text_shadow_color:  aValue = mText->mTextShadow->mColor;    break;          case eCSSProperty_text_shadow_x:      aValue = mText->mTextShadow->mXOffset;  break;          case eCSSProperty_text_shadow_y:      aValue = mText->mTextShadow->mYOffset;  break;          case eCSSProperty_text_shadow_radius: aValue = mText->mTextShadow->mRadius;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      break;      // nsCSSDisplay    case eCSSProperty_float:    case eCSSProperty_clear:    case eCSSProperty_display:    case eCSSProperty_direction:    case eCSSProperty_visibility:    case eCSSProperty_overflow:      if (nsnull != mDisplay) {        switch (aProperty) {          case eCSSProperty_float:      aValue = mDisplay->mFloat;      break;          case eCSSProperty_clear:      aValue = mDisplay->mClear;      break;          case eCSSProperty_display:    aValue = mDisplay->mDisplay;    break;          case eCSSProperty_direction:  aValue = mDisplay->mDirection;  break;          case eCSSProperty_visibility: aValue = mDisplay->mVisibility; break;          case eCSSProperty_overflow:   aValue = mDisplay->mOverflow;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_clip_top:    case eCSSProperty_clip_right:    case eCSSProperty_clip_bottom:    case eCSSProperty_clip_left:      if ((nsnull != mDisplay) && (nsnull != mDisplay->mClip)) {        switch(aProperty) {          case eCSSProperty_clip_top:     aValue = mDisplay->mClip->mTop;     break;          case eCSSProperty_clip_right:   aValue = mDisplay->mClip->mRight;   break;          case eCSSProperty_clip_bottom:  aValue = mDisplay->mClip->mBottom;  break;          case eCSSProperty_clip_left:    aValue = mDisplay->mClip->mLeft;    break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    // nsCSSMargin    case eCSSProperty_margin_top:    case eCSSProperty_margin_right:    case eCSSProperty_margin_bottom:    case eCSSProperty_margin_left:      if ((nsnull != mMargin) && (nsnull != mMargin->mMargin)) {        switch (aProperty) {          case eCSSProperty_margin_top:     aValue = mMargin->mMargin->mTop;     break;          case eCSSProperty_margin_right:   aValue = mMargin->mMargin->mRight;   break;          case eCSSProperty_margin_bottom:  aValue = mMargin->mMargin->mBottom;  break;          case eCSSProperty_margin_left:    aValue = mMargin->mMargin->mLeft;    break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_padding_top:    case eCSSProperty_padding_right:    case eCSSProperty_padding_bottom:    case eCSSProperty_padding_left:      if ((nsnull != mMargin) && (nsnull != mMargin->mPadding)) {        switch (aProperty) {          case eCSSProperty_padding_top:    aValue = mMargin->mPadding->mTop;    break;          case eCSSProperty_padding_right:  aValue = mMargin->mPadding->mRight;  break;          case eCSSProperty_padding_bottom: aValue = mMargin->mPadding->mBottom; break;          case eCSSProperty_padding_left:   aValue = mMargin->mPadding->mLeft;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_border_top_width:    case eCSSProperty_border_right_width:    case eCSSProperty_border_bottom_width:    case eCSSProperty_border_left_width:      if ((nsnull != mMargin) && (nsnull != mMargin->mBorderWidth)) {        switch (aProperty) {          case eCSSProperty_border_top_width:     aValue = mMargin->mBorderWidth->mTop;     break;          case eCSSProperty_border_right_width:   aValue = mMargin->mBorderWidth->mRight;   break;          case eCSSProperty_border_bottom_width:  aValue = mMargin->mBorderWidth->mBottom;  break;          case eCSSProperty_border_left_width:    aValue = mMargin->mBorderWidth->mLeft;    break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_border_top_color:    case eCSSProperty_border_right_color:    case eCSSProperty_border_bottom_color:    case eCSSProperty_border_left_color:      if ((nsnull != mMargin) && (nsnull != mMargin->mBorderColor)) {        switch (aProperty) {          case eCSSProperty_border_top_color:     aValue = mMargin->mBorderColor->mTop;    break;          case eCSSProperty_border_right_color:   aValue = mMargin->mBorderColor->mRight;  break;          case eCSSProperty_border_bottom_color:  aValue = mMargin->mBorderColor->mBottom; break;          case eCSSProperty_border_left_color:    aValue = mMargin->mBorderColor->mLeft;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_border_top_style:    case eCSSProperty_border_right_style:    case eCSSProperty_border_bottom_style:    case eCSSProperty_border_left_style:      if ((nsnull != mMargin) && (nsnull != mMargin->mBorderStyle)) {        switch (aProperty) {          case eCSSProperty_border_top_style:     aValue = mMargin->mBorderStyle->mTop;    break;          case eCSSProperty_border_right_style:   aValue = mMargin->mBorderStyle->mRight;  break;          case eCSSProperty_border_bottom_style:  aValue = mMargin->mBorderStyle->mBottom; break;          case eCSSProperty_border_left_style:    aValue = mMargin->mBorderStyle->mLeft;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty__moz_border_radius_topLeft:    case eCSSProperty__moz_border_radius_topRight:    case eCSSProperty__moz_border_radius_bottomRight:    case eCSSProperty__moz_border_radius_bottomLeft:      if ((nsnull != mMargin) && (nsnull != mMargin->mBorderRadius)) {        switch (aProperty) {          case eCSSProperty__moz_border_radius_topLeft:			aValue = mMargin->mBorderRadius->mTop;    break;          case eCSSProperty__moz_border_radius_topRight:		aValue = mMargin->mBorderRadius->mRight;  break;          case eCSSProperty__moz_border_radius_bottomRight:	aValue = mMargin->mBorderRadius->mBottom; break;          case eCSSProperty__moz_border_radius_bottomLeft:	aValue = mMargin->mBorderRadius->mLeft;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty__moz_outline_radius_topLeft:    case eCSSProperty__moz_outline_radius_topRight:    case eCSSProperty__moz_outline_radius_bottomRight:    case eCSSProperty__moz_outline_radius_bottomLeft:      if ((nsnull != mMargin) && (nsnull != mMargin->mOutlineRadius)) {        switch (aProperty) {          case eCSSProperty__moz_outline_radius_topLeft:			aValue = mMargin->mOutlineRadius->mTop;    break;          case eCSSProperty__moz_outline_radius_topRight:			aValue = mMargin->mOutlineRadius->mRight;  break;          case eCSSProperty__moz_outline_radius_bottomRight:	aValue = mMargin->mOutlineRadius->mBottom; break;          case eCSSProperty__moz_outline_radius_bottomLeft:		aValue = mMargin->mOutlineRadius->mLeft;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_outline_width:    case eCSSProperty_outline_color:    case eCSSProperty_outline_style:    case eCSSProperty_float_edge:      if (nsnull != mMargin) {        switch (aProperty) {          case eCSSProperty_outline_width:      aValue = mMargin->mOutlineWidth; break;          case eCSSProperty_outline_color:      aValue = mMargin->mOutlineColor; break;          case eCSSProperty_outline_style:      aValue = mMargin->mOutlineStyle; break;          case eCSSProperty_float_edge:         aValue = mMargin->mFloatEdge;    break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    // nsCSSPosition    case eCSSProperty_position:    case eCSSProperty_width:    case eCSSProperty_min_width:    case eCSSProperty_max_width:    case eCSSProperty_height:    case eCSSProperty_min_height:    case eCSSProperty_max_height:    case eCSSProperty_box_sizing:    case eCSSProperty_z_index:      if (nsnull != mPosition) {        switch (aProperty) {          case eCSSProperty_position:   aValue = mPosition->mPosition;   break;          case eCSSProperty_width:      aValue = mPosition->mWidth;      break;          case eCSSProperty_min_width:  aValue = mPosition->mMinWidth;   break;          case eCSSProperty_max_width:  aValue = mPosition->mMaxWidth;   break;          case eCSSProperty_height:     aValue = mPosition->mHeight;     break;          case eCSSProperty_min_height: aValue = mPosition->mMinHeight;  break;          case eCSSProperty_max_height: aValue = mPosition->mMaxHeight;  break;          case eCSSProperty_box_sizing: aValue = mPosition->mBoxSizing;  break;          case eCSSProperty_z_index:    aValue = mPosition->mZIndex;     break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    case eCSSProperty_top:    case eCSSProperty_right:    case eCSSProperty_bottom:    case eCSSProperty_left:      if ((nsnull != mPosition) && (nsnull != mPosition->mOffset)) {        switch (aProperty) {          case eCSSProperty_top:    aValue = mPosition->mOffset->mTop;    break;          case eCSSProperty_right:  aValue = mPosition->mOffset->mRight;  break;          case eCSSProperty_bottom: aValue = mPosition->mOffset->mBottom; break;          case eCSSProperty_left:   aValue = mPosition->mOffset->mLeft;   break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;      // nsCSSList    case eCSSProperty_list_style_type:    case eCSSProperty_list_style_image:    case eCSSProperty_list_style_position:      if (nsnull != mList) {        switch (aProperty) {          case eCSSProperty_list_style_type:      aValue = mList->mType;     break;          case eCSSProperty_list_style_image:     aValue = mList->mImage;    break;          case eCSSProperty_list_style_position:  aValue = mList->mPosition; break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;      // nsCSSTable    case eCSSProperty_border_collapse:    case eCSSProperty_border_x_spacing:    case eCSSProperty_border_y_spacing:    case eCSSProperty_caption_side:    case eCSSProperty_empty_cells:    case eCSSProperty_table_layout:      if (nsnull != mTable) {        switch (aProperty) {          case eCSSProperty_border_collapse:  aValue = mTable->mBorderCollapse; break;          case eCSSProperty_border_x_spacing: aValue = mTable->mBorderSpacingX; break;          case eCSSProperty_border_y_spacing: aValue = mTable->mBorderSpacingY; break;          case eCSSProperty_caption_side:     aValue = mTable->mCaptionSide;    break;          case eCSSProperty_empty_cells:      aValue = mTable->mEmptyCells;     break;          case eCSSProperty_table_layout:     aValue = mTable->mLayout;         break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;      // nsCSSBreaks    case eCSSProperty_orphans:    case eCSSProperty_widows:    case eCSSProperty_page:    case eCSSProperty_page_break_after:    case eCSSProperty_page_break_before:    case eCSSProperty_page_break_inside:      if (nsnull != mBreaks) {        switch (aProperty) {          case eCSSProperty_orphans:            aValue = mBreaks->mOrphans;         break;          case eCSSProperty_widows:             aValue = mBreaks->mWidows;          break;          case eCSSProperty_page:               aValue = mBreaks->mPage;            break;          case eCSSProperty_page_break_after:   aValue = mBreaks->mPageBreakAfter;  break;          case eCSSProperty_page_break_before:  aValue = mBreaks->mPageBreakBefore; break;          case eCSSProperty_page_break_inside:  aValue = mBreaks->mPageBreakInside; break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;      // nsCSSPage    case eCSSProperty_marks:    case eCSSProperty_size_width:    case eCSSProperty_size_height:      if (nsnull != mPage) {        switch (aProperty) {          case eCSSProperty_marks:        aValue = mPage->mMarks;       break;          case eCSSProperty_size_width:   aValue = mPage->mSizeWidth;   break;          case eCSSProperty_size_height:  aValue = mPage->mSizeHeight;  break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;      // nsCSSContent    case eCSSProperty_content:    case eCSSProperty_counter_increment:    case eCSSProperty_counter_reset:    case eCSSProperty_marker_offset:    case eCSSProperty_quotes_open:    case eCSSProperty_quotes_close:      if (nsnull != mContent) {        switch (aProperty) {          case eCSSProperty_content:            if (nsnull != mContent->mContent) {              aValue = mContent->mContent->mValue;            }            break;          case eCSSProperty_counter_increment:              if (nsnull != mContent->mCounterIncrement) {              aValue = mContent->mCounterIncrement->mCounter;            }            break;          case eCSSProperty_counter_reset:            if (nsnull != mContent->mCounterReset) {              aValue = mContent->mCounterReset->mCounter;            }            break;          case eCSSProperty_marker_offset:      aValue = mContent->mMarkerOffset;     break;          case eCSSProperty_quotes_open:            if (nsnull != mContent->mQuotes) {              aValue = mContent->mQuotes->mOpen;            }            break;          case eCSSProperty_quotes_close:            if (nsnull != mContent->mQuotes) {              aValue = mContent->mQuotes->mClose;            }            break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;    // nsCSSUserInterface    case eCSSProperty_user_input:    case eCSSProperty_user_modify:    case eCSSProperty_user_select:    case eCSSProperty_key_equivalent:    case eCSSProperty_user_focus:    case eCSSProperty_resizer:    case eCSSProperty_behavior:      if (nsnull != mUserInterface) {        switch (aProperty) {          case eCSSProperty_user_input:       aValue = mUserInterface->mUserInput;       break;          case eCSSProperty_user_modify:      aValue = mUserInterface->mUserModify;      break;          case eCSSProperty_user_select:      aValue = mUserInterface->mUserSelect;      break;          case eCSSProperty_key_equivalent:            if (nsnull != mUserInterface->mKeyEquivalent) {              aValue = mUserInterface->mKeyEquivalent->mValue;            }            break;          case eCSSProperty_user_focus:       aValue = mUserInterface->mUserFocus;       break;          case eCSSProperty_resizer:          aValue = mUserInterface->mResizer;         break;          case eCSSProperty_behavior:                     aValue = mUserInterface->mBehavior;                    break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;      // nsCSSAural    case eCSSProperty_azimuth:    case eCSSProperty_elevation:    case eCSSProperty_cue_after:    case eCSSProperty_cue_before:    case eCSSProperty_pause_after:    case eCSSProperty_pause_before:    case eCSSProperty_pitch:    case eCSSProperty_pitch_range:    case eCSSProperty_play_during:    case eCSSProperty_play_during_flags:    case eCSSProperty_richness:    case eCSSProperty_speak:    case eCSSProperty_speak_header:    case eCSSProperty_speak_numeral:    case eCSSProperty_speak_punctuation:    case eCSSProperty_speech_rate:    case eCSSProperty_stress:    case eCSSProperty_voice_family:    case eCSSProperty_volume:      if (nsnull != mAural) {        switch (aProperty) {          case eCSSProperty_azimuth:            aValue = mAural->mAzimuth;          break;          case eCSSProperty_elevation:          aValue = mAural->mElevation;        break;          case eCSSProperty_cue_after:          aValue = mAural->mCueAfter;         break;          case eCSSProperty_cue_before:         aValue = mAural->mCueBefore;        break;          case eCSSProperty_pause_after:        aValue = mAural->mPauseAfter;       break;          case eCSSProperty_pause_before:       aValue = mAural->mPauseBefore;      break;          case eCSSProperty_pitch:              aValue = mAural->mPitch;            break;          case eCSSProperty_pitch_range:        aValue = mAural->mPitchRange;       break;          case eCSSProperty_play_during:        aValue = mAural->mPlayDuring;       break;          case eCSSProperty_play_during_flags:  aValue = mAural->mPlayDuringFlags;  break;          case eCSSProperty_richness:           aValue = mAural->mRichness;         break;          case eCSSProperty_speak:              aValue = mAural->mSpeak;            break;          case eCSSProperty_speak_header:       aValue = mAural->mSpeakHeader;      break;          case eCSSProperty_speak_numeral:      aValue = mAural->mSpeakNumeral;     break;          case eCSSProperty_speak_punctuation:  aValue = mAural->mSpeakPunctuation; break;          case eCSSProperty_speech_rate:        aValue = mAural->mSpeechRate;       break;          case eCSSProperty_stress:             aValue = mAural->mStress;           break;          case eCSSProperty_voice_family:       aValue = mAural->mVoiceFamily;      break;          case eCSSProperty_volume:             aValue = mAural->mVolume;           break;          CSS_BOGUS_DEFAULT; // make compiler happy        }      }      else {        aValue.Reset();      }      break;      // Shorthands    case eCSSProperty_background:    case eCSSProperty_border:    case eCSSProperty_border_spacing:    case eCSSProperty_clip:    case eCSSProperty_cue:    case eCSSProperty_font:    case eCSSProperty_list_style:    case eCSSProperty_margin:    case eCSSProperty_outline:    case eCSSProperty_padding:    case eCSSProperty_pause:    case eCSSProperty_quotes:    case eCSSProperty_size:    case eCSSProperty_text_shadow:    case eCSSProperty_background_position:    case eCSSProperty_border_top:    case eCSSProperty_border_right:    case eCSSProperty_border_bottom:    case eCSSProperty_border_left:    case eCSSProperty_border_color:    case eCSSProperty_border_style:    case eCSSProperty_border_width:    case eCSSProperty__moz_border_radius:      NS_ERROR("can't query for shorthand properties");    default:      result = NS_ERROR_ILLEGAL_VALUE;      break;  }  return result;}