Bug 1288147 - don't use ownerGlobal in devtools client code; r=bgrins
authorTom Tromey <ttromey@mozilla.com>
Tue, 26 Jul 2016 09:34:25 -0600
changeset 346876 be12f0a1b139460abb8de82beb464200b2c4b12f
parent 346875 0869818632bbf42863677a0d411edd4cc0cf05c8
child 346877 e2d60919fe8c5372d1990ffba607caf794726604
push id6389
push userraliiev@mozilla.com
push dateMon, 19 Sep 2016 13:38:22 +0000
treeherdermozilla-beta@01d67bfe6c81 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbgrins
bugs1288147
milestone50.0a1
first release with
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
last release without
nightly linux32
nightly linux64
nightly mac
nightly win32
nightly win64
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) {