nsIEventStateManager* esm; if (NS_OK == aPresContext->GetEventStateManager(&esm)) {
nsCOMPtr<nsIEventStateManager> esm; if (NS_OK == aPresContext->GetEventStateManager(getter_AddRefs(esm))) {
nsHTMLTextAreaElement::SetFocus(nsIPresContext* aPresContext){  // first see if we are disabled or not. If disabled then do nothing.  nsAutoString disabled;  if (NS_CONTENT_ATTR_HAS_VALUE == mInner.GetAttribute(kNameSpaceID_HTML, nsHTMLAtoms::disabled, disabled)) {    return NS_OK;  }  nsIEventStateManager* esm;  if (NS_OK == aPresContext->GetEventStateManager(&esm)) {    esm->SetContentState(this, NS_EVENT_STATE_FOCUS);    NS_RELEASE(esm);  }  nsIFormControlFrame* formControlFrame = nsnull;  nsresult rv = nsGenericHTMLElement::GetPrimaryFrame(this, formControlFrame);  if (NS_SUCCEEDED(rv)) {    formControlFrame->SetFocus(PR_TRUE, PR_TRUE);    formControlFrame->ScrollIntoView(aPresContext);    // Could call SelectAll(aPresContext) here to automatically    // select text when we receive focus.  }  return rv;}