More changes to fix 49498. r=ben

git-svn-id: svn://10.0.0.236/trunk@210519 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
radha%netscape.com
2006-09-14 05:53:35 +00:00
parent d3d273f599
commit 990c251221

View File

@@ -34,10 +34,24 @@ function FillHistoryMenu( aParent, aMenu )
var browserElement = document.getElementById("content");
if (browserElement)
{
var docShell = browserElement.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).docShell;
if (docShell)
{
var webNavigation = docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
var foopy = { };
var ds;
var docShell;
// Try to get docshell from appCore so that go/forward/back
// menus work right after a theme switch. If fetching from
// appCore fails use, the original method,
if (appCore) {
appCore.getContentDocShell(foopy);
ds = foopy.value;
}
if (ds) {
dump("Got docshell from appCOre\n");
docShell = ds;
}
else
docShell = browserElement.boxObject.QueryInterface(Components.interfaces.nsIBrowserBoxObject).docShell;
if (docShell) {
var webNavigation = docShell.QueryInterface(Components.interfaces.nsIWebNavigation);
if (webNavigation)
{
var shistory = webNavigation.sessionHistory;