if (NS_SUCCEEDED(result) && fcFrame) {
if (fcFrame) {
nsHTMLOptionElement::SetText(const nsAReadableString& aText){  PRInt32 numNodes, i;  PRBool usedExistingTextNode = PR_FALSE;  // Do we need to create a text node?  nsresult result = ChildCount(numNodes);  if (NS_FAILED(result)) {    return result;  }  for (i = 0; i < numNodes; i++) {    nsCOMPtr<nsIContent> node;    ChildAt(i, *getter_AddRefs(node));    if (node) {      nsCOMPtr<nsIDOMText> domText(do_QueryInterface(node));      if (domText) {        result = domText->SetData(aText);        if (NS_SUCCEEDED(result)) {          usedExistingTextNode = PR_TRUE;        }        break;      }    }  }  if (!usedExistingTextNode) {    nsCOMPtr<nsIContent> text;    result = NS_NewTextNode(getter_AddRefs(text));    if (NS_OK == result) {      nsCOMPtr<nsIDOMText> domtext(do_QueryInterface(text));      if (domtext) {        result = domtext->SetData(aText);	    if (NS_SUCCEEDED(result)) {          result = AppendChildTo(text, PR_TRUE, PR_FALSE);          if (NS_SUCCEEDED(result)) {            nsCOMPtr<nsIDocument> doc;            result = GetDocument(*getter_AddRefs(doc));            if (NS_SUCCEEDED(result)) {              text->SetDocument(doc, PR_FALSE, PR_TRUE);            }          }        }      }    }  }  if (NS_SUCCEEDED(result)) {    nsIFormControlFrame* fcFrame = nsnull;    result = GetPrimaryFrame(fcFrame);    if (NS_SUCCEEDED(result) && fcFrame) {      nsIComboboxControlFrame* selectFrame = nsnull;      result = fcFrame->QueryInterface(NS_GET_IID(nsIComboboxControlFrame),                                       (void **)&selectFrame);      if (NS_SUCCEEDED(result) && selectFrame) {        selectFrame->UpdateSelection(PR_FALSE, PR_TRUE, 0);      }    }  }  return NS_OK;}