Bug 1288147 - don't use ownerGlobal in devtools client code; r?bgrins
MozReview-Commit-ID: EgXSMILZrri
--- a/devtools/client/framework/toolbox.js
+++ b/devtools/client/framework/toolbox.js
@@ -2087,17 +2087,17 @@ Toolbox.prototype = {
// Destroy the profiler connection
outstanding.push(this.destroyPerformance());
// Detach the thread
detachThread(this._threadClient);
this._threadClient = null;
// We need to grab a reference to win before this._host is destroyed.
- let win = this.frame.ownerGlobal;
+ let win = this.frame.ownerDocument.defaultView;
if (this._requisition) {
CommandUtils.destroyRequisition(this._requisition, this.target);
}
this._telemetry.toolClosed("toolbox");
this._telemetry.destroy();
// Finish all outstanding tasks (which means finish destroying panels and
--- a/devtools/client/shared/widgets/FilterWidget.js
+++ b/devtools/client/shared/widgets/FilterWidget.js
@@ -114,17 +114,17 @@ const SPECIAL_VALUES = new Set(["none",
*
* @param {nsIDOMNode} el
* The widget container.
* @param {String} value
* CSS filter value
*/
function CSSFilterEditorWidget(el, value = "") {
this.doc = el.ownerDocument;
- this.win = this.doc.ownerGlobal;
+ this.win = this.doc.defaultView;
this.el = el;
this._addButtonClick = this._addButtonClick.bind(this);
this._removeButtonClick = this._removeButtonClick.bind(this);
this._mouseMove = this._mouseMove.bind(this);
this._mouseUp = this._mouseUp.bind(this);
this._mouseDown = this._mouseDown.bind(this);
this._keyDown = this._keyDown.bind(this);
--- a/devtools/client/shared/widgets/TableWidget.js
+++ b/devtools/client/shared/widgets/TableWidget.js
@@ -1773,17 +1773,17 @@ EditableFieldsEngine.prototype = {
* Copies various styles from one node to another.
*
* @param {Node} source
* The node to copy styles from.
* @param {Node} destination [description]
* The node to copy styles to.
*/
copyStyles: function (source, destination) {
- let style = source.ownerGlobal.getComputedStyle(source);
+ let style = source.ownerDocument.defaultView.getComputedStyle(source);
let props = [
"borderTopWidth",
"borderRightWidth",
"borderBottomWidth",
"borderLeftWidth",
"fontFamily",
"fontSize",
"fontWeight",
--- a/devtools/client/styleeditor/StyleEditorUI.jsm
+++ b/devtools/client/styleeditor/StyleEditorUI.jsm
@@ -952,17 +952,17 @@ StyleEditorUI.prototype = {
/**
* Launches the responsive mode with a specific width or height
*
* @param {object} options
* Object with width or/and height properties.
*/
_launchResponsiveMode: Task.async(function* (options = {}) {
let tab = this._target.tab;
- let win = this._target.tab.ownerGlobal;
+ let win = this._target.tab.ownerDocument.defaultView;
yield ResponsiveUIManager.runIfNeeded(win, tab);
if (options.width && options.height) {
ResponsiveUIManager.getResponsiveUIForTab(tab).setSize(options.width,
options.height);
} else if (options.width) {
ResponsiveUIManager.getResponsiveUIForTab(tab).setWidth(options.width);
} else if (options.height) {