if (nameVal.Length()) theForm->AddElementToTable(this, nameVal);  if (idVal.Length()) theForm->AddElementToTable(this, idVal);
nsHTMLInputElement::SetForm(nsIDOMHTMLFormElement* aForm){  nsCOMPtr<nsIFormControl> formControl;  nsresult result = QueryInterface(kIFormControlIID, getter_AddRefs(formControl));  if (NS_FAILED(result)) formControl = nsnull;  if (mForm && formControl)    mForm->RemoveElement(formControl);  if (aForm) {    nsCOMPtr<nsIForm> theForm = do_QueryInterface(aForm, &result);    mForm = theForm;  // Even if we fail, update mForm (nsnull in failure)    if ((NS_OK == result) && theForm) {      if (formControl) {        theForm->AddElement(formControl);      }    }  } else {    mForm = nsnull;  }  mInner.SetForm(mForm);  return result;}