nsIScriptGlobalObject *global = mDocument->GetScriptGlobalObject();
nsPIDOMWindow *window = mDocument->GetWindow();
DocumentViewerImpl::PageHide(PRBool aIsUnload){  mEnableRendering = PR_FALSE;  if (!mDocument) {    return NS_ERROR_NULL_POINTER;  }  mDocument->OnPageHide(!aIsUnload);  if (!aIsUnload)    return NS_OK;  // First, get the script global object from the document...  nsIScriptGlobalObject *global = mDocument->GetScriptGlobalObject();  if (!global) {    // Fail if no ScriptGlobalObject is available...    NS_ERROR("nsIScriptGlobalObject not set for document!");    return NS_ERROR_NULL_POINTER;  }  // Now, fire an Unload event to the document...  nsEventStatus status = nsEventStatus_eIgnore;  nsEvent event(PR_TRUE, NS_PAGE_UNLOAD);  // Never permit popups from the unload handler, no matter how we get  // here.  nsAutoPopupStatePusher popupStatePusher(openAbused, PR_TRUE);  return global->HandleDOMEvent(mPresContext, &event, nsnull,                                NS_EVENT_FLAG_INIT, &status);}