Adding unload event

git-svn-id: svn://10.0.0.236/trunk@25479 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
joki%netscape.com
1999-03-29 23:01:13 +00:00
parent 1b00b2fa13
commit cf85cc663c
2 changed files with 42 additions and 2 deletions

View File

@@ -2071,7 +2071,27 @@ nsWebShell::ReleaseScriptContext(nsIScriptContext *aContext)
NS_IMETHODIMP
nsWebShell::OnStartDocumentLoad(nsIURL* aURL, const char* aCommand)
{
return NS_OK;
nsIDocumentViewer* docViewer;
nsresult rv = NS_ERROR_FAILURE;
if (nsnull != mScriptGlobal) {
if (nsnull != mContentViewer &&
NS_OK == mContentViewer->QueryInterface(kIDocumentViewerIID, (void**)&docViewer)) {
nsIPresContext *presContext;
if (NS_OK == docViewer->GetPresContext(presContext)) {
nsEventStatus status = nsEventStatus_eIgnore;
nsMouseEvent event;
event.eventStructType = NS_EVENT;
event.message = NS_PAGE_UNLOAD;
rv = mScriptGlobal->HandleDOMEvent(*presContext, &event, nsnull, NS_EVENT_FLAG_INIT, status);
NS_RELEASE(presContext);
}
NS_RELEASE(docViewer);
}
}
return rv;
}
NS_IMETHODIMP