nsStyleStruct* result = nsnull;
const nsStyleStruct *current = GetStyleData(aSID); if (!mChild && !mEmptyChild && !(mBits & nsCachedStyleData::GetBitForSID(aSID)) && mCachedStyleData.GetStyleData(aSID)) return NS_CONST_CAST(nsStyleStruct*, current);  nsStyleStruct* result; nsPresContext *presContext = PresContext();
nsStyleContext::GetUniqueStyleData(nsIPresContext* aPresContext, const nsStyleStructID& aSID){  nsStyleStruct* result = nsnull;  switch (aSID) {  case eStyleStruct_Display: {    const nsStyleDisplay* dis = (const nsStyleDisplay*)GetStyleData(aSID);    nsStyleDisplay* newDis = new (aPresContext) nsStyleDisplay(*dis);    SetStyle(aSID, newDis);    result = newDis;    mBits &= ~NS_STYLE_INHERIT_BIT(Display);    break;  }  case eStyleStruct_Background: {    const nsStyleBackground* bg = (const nsStyleBackground*)GetStyleData(aSID);    nsStyleBackground* newBG = new (aPresContext) nsStyleBackground(*bg);    SetStyle(aSID, newBG);    result = newBG;    mBits &= ~NS_STYLE_INHERIT_BIT(Background);    break;  }  case eStyleStruct_Text: {    const nsStyleText* text = (const nsStyleText*)GetStyleData(aSID);    nsStyleText* newText = new (aPresContext) nsStyleText(*text);    SetStyle(aSID, newText);    result = newText;    mBits &= ~NS_STYLE_INHERIT_BIT(Text);    break;  }  case eStyleStruct_TextReset: {    const nsStyleTextReset* reset = (const nsStyleTextReset*)GetStyleData(aSID);    nsStyleTextReset* newReset = new (aPresContext) nsStyleTextReset(*reset);    SetStyle(aSID, newReset);    result = newReset;    mBits &= ~NS_STYLE_INHERIT_BIT(TextReset);    break;  }  default:    NS_ERROR("Struct type not supported.  Please find another way to do this if you can!\n");  }  return result;}