if ((nsnull != aOption) && NS_SUCCEEDED(aOption->QueryInterface(kIDOMHTMLOptionElementIID, (void**)&option))) { if (mElements.RemoveElement(option)) { nsresult result; NS_RELEASE2(option, result);
PRInt32 oldIndex = mOptions->IndexOf(aContent);   mOptions->RemoveOption(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)) {    nsIPresContext* presContext; nsGenericHTMLElement::GetPresContext(this, &presContext); result = selectFrame->RemoveOption(presContext, oldIndex); NS_IF_RELEASE(presContext);
nsOptionList::RemoveOption(nsIContent* aOption){  nsIDOMHTMLOptionElement* option;  if ((nsnull != aOption) &&      NS_SUCCEEDED(aOption->QueryInterface(kIDOMHTMLOptionElementIID, (void**)&option))) {    if (mElements.RemoveElement(option)) {      nsresult result;      NS_RELEASE2(option, result);    }    NS_RELEASE(option);  }}