if (!mOptions) return NS_OK;   mOptions->AddOption(aContent);   nsIFormControlFrame* fcFrame = nsnull; nsresult result = nsGenericHTMLElement::GetPrimaryFrame(this, fcFrame); if (NS_SUCCEEDED(result) && (nsnull != fcFrame)) { nsISelectControlFrame* selectFrame = nsnull; result = fcFrame->QueryInterface(nsISelectControlFrame::GetIID(),(void **) &selectFrame); if (NS_SUCCEEDED(result) && (nsnull != selectFrame)) { result = selectFrame->AddOption(mOptions->IndexOf(aContent)); } }  return result;
mDirty = PR_TRUE;
nsHTMLSelectElement::AddOption(nsIContent* aContent){  // When first populating the select, this will be null but that's ok  // as we will manually update the widget at frame construction time.  if (!mOptions) return NS_OK;  // Add the option to the option list.  mOptions->AddOption(aContent);  // Update the widget  nsIFormControlFrame* fcFrame = nsnull;  nsresult result = nsGenericHTMLElement::GetPrimaryFrame(this, fcFrame);  if (NS_SUCCEEDED(result) && (nsnull != fcFrame)) {    nsISelectControlFrame* selectFrame = nsnull;    result = fcFrame->QueryInterface(nsISelectControlFrame::GetIID(),(void **) &selectFrame);    if (NS_SUCCEEDED(result) && (nsnull != selectFrame)) {      result = selectFrame->AddOption(mOptions->IndexOf(aContent));    }  }    return result;}