PRInt32 type; aChild->GetType(&type); if (type == NS_FORM_INPUT_RADIO) { nsCOMPtr<nsIRadioControlElement> radio = do_QueryInterface(aChild); nsresult rv = radio->AddedToRadioGroup(); NS_ENSURE_SUCCESS(rv, rv); }
nsHTMLFormElement::AddElement(nsIFormControl* aChild){  NS_ENSURE_TRUE(mControls, NS_ERROR_UNEXPECTED);  if (ShouldBeInElements(aChild)) {    mControls->mElements.AppendElement(aChild);    // WEAK - don't addref  } else {    if (!mControls->mNotInElements) {      mControls->mNotInElements = new nsHashtable();      NS_ENSURE_TRUE(mControls->mNotInElements, NS_ERROR_OUT_OF_MEMORY);    }    nsISupportsKey key(aChild);    nsISupports *item =      NS_STATIC_CAST(nsISupports *, mControls->mNotInElements->Get(&key));    if (!item) {      mControls->mNotInElements->Put(&key, aChild);    }  }  return NS_OK;}