nsCOMPtr<nsIOptionElement> optionElement = do_QueryInterface(option);
nsCOMPtr<nsIDOMHTMLOptionElement> optionElement = do_QueryInterface(option);
nsHTMLSelectElement::SubmitNamesValues(nsIFormSubmission* aFormSubmission,                                       nsIContent* aSubmitElement){  nsresult rv = NS_OK;  //  // Disabled elements don't submit  //  PRBool disabled;  rv = GetDisabled(&disabled);  if (NS_FAILED(rv) || disabled) {    return rv;  }  //  // Get the name (if no name, no submit)  //  nsAutoString name;  rv = GetAttr(kNameSpaceID_None, nsHTMLAtoms::name, name);  if (NS_FAILED(rv) || rv == NS_CONTENT_ATTR_NOT_THERE) {    return rv;  }  //  // Submit  //  PRUint32 len;  GetLength(&len);  for (PRUint32 optIndex = 0; optIndex < len; optIndex++) {    // Don't send disabled options    PRBool disabled;    rv = IsOptionDisabled(optIndex, &disabled);    if (NS_FAILED(rv) || disabled) {      continue;    }    nsCOMPtr<nsIDOMHTMLOptionElement> option;    mOptions->ItemAsOption(optIndex, getter_AddRefs(option));    NS_ENSURE_TRUE(option, NS_ERROR_UNEXPECTED);    PRBool isSelected;    rv = option->GetSelected(&isSelected);    NS_ENSURE_SUCCESS(rv, rv);    if (!isSelected) {      continue;    }    nsCOMPtr<nsIOptionElement> optionElement = do_QueryInterface(option);    NS_ENSURE_TRUE(optionElement, NS_ERROR_UNEXPECTED);    nsAutoString value;    rv = optionElement->GetValueOrText(value);    NS_ENSURE_SUCCESS(rv, rv);    rv = aFormSubmission->AddNameValuePair(this, name, value);  }  return NS_OK;}