bug 129602 Embedders need to be able to reach the window root.

patch by marco@gnome.org r=caillon sr=jst a=chofmann


git-svn-id: svn://10.0.0.236/branches/MOZILLA_1_7_BRANCH@157193 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
cbiesinger%web.de
2004-05-31 20:16:27 +00:00
parent 0a4567a51d
commit d8129a1288
4 changed files with 27 additions and 3 deletions

View File

@@ -34,6 +34,7 @@ SDK_XPIDLSRCS = \
domstubs.idl \
nsIDOMBarProp.idl \
nsIDOMWindow.idl \
nsIDOMWindow2.idl \
nsIDOMWindowCollection.idl \
$(NULL)

View File

@@ -38,14 +38,14 @@
*
* ***** END LICENSE BLOCK ***** */
#include "nsIDOMWindow.idl"
#include "nsIDOMWindow2.idl"
interface nsIPrompt;
interface nsIControllers;
interface nsIDOMLocation;
[scriptable, uuid(9c911860-7dd9-11d4-9a83-000064657374)]
interface nsIDOMWindowInternal : nsIDOMWindow
[scriptable, uuid(f914492c-0138-4123-a634-6ef8e3f126f8)]
interface nsIDOMWindowInternal : nsIDOMWindow2
{
readonly attribute nsIDOMWindowInternal window;

View File

@@ -369,6 +369,7 @@ NS_INTERFACE_MAP_BEGIN(GlobalWindowImpl)
NS_INTERFACE_MAP_ENTRY_AMBIGUOUS(nsISupports, nsIScriptGlobalObject)
NS_INTERFACE_MAP_ENTRY(nsIDOMWindowInternal)
NS_INTERFACE_MAP_ENTRY(nsIDOMWindow)
NS_INTERFACE_MAP_ENTRY(nsIDOMWindow2)
NS_INTERFACE_MAP_ENTRY(nsIDOMJSWindow)
NS_INTERFACE_MAP_ENTRY(nsIScriptGlobalObject)
NS_INTERFACE_MAP_ENTRY(nsIScriptObjectPrincipal)
@@ -2767,6 +2768,25 @@ GlobalWindowImpl::SizeToContent()
return NS_OK;
}
NS_IMETHODIMP
GlobalWindowImpl::GetWindowRoot(nsIDOMEventTarget **aWindowRoot)
{
*aWindowRoot = nsnull;
nsIDOMWindowInternal *rootWindow = GlobalWindowImpl::GetPrivateRoot();
nsCOMPtr<nsPIDOMWindow> piWin(do_QueryInterface(rootWindow));
if (!piWin) {
return NS_OK;
}
nsIChromeEventHandler *chromeHandler = piWin->GetChromeEventHandler();
if (!chromeHandler) {
return NS_OK;
}
return CallQueryInterface(chromeHandler, aWindowRoot);
}
NS_IMETHODIMP
GlobalWindowImpl::Scroll(PRInt32 aXScroll, PRInt32 aYScroll)
{

View File

@@ -154,6 +154,9 @@ public:
// nsIDOMWindow
NS_DECL_NSIDOMWINDOW
// nsIDOMWindow2
NS_DECL_NSIDOMWINDOW2
// nsIDOMWindowInternal
NS_DECL_NSIDOMWINDOWINTERNAL