SetPresStateChecked(htmlContent, PR_FALSE); }
SetPresStateChecked(htmlContent, PR_FALSE);
nsHTMLInputElement::SetChecked(PRBool aValue){  // First check to see if the new value is the same as our current value.  // If so, then return.  PRBool checked = PR_TRUE;  GetChecked(&checked);  if (checked == aValue) {    return NS_OK;  }  // Since the value is changing, send out an onchange event (bug 23571)  nsCOMPtr<nsIPresContext> presContext;  GetPresContext(this, getter_AddRefs(presContext));  // No need to flush here since if there's no frame for this input at  // this point we don't care about creating one, once it's created  // the frame will do the right thing.  nsIFormControlFrame* formControlFrame = GetFormControlFrame(PR_FALSE);  if (formControlFrame) {    // the value is being toggled    nsAutoString val; val.AssignWithConversion(aValue ? "1" : "0");    formControlFrame->SetProperty(presContext, nsHTMLAtoms::checked, val);  }  else {    SetPresStateChecked(this, aValue);    PRInt32 type;    GetType(&type);    if (type == NS_FORM_INPUT_RADIO) {      nsAutoString name;      GetName(name);      nsCOMPtr<nsIDOMHTMLFormElement> formElement;      if (NS_SUCCEEDED(GetForm(getter_AddRefs(formElement))) && formElement) {        nsCOMPtr<nsIDOMHTMLCollection> controls;         nsresult rv = formElement->GetElements(getter_AddRefs(controls));         if (controls) {          PRUint32 numControls;          controls->GetLength(&numControls);          for (PRUint32 i = 0; i < numControls; i++) {            nsCOMPtr<nsIDOMNode> elementNode;            controls->Item(i, getter_AddRefs(elementNode));            if (elementNode) {              nsCOMPtr<nsIDOMHTMLInputElement>                inputElement(do_QueryInterface(elementNode));              if (inputElement && inputElement.get() !=                  NS_STATIC_CAST(nsIDOMHTMLInputElement *, this)) {                nsAutoString childName;                rv = inputElement->GetName(childName);                if (NS_SUCCEEDED(rv)) {                  if (name == childName) {                    nsCOMPtr<nsIHTMLContent>                      htmlContent(do_QueryInterface(inputElement));                    SetPresStateChecked(htmlContent, PR_FALSE);                  }                }              }            }          }        }      }    }  }  nsEventStatus status = nsEventStatus_eIgnore;  nsEvent event;  event.eventStructType = NS_EVENT;  event.message = NS_FORM_CHANGE;  HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);  return NS_OK;     }