nsCOMPtr<nsIScriptGlobalObject> globalObj = mDocument->GetScriptGlobalObject(); if (globalObj) { globalObj->HandleDOMEvent(mPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
nsPIDOMWindow *window = mDocument->GetWindow(); if (window) { window->HandleDOMEvent(mPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
PresShell::FireResizeEvent(){  if (mIsDocumentGone)    return;  //Send resize event from here.  nsEvent event(PR_TRUE, NS_RESIZE_EVENT);  nsEventStatus status = nsEventStatus_eIgnore;  nsCOMPtr<nsIScriptGlobalObject> globalObj = mDocument->GetScriptGlobalObject();  if (globalObj) {    globalObj->HandleDOMEvent(mPresContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);  }}