nsIEventStateManager* esm; if (NS_OK == aPresContext->GetEventStateManager(&esm)) { esm->SetContentState(this, NS_EVENT_STATE_FOCUS); NS_RELEASE(esm);
nsILinkHandler* handler; nsresult rv = aPresContext->GetLinkHandler(&handler); if (NS_SUCCEEDED(rv) && (nsnull != handler)) { nsIEventStateManager *stateManager; if (NS_OK == aPresContext->GetEventStateManager(&stateManager)) { stateManager->SetContentState(this, NS_EVENT_STATE_FOCUS); NS_RELEASE(stateManager); } NS_RELEASE(handler);
nsHTMLAnchorElement::SetFocus(nsIPresContext* aPresContext){  nsIEventStateManager* esm;  if (NS_OK == aPresContext->GetEventStateManager(&esm)) {    esm->SetContentState(this, NS_EVENT_STATE_FOCUS);    NS_RELEASE(esm);  }  // XXX write me  return NS_OK;}