nsCOMPtr<nsIStyleContext> styleContext; aFrame->GetStyleContext(getter_AddRefs(styleContext));  const nsStyleBackground* ourBG = (const nsStyleBackground*)styleContext->GetStyleData(eStyleStruct_Background);
const nsStyleBackground* ourBG; ::GetStyleData(aFrame, &ourBG);
static PRBool IsAlreadyStyled(nsIFrame* aFrame, PRUint8 aWidgetType) {  // Check for specific widgets to see if HTML has overridden the style.  if (aFrame && (aWidgetType == NS_THEME_BUTTON || aWidgetType == NS_THEME_TEXTFIELD)) {    nsCOMPtr<nsIContent> content;    aFrame->GetContent(getter_AddRefs(content));    if (content->IsContentOfType(nsIContent::eHTML)) {      nscolor bgColor;      nscolor disabledBG;      nsCOMPtr<nsILookAndFeel> lookAndFeel(do_CreateInstance(kLookAndFeelCID));            lookAndFeel->GetColor(nsILookAndFeel::eColor_threedface, disabledBG);      switch (aWidgetType) {      case NS_THEME_BUTTON:        lookAndFeel->GetColor(nsILookAndFeel::eColor_buttonface, bgColor);        break;      case NS_THEME_TEXTFIELD:        lookAndFeel->GetColor(nsILookAndFeel::eColor__moz_field, bgColor);        break;      default:        return PR_FALSE;      }      nsCOMPtr<nsIStyleContext> styleContext;      aFrame->GetStyleContext(getter_AddRefs(styleContext));            const nsStyleBackground* ourBG = (const nsStyleBackground*)styleContext->GetStyleData(eStyleStruct_Background);      if (ourBG->mBackgroundColor != bgColor && ourBG->mBackgroundColor != disabledBG)        return PR_TRUE;      const nsStyleBorder* ourBorder = (const nsStyleBorder*)styleContext->GetStyleData(eStyleStruct_Border);      //see if any sides are dotted, dashed or solid      for (PRInt32 cnt = 0; cnt < 4; cnt++) {        if ((ourBorder->GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_DOTTED) ||             (ourBorder->GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_DASHED) ||            (ourBorder->GetBorderStyle(cnt) == NS_STYLE_BORDER_STYLE_SOLID))          return PR_TRUE;      }    }  }  return PR_FALSE;}