nsresult rv = NS_ERROR_FAILURE;  nsCOMPtr<nsIPresContext> presContext; nsCOMPtr<nsIWebShell>    webShell = do_QueryReferent(mWebShellWeakRef); if (!webShell) { NS_ERROR("No web shell"); return nsEventStatus_eConsumeNoDefault; } MenuHelpers::WebShellToPresContext(webShell, getter_AddRefs(presContext));  nsEventStatus status = nsEventStatus_eIgnore; nsMouseEvent event; event.eventStructType = NS_MOUSE_EVENT; event.message = NS_MENU_ACTION;  nsCOMPtr<nsIContent> contentNode = do_QueryInterface(mDOMNode); if (!contentNode) { NS_ERROR("DOM Node doesn't support the nsIContent interface required to handle DOM events."); return rv; }  rv = contentNode->HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);  return nsEventStatus_eConsumeNoDefault;
NS_NOTYETIMPLEMENTED("write me!"); return NS_ERROR_NOT_IMPLEMENTED;
NS_METHOD nsMenuItem::DoCommand(){  nsresult rv = NS_ERROR_FAILURE;   nsCOMPtr<nsIPresContext> presContext;  nsCOMPtr<nsIWebShell>    webShell = do_QueryReferent(mWebShellWeakRef);  if (!webShell)  {    NS_ERROR("No web shell");    return nsEventStatus_eConsumeNoDefault;  }  MenuHelpers::WebShellToPresContext(webShell, getter_AddRefs(presContext));  nsEventStatus status = nsEventStatus_eIgnore;  nsMouseEvent event;  event.eventStructType = NS_MOUSE_EVENT;  event.message = NS_MENU_ACTION;  nsCOMPtr<nsIContent> contentNode = do_QueryInterface(mDOMNode);  if (!contentNode) {      NS_ERROR("DOM Node doesn't support the nsIContent interface required to handle DOM events.");      return rv;  }  rv = contentNode->HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);  return nsEventStatus_eConsumeNoDefault;}