Fix for bug 9358. Page reloads were not working because the webshell was trying to scroll the document rather than loading it via netlib. Now, we are fine. Some work needs to happen in session history to pass in a newly define url reload type so that the webshell can be smart about scrolling the document for history traversal rather than loading via netlib. Will work with Radha to make the necessary session history changes.

git-svn-id: svn://10.0.0.236/trunk@38761 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
nisheeth%netscape.com
1999-07-08 01:40:50 +00:00
parent cce5e8be71
commit 784f48c63d
2 changed files with 18 additions and 22 deletions

View File

@@ -1827,7 +1827,7 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
#ifdef NECKO
if ((aType == nsIChannel::LOAD_NORMAL) && (nsnull != mContentViewer))
#else
if ((aType == nsURLReload) && (nsnull != mContentViewer))
if ((aType == nsURLReload || aType == nsURLReloadFromHistory) && (nsnull != mContentViewer))
#endif
{
nsCOMPtr<nsIDocumentViewer> docViewer;
@@ -1860,9 +1860,8 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
if (NS_FAILED(rv)) return rv;
#endif // NECKO
if (EqualBaseURLs(docURL, url))
{
// See if there's a destination anchor
if (EqualBaseURLs(docURL, url)) {
// See if there's a destination anchor
#ifdef NECKO
char* ref = nsnull;
nsCOMPtr<nsIURL> url2 = do_QueryInterface(url);
@@ -1879,23 +1878,22 @@ nsWebShell::DoLoadURL(const nsString& aUrlSpec,
if (NS_SUCCEEDED(rv) && presShell) {
if (nsnull != ref) {
// Go to the anchor in the current document
presShell->GoToAnchor(nsAutoString(ref));
rv = presShell->GoToAnchor(nsAutoString(ref));
return rv;
}
else {
else if (aType == nsURLReloadFromHistory) {
// Go to the top of the current document
nsCOMPtr<nsIViewManager> viewMgr;
rv = presShell->GetViewManager(getter_AddRefs(viewMgr));
if (NS_SUCCEEDED(rv) && viewMgr) {
nsIScrollableView* view;
rv = viewMgr->GetRootScrollableView(&view);
if (NS_SUCCEEDED(rv) && view) {
view->ScrollTo(0, 0, NS_VMREFRESH_IMMEDIATE);
}
if (NS_SUCCEEDED(rv) && view)
rv = view->ScrollTo(0, 0, NS_VMREFRESH_IMMEDIATE);
}
return rv;
}
}
return NS_OK;
} // EqualBaseURLs(docURL, url)
}
}