backing out bug 339649 due to breakage on multiple tinderboxen as requested in #developers

This commit is contained in:
kairo%kairo.at 2007-07-06 13:13:46 +00:00
Родитель 701c8b9e86
Коммит 5db0add472
4 изменённых файлов: 13 добавлений и 18 удалений

Просмотреть файл

@ -419,14 +419,20 @@ nsXBLPrototypeHandler::ExecuteHandler(nsPIDOMEventTarget* aTarget,
// Compile the handler and bind it to the element. // Compile the handler and bind it to the element.
nsCOMPtr<nsIScriptGlobalObject> boundGlobal; nsCOMPtr<nsIScriptGlobalObject> boundGlobal;
nsCOMPtr<nsPIWindowRoot> winRoot(do_QueryInterface(aTarget)); nsCOMPtr<nsPIWindowRoot> winRoot(do_QueryInterface(aTarget));
nsCOMPtr<nsIDOMWindow> window; nsCOMPtr<nsIDOMWindowInternal> focusedWin;
if (winRoot) { if (winRoot) {
window = winRoot->GetWindow(); nsCOMPtr<nsIFocusController> focusController;
winRoot->GetFocusController(getter_AddRefs(focusController));
focusController->GetFocusedWindow(getter_AddRefs(focusedWin));
} }
if (window) { // if the focused window was found get our script global object from
nsCOMPtr<nsPIDOMWindow> piWin(do_QueryInterface(window)); // that.
if (focusedWin) {
NS_ASSERTION(isXULKey, "We should only use the focused window for "
"XUL key handlers!");
nsCOMPtr<nsPIDOMWindow> piWin(do_QueryInterface(focusedWin));
if (piWin) { if (piWin) {
piWin = piWin->GetCurrentInnerWindow(); piWin = piWin->GetCurrentInnerWindow();

Просмотреть файл

@ -43,21 +43,18 @@
#include "nsISupports.h" #include "nsISupports.h"
#include "nsPIDOMEventTarget.h" #include "nsPIDOMEventTarget.h"
class nsIDOMWindow;
class nsIFocusController; class nsIFocusController;
// 440f8d32-818d-468a-ac75-5916fa1ea198 // c18dee5a-dcf9-4391-a20c-581e769d095e
#define NS_IWINDOWROOT_IID \ #define NS_IWINDOWROOT_IID \
{ 0x440f8d32, 0x818d, 0x468a, \ { 0xc18dee5a, 0xdcf9, 0x4391, \
{ 0xac, 0x75, 0x59, 0x16, 0xfa, 0x1e, 0xa1, 0x98 } } { 0xa2, 0x0c, 0x58, 0x1e, 0x76, 0x9d, 0x09, 0x5e } }
class nsPIWindowRoot : public nsPIDOMEventTarget { class nsPIWindowRoot : public nsPIDOMEventTarget {
public: public:
NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWINDOWROOT_IID) NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWINDOWROOT_IID)
NS_IMETHOD GetFocusController(nsIFocusController** aResult)=0; NS_IMETHOD GetFocusController(nsIFocusController** aResult)=0;
virtual nsIDOMWindow* GetWindow();
}; };
NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID) NS_DEFINE_STATIC_IID_ACCESSOR(nsPIWindowRoot, NS_IWINDOWROOT_IID)

Просмотреть файл

@ -264,12 +264,6 @@ nsWindowRoot::GetFocusController(nsIFocusController** aResult)
return NS_OK; return NS_OK;
} }
nsIDOMWindow*
nsWindowRoot::GetWindow()
{
return mWindow;
}
NS_IMETHODIMP NS_IMETHODIMP
nsWindowRoot::GetScriptTypeID(PRUint32 *aScriptType) nsWindowRoot::GetScriptTypeID(PRUint32 *aScriptType)
{ {

Просмотреть файл

@ -87,8 +87,6 @@ public:
// nsPIWindowRoot // nsPIWindowRoot
NS_IMETHOD GetFocusController(nsIFocusController** aResult); NS_IMETHOD GetFocusController(nsIFocusController** aResult);
virtual nsIDOMWindow* GetWindow();
NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget) NS_DECL_CYCLE_COLLECTION_CLASS_AMBIGUOUS(nsWindowRoot, nsIDOMEventTarget)
protected: protected: