Bug 1288147 - don't use ownerGlobal in devtools client code; r?bgrins draft
authorTom Tromey <ttromey@mozilla.com>
Tue, 26 Jul 2016 09:34:25 -0600
changeset 392974 1d57f4fcf6729f135f2e564fd41a8c39b08dae83
parent 392973 ec7f642b4d0ef5c064f01c679286c5310915ca46
child 526443 925a3a324de9a9b5c7301fe2230671098b3bd274
push id24159
push userttromey@mozilla.com
push dateTue, 26 Jul 2016 16:29:12 +0000
reviewersbgrins
bugs1288147
milestone50.0a1
Bug 1288147 - don't use ownerGlobal in devtools client code; r?bgrins MozReview-Commit-ID: EgXSMILZrri
devtools/client/framework/toolbox.js
devtools/client/shared/widgets/FilterWidget.js
devtools/client/shared/widgets/TableWidget.js
devtools/client/styleeditor/StyleEditorUI.jsm
--- 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) {