Fix for 34400 and 49406. 34400 is r=waterson, a=brendan. 49406 is r=danm, a=brendan

git-svn-id: svn://10.0.0.236/trunk@82118 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
hyatt%netscape.com
2000-11-01 01:20:59 +00:00
parent d9f2608732
commit c389e67de6
3 changed files with 91 additions and 15 deletions

View File

@@ -1235,14 +1235,24 @@ nsWebShellWindow::OnEndDocumentLoad(nsIDocumentLoader* loader,
printf("OnEndDocumentLoad\n");
#endif
/* We get notified every time a page/Frame is loaded. But we need to
* Load the menus, run the startup script etc.. only once. So, Use
* the mChrome Initialized member to check whether chrome should be
* initialized or not - Radha
*/
if (mChromeLoaded)
return NS_OK;
// We get notified every time a subframe is loaded. We
// need to properly ignore the load of subframes and only really
// execute our onload handler when we get a notification for ourselves
nsCOMPtr<nsISupports> container;
nsCOMPtr<nsIDocShellTreeItem> docShellAsItem, parent;
loader->GetContainer(getter_AddRefs(container));
// Is this a frame ?
docShellAsItem = do_QueryInterface(container);
if (docShellAsItem) {
docShellAsItem->GetSameTypeParent(getter_AddRefs(parent));
}
if (parent)
return NS_OK; // We're a subframe. Get out of dodge.
mChromeLoaded = PR_TRUE;
mLockedUntilChromeLoad = PR_FALSE;