NS_ENSURE_ARG_POINTER(anIndex); *anIndex = 0;   nsCOMPtr<nsIDOMNSHTMLOptionCollection> options;  nsresult rv = GetOptions(getter_AddRefs(options));  if (options) { PRUint32 numOptions;  rv = options->GetLength(&numOptions); if (NS_FAILED(rv)) { return rv; }  nsCOMPtr<nsIDOMNode> node;  for (PRUint32 i = 0; i < numOptions; i++) { rv = options->Item(i, getter_AddRefs(node)); if (NS_SUCCEEDED(rv) && node) { nsCOMPtr<nsIDOMHTMLOptionElement> option(do_QueryInterface(node)); if (option && option.get() == aOption) { *anIndex = i; return NS_OK; } } } }  return NS_ERROR_FAILURE;
return mOptions->GetOptionIndex(aOption, aStartIndex, aForward, aIndex);
nsHTMLSelectElement::GetOptionIndex(nsIDOMHTMLOptionElement* aOption,                                    PRUint32 * anIndex){  NS_ENSURE_ARG_POINTER(anIndex);  *anIndex = 0;  // first find index of option  nsCOMPtr<nsIDOMNSHTMLOptionCollection> options;  nsresult rv = GetOptions(getter_AddRefs(options));  if (options) {    PRUint32 numOptions;    rv = options->GetLength(&numOptions);    if (NS_FAILED(rv)) {      return rv;    }    nsCOMPtr<nsIDOMNode> node;    for (PRUint32 i = 0; i < numOptions; i++) {      rv = options->Item(i, getter_AddRefs(node));      if (NS_SUCCEEDED(rv) && node) {        nsCOMPtr<nsIDOMHTMLOptionElement> option(do_QueryInterface(node));        if (option && option.get() == aOption) {          *anIndex = i;          return NS_OK;        }      }    }  }  return NS_ERROR_FAILURE;}