GlobalWindow now calls up nsIDocShellTreeOwner rather than nsIBrowserWindow. GlobalWindow has mostly been re-organized as well as cleaned up to provide this new functionality. DocShellTreeOwners got implementations filled in and many bugs fixed. nsIScriptGlobalObject now talks in terms of docShells instead of webShells. Fixed a number of cases where people were walking through content viewers etc to get to a presShell and changed them to simply ask for the presShell from the docShell. GlobalWindow now deals completely in terms of docShells. r=vidur
This commit is contained in:
@@ -84,6 +84,7 @@
|
||||
#include "nsIDocShellTreeNode.h"
|
||||
#include "nsIDocShellTreeOwner.h"
|
||||
#include "nsCURILoader.h"
|
||||
#include "nsIDOMWindow.h"
|
||||
|
||||
#include "nsIHTTPChannel.h" // add this to the ick include list...we need it to QI for post data interface
|
||||
#include "nsHTTPEnums.h"
|
||||
@@ -631,7 +632,7 @@ nsWebShell::~nsWebShell()
|
||||
NS_IF_RELEASE(mContainer);
|
||||
|
||||
if (nsnull != mScriptGlobal) {
|
||||
mScriptGlobal->SetWebShell(nsnull);
|
||||
mScriptGlobal->SetDocShell(nsnull);
|
||||
NS_RELEASE(mScriptGlobal);
|
||||
}
|
||||
if (nsnull != mScriptContext) {
|
||||
@@ -767,6 +768,13 @@ nsWebShell::GetInterface(const nsIID &aIID, void** aInstancePtr)
|
||||
NS_ADDREF((nsISupports*)*aInstancePtr);
|
||||
return NS_OK;
|
||||
}
|
||||
else if(aIID.Equals(NS_GET_IID(nsIDOMWindow)))
|
||||
{
|
||||
NS_ENSURE_SUCCESS(CreateScriptEnvironment(), NS_ERROR_FAILURE);
|
||||
NS_ENSURE_SUCCESS(mScriptGlobal->QueryInterface(NS_GET_IID(nsIDOMWindow),
|
||||
aInstancePtr), NS_ERROR_FAILURE);
|
||||
return NS_OK;
|
||||
}
|
||||
else if(mPluginManager) //XXX this seems a little wrong. MMP
|
||||
rv = mPluginManager->QueryInterface(aIID, aInstancePtr);
|
||||
|
||||
@@ -3040,7 +3048,7 @@ nsWebShell::CreateScriptEnvironment()
|
||||
if (NS_FAILED(res)) {
|
||||
return res;
|
||||
}
|
||||
mScriptGlobal->SetWebShell(this);
|
||||
mScriptGlobal->SetDocShell(this);
|
||||
mScriptGlobal->SetGlobalObjectOwner(
|
||||
NS_STATIC_CAST(nsIScriptGlobalObjectOwner*, this));
|
||||
}
|
||||
@@ -3964,10 +3972,14 @@ NS_IMETHODIMP nsWebShell::GetPositionAndSize(PRInt32* aX, PRInt32* aY,
|
||||
else
|
||||
result = mBounds;
|
||||
|
||||
*aX = result.x;
|
||||
*aY = result.y;
|
||||
*aCX = result.width;
|
||||
*aCY = result.height;
|
||||
if(aX)
|
||||
*aX = result.x;
|
||||
if(aY)
|
||||
*aY = result.y;
|
||||
if(aCX)
|
||||
*aCX = result.width;
|
||||
if(aCY)
|
||||
*aCY = result.height;
|
||||
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user