From 986d17953577077b1e717236134ed7740ab28a0d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?D=C3=A3o=20Gottwald?= Date: Thu, 2 Feb 2012 09:28:04 +0100 Subject: [PATCH] Bug 574971 - Remove WindowDraggingElement's redundant 'window' argument. r=enn --- browser/base/content/browser.js | 2 +- toolkit/content/WindowDraggingUtils.jsm | 4 ++-- toolkit/content/widgets/general.xml | 4 ++-- toolkit/content/widgets/popup.xml | 2 +- toolkit/content/widgets/toolbar.xml | 2 +- 5 files changed, 7 insertions(+), 7 deletions(-) diff --git a/browser/base/content/browser.js b/browser/base/content/browser.js index 657194f0118..99fddd32702 100644 --- a/browser/base/content/browser.js +++ b/browser/base/content/browser.js @@ -5455,7 +5455,7 @@ var TabsInTitlebar = { if (!this._draghandle) { let tmp = {}; Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp); - this._draghandle = new tmp.WindowDraggingElement(tabsToolbar, window); + this._draghandle = new tmp.WindowDraggingElement(tabsToolbar); this._draghandle.mouseDownCheck = function () { return !this._dragBindingAlive && TabsInTitlebar.enabled; }; diff --git a/toolkit/content/WindowDraggingUtils.jsm b/toolkit/content/WindowDraggingUtils.jsm index 2f3d54701d8..51924ce2680 100644 --- a/toolkit/content/WindowDraggingUtils.jsm +++ b/toolkit/content/WindowDraggingUtils.jsm @@ -36,9 +36,9 @@ let EXPORTED_SYMBOLS = [ "WindowDraggingElement" ]; -function WindowDraggingElement(elem, window) { +function WindowDraggingElement(elem) { this._elem = elem; - this._window = window; + this._window = elem.ownerDocument.defaultView; #ifdef XP_WIN if (!this.isPanel()) this._elem.addEventListener("MozMouseHittest", this, false); diff --git a/toolkit/content/widgets/general.xml b/toolkit/content/widgets/general.xml index d6122b3e579..7aaec1ff6ce 100644 --- a/toolkit/content/widgets/general.xml +++ b/toolkit/content/widgets/general.xml @@ -167,7 +167,7 @@ try { let tmp = {}; Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp); - let draghandle = new tmp.WindowDraggingElement(this, window); + let draghandle = new tmp.WindowDraggingElement(this); draghandle.mouseDownCheck = function () this._dragBindingAlive; } catch (e) {} } @@ -274,7 +274,7 @@ try { let tmp = {}; Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp); - let draghandle = new tmp.WindowDraggingElement(this, window); + let draghandle = new tmp.WindowDraggingElement(this); draghandle.mouseDownCheck = function () this._dragBindingAlive; } catch (e) {} } diff --git a/toolkit/content/widgets/popup.xml b/toolkit/content/widgets/popup.xml index 00bf6e4ebb5..68581a12d50 100644 --- a/toolkit/content/widgets/popup.xml +++ b/toolkit/content/widgets/popup.xml @@ -237,7 +237,7 @@ try { let tmp = {}; Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp); - let draghandle = new tmp.WindowDraggingElement(this, window); + let draghandle = new tmp.WindowDraggingElement(this); draghandle.mouseDownCheck = function () this._dragBindingAlive; } catch (e) {} } diff --git a/toolkit/content/widgets/toolbar.xml b/toolkit/content/widgets/toolbar.xml index ae4a27155f4..ad15ac8600e 100644 --- a/toolkit/content/widgets/toolbar.xml +++ b/toolkit/content/widgets/toolbar.xml @@ -486,7 +486,7 @@ try { let tmp = {}; Components.utils.import("resource://gre/modules/WindowDraggingUtils.jsm", tmp); - let draggableThis = new tmp.WindowDraggingElement(this, window); + let draggableThis = new tmp.WindowDraggingElement(this); draggableThis.mouseDownCheck = function(e) { // Don't move while customizing. return this._dragBindingAlive &&