Backed out changeset 54e0e3c554eb (bug 1334874) for causing bug 1340517 and probably test failures (bug 1340857). rs=backout a=jorgk DONTBUILD
authorJorg K
Sun, 19 Feb 2017 18:14:12 +0100
changeset 27770 bdee8706c9841b307606e61d08fabe1dd9623bca
parent 27769 9a6f4dd62f09f2fdda71bf99435836990bb7a148
child 27771 fc0070ab1372eacf3489fddce8923a856d60701d
push id1850
push userclokep@gmail.com
push dateWed, 08 Mar 2017 19:29:12 +0000
treeherdercomm-esr52@028df196b2d9 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersbackout, jorgk
bugs1334874, 1340517, 1340857
backs out54e0e3c554eba04b35efcd616fc6b997b3c7a7b1
Backed out changeset 54e0e3c554eb (bug 1334874) for causing bug 1340517 and probably test failures (bug 1340857). rs=backout a=jorgk DONTBUILD
mailnews/base/util/jsTreeSelection.js
--- a/mailnews/base/util/jsTreeSelection.js
+++ b/mailnews/base/util/jsTreeSelection.js
@@ -80,30 +80,27 @@ JSTreeSelection.prototype = {
   _ranges: [],
   /**
    * The number of currently selected rows.
    */
   _count: 0,
 
   // In the case of the stand-alone message window, there's no tree, but
   // there's a view.
-  _viewWeak: null,
+  _view: null,
 
   get tree() {
     return this._treeBoxObject;
   },
   set tree(aTreeBoxObject) {
     this._treeBoxObject = aTreeBoxObject;
   },
 
   set view(aView) {
-    this._viewWeak = Cu.getWeakReference(aView);
-  },
-  get view() {
-    return (this._viewWeak) ? this._viewWeak.get() : null;
+    this._view = aView;
   },
   /**
    * Although the nsITreeSelection documentation doesn't say, what this method
    *  is supposed to do is check if the seltype attribute on the XUL tree is any
    *  of the following: "single" (only a single row may be selected at a time,
    *  "cell" (a single cell may be selected), or "text" (the row gets selected
    *  but only the primary column shows up as selected.)
    *
@@ -381,20 +378,20 @@ JSTreeSelection.prototype = {
   invertSelection: function JSTreeSelection_invertSelection() {
     throw new Error("Who really was going to use this?");
   },
 
   /**
    * Select all with no rows is a no-op, otherwise we select all and notify.
    */
   selectAll: function JSTreeSelection_selectAll() {
-    if (!this.view)
+    if (!this._view)
       return;
 
-    let view = this.view;
+    let view = this._view;
     let rowCount = view.rowCount;
 
     // no-ops-ville
     if (!rowCount)
       return;
 
     this._count = rowCount;
     this._ranges = [[0, rowCount - 1]];
@@ -588,17 +585,17 @@ JSTreeSelection.prototype = {
   _fireSelectionChanged: function JSTreeSelection__fireSelectionChanged() {
     // don't fire if we are suppressed; we will fire when un-suppressed
     if (this.selectEventsSuppressed)
       return;
     let view;
     if (this._treeBoxObject && this._treeBoxObject.view)
       view = this._treeBoxObject.view;
     else
-      view = this.view;
+      view = this._view;
 
     // We might not have a view if we're in the middle of setting up things
     if (view) {
       view = view.QueryInterface(Ci.nsITreeView);
       view.selectionChanged();
     }
   },