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