if (IsInDoc() && aNotify) { nsIDocument* document = GetOwnerDoc(); mozAutoDocUpdate(document, UPDATE_CONTENT_STATE, aNotify); document->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_CHECKED);
if (aNotify) { nsIDocument* document = GetCurrentDoc(); if (document) { mozAutoDocUpdate(document, UPDATE_CONTENT_STATE, aNotify); document->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_CHECKED); }
nsHTMLInputElement::SetCheckedInternal(PRBool aChecked, PRBool aNotify){  //  // Set the value  //  SET_BOOLBIT(mBitField, BF_CHECKED, aChecked);  //  // Notify the frame  //  nsIFrame* frame = GetPrimaryFrame(PR_FALSE);  if (frame) {    nsPresContext *presContext = GetPresContext();    if (mType == NS_FORM_INPUT_CHECKBOX) {      nsICheckboxControlFrame* checkboxFrame = nsnull;      CallQueryInterface(frame, &checkboxFrame);      if (checkboxFrame) {        checkboxFrame->OnChecked(presContext, aChecked);      }    } else if (mType == NS_FORM_INPUT_RADIO) {      nsIRadioControlFrame* radioFrame = nsnull;      CallQueryInterface(frame, &radioFrame);      if (radioFrame) {        radioFrame->OnChecked(presContext, aChecked);      }    }  }  // Notify the document that the CSS :checked pseudoclass for this element  // has changed state.  if (IsInDoc() && aNotify) {    nsIDocument* document = GetOwnerDoc();    mozAutoDocUpdate(document, UPDATE_CONTENT_STATE, aNotify);    document->ContentStatesChanged(this, nsnull, NS_EVENT_STATE_CHECKED);  }  return NS_OK;}