Moved the firing of the OnLoad event from WebShell into DocumentViewer...

git-svn-id: svn://10.0.0.236/trunk@78256 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
rpotts%netscape.com
2000-09-06 09:11:38 +00:00
parent 1d653f0089
commit 7a644ef163
4 changed files with 113 additions and 22 deletions

View File

@@ -957,30 +957,19 @@ nsWebShell::OnEndDocumentLoad(nsIDocumentLoader* loader,
else
mCharsetReloadState = eCharsetReloadInit;
// Clear the LSHE reference in docshell to indicate document loading
// is done one way or another.
LSHE = nsnull;
/* one of many safeguards that prevent death and destruction if
someone is so very very rude as to bring this window down
during this load handler. */
nsCOMPtr<nsIWebShell> kungFuDeathGrip(this);
// Clear the LSHE reference in docshell to indicate document loading
// is done one way or another.
LSHE = nsnull;
if(mScriptGlobal && !mEODForCurrentDocument && NS_SUCCEEDED(aStatus))
{
if(mContentViewer)
{
nsCOMPtr<nsIPresContext> presContext;
GetPresContext(getter_AddRefs(presContext));
if(presContext)
{
nsEventStatus status = nsEventStatus_eIgnore;
nsMouseEvent event;
event.eventStructType = NS_EVENT;
event.message = NS_PAGE_LOAD;
rv = mScriptGlobal->HandleDOMEvent(presContext, &event, nsnull, NS_EVENT_FLAG_INIT, &status);
}
}
}
// Notify the ContentViewer that the Document has finished loading...
if (!mEODForCurrentDocument && mContentViewer) {
mContentViewer->LoadComplete(aStatus);
}
mEODForCurrentDocument = PR_TRUE;
nsCOMPtr<nsIDocumentLoaderObserver> dlObserver;