nsCOMPtr<nsIPresShell> shell; GetPrimaryPresShell(aFrame, getter_AddRefs(shell));
nsIPresShell *shell = GetPrimaryPresShell(aFrame);
static PRInt32 GetContentState(nsIFrame* aFrame){  if (!aFrame)    return 0;  nsCOMPtr<nsIPresShell> shell;  GetPrimaryPresShell(aFrame, getter_AddRefs(shell));  if (!shell)    return 0;  nsCOMPtr<nsIPresContext> context;  shell->GetPresContext(getter_AddRefs(context));  nsCOMPtr<nsIEventStateManager> esm;  shell->GetPresContext()->GetEventStateManager(getter_AddRefs(esm));  PRInt32 flags = 0;  esm->GetContentState(aFrame->GetContent(), flags);  return flags;}