if (!mForm && !mDocument) {
if (!mForm && !(mDocument && mParent)) {
nsHTMLInputElement::AddedToRadioGroup(){  //  //  If the input element is not in a form and  //  not in a document, we just need to return.  //  if (!mForm && !mDocument) {    return NS_OK;  }  //  // If the input element is checked, and we add it to the group, it will  // deselect whatever is currently selected in that group  //  PRBool checked;  GetChecked(&checked);  if (checked) {    //    // If it is checked, call "RadioSetChecked" to perform the selection/    // deselection ritual.  This has the side effect of repainting the    // radio button, but as adding a checked radio button into the group    // should not be that common an occurrence, I think we can live with    // that.    //    RadioSetChecked();  }  //  // For integrity purposes, we have to ensure that "checkedChanged" is  // the same for this new element as for all the others in the group  //  PRBool checkedChanged = PR_FALSE;  nsCOMPtr<nsIRadioVisitor> visitor;  nsresult rv = NS_GetRadioGetCheckedChangedVisitor(&checkedChanged, this,                                           getter_AddRefs(visitor));  NS_ENSURE_SUCCESS(rv, rv);    VisitGroup(visitor);  SetCheckedChangedInternal(checkedChanged);    //  // Add the radio to the radio group container.  //  nsCOMPtr<nsIRadioGroupContainer> container = GetRadioGroupContainer();  if (container) {    nsAutoString name;    if (GetNameIfExists(name)) {      container->AddToRadioGroup(name, NS_STATIC_CAST(nsIFormControl*, this));    }  }  return NS_OK;}