rv = GetDocument(*getter_AddRefs(doc));
rv = GetDocument(getter_AddRefs(doc));
nsHTMLInputElement::Click(){  nsresult rv = NS_OK;  if (GET_BOOLBIT(mBitField, BF_HANDLING_CLICK)) // Fixes crash as in bug 41599      return rv;                      // --heikki@netscape.com  // first see if we are disabled or not. If disabled then do nothing.  nsAutoString disabled;  if (NS_CONTENT_ATTR_HAS_VALUE == GetAttr(kNameSpaceID_None,                                           nsHTMLAtoms::disabled, disabled)) {    return rv;  }  // see what type of input we are.  Only click button, checkbox, radio,  // reset, submit, & image  if (mType == NS_FORM_INPUT_BUTTON || mType == NS_FORM_INPUT_CHECKBOX ||      mType == NS_FORM_INPUT_RADIO || mType == NS_FORM_INPUT_RESET ||      mType == NS_FORM_INPUT_SUBMIT) {    nsCOMPtr<nsIDocument> doc; // Strong    rv = GetDocument(*getter_AddRefs(doc));    if (doc) {      PRInt32 numShells = doc->GetNumberOfShells();      nsCOMPtr<nsIPresContext> context;      for (PRInt32 i=0; i<numShells; i++) {        nsCOMPtr<nsIPresShell> shell;        doc->GetShellAt(i, getter_AddRefs(shell));        if (shell) {          shell->GetPresContext(getter_AddRefs(context));          if (context) {            nsEventStatus status = nsEventStatus_eIgnore;            nsMouseEvent event;            event.eventStructType = NS_MOUSE_EVENT;            event.message = NS_MOUSE_LEFT_CLICK;            event.isShift = PR_FALSE;            event.isControl = PR_FALSE;            event.isAlt = PR_FALSE;            event.isMeta = PR_FALSE;            event.clickCount = 0;            event.widget = nsnull;                        SET_BOOLBIT(mBitField, BF_HANDLING_CLICK, PR_TRUE);            rv = HandleDOMEvent(context, &event, nsnull, NS_EVENT_FLAG_INIT,                                &status);            SET_BOOLBIT(mBitField, BF_HANDLING_CLICK, PR_FALSE);          }        }      }    }  }    return NS_OK;}