diff --git a/mozilla/dom/public/idl/base/Makefile.in b/mozilla/dom/public/idl/base/Makefile.in index 3c99ea915cd..6260411a7d3 100644 --- a/mozilla/dom/public/idl/base/Makefile.in +++ b/mozilla/dom/public/idl/base/Makefile.in @@ -34,6 +34,7 @@ SDK_XPIDLSRCS = \ domstubs.idl \ nsIDOMBarProp.idl \ nsIDOMWindow.idl \ + nsIDOMWindow2.idl \ nsIDOMWindowCollection.idl \ $(NULL) diff --git a/mozilla/dom/public/idl/base/nsIDOMWindowInternal.idl b/mozilla/dom/public/idl/base/nsIDOMWindowInternal.idl index 942b0ecdf10..3b946776aa5 100644 --- a/mozilla/dom/public/idl/base/nsIDOMWindowInternal.idl +++ b/mozilla/dom/public/idl/base/nsIDOMWindowInternal.idl @@ -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; diff --git a/mozilla/dom/src/base/nsGlobalWindow.cpp b/mozilla/dom/src/base/nsGlobalWindow.cpp index e0b7338ef42..1578f4f9f0c 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.cpp +++ b/mozilla/dom/src/base/nsGlobalWindow.cpp @@ -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 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) { diff --git a/mozilla/dom/src/base/nsGlobalWindow.h b/mozilla/dom/src/base/nsGlobalWindow.h index 961fbf311b1..2c00fd5e1c6 100644 --- a/mozilla/dom/src/base/nsGlobalWindow.h +++ b/mozilla/dom/src/base/nsGlobalWindow.h @@ -154,6 +154,9 @@ public: // nsIDOMWindow NS_DECL_NSIDOMWINDOW + // nsIDOMWindow2 + NS_DECL_NSIDOMWINDOW2 + // nsIDOMWindowInternal NS_DECL_NSIDOMWINDOWINTERNAL