Bug 1119747 - Fix up selected cookie count. r=dao
authorSebastian Hengst <archaeopteryx@coole-files.de>
Fri, 09 Jan 2015 20:28:03 +0100
changeset 223254 9beacf61fe3dce6945f8f4630aa32ea3ee4e0fc2
parent 223253 d606591cf149d7452176fa49b3621b3ecfaa1c42
child 223255 814e685b77e19a8782667d5168df20052af14752
push id28086
push userryanvm@gmail.com
push dateMon, 12 Jan 2015 20:15:15 +0000
treeherdermozilla-central@182904efdc21 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersdao
bugs1119747
milestone37.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 1119747 - Fix up selected cookie count. r=dao
browser/components/preferences/cookies.js
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -521,42 +521,39 @@ var gCookiesWindow = {
       for (i = 0; i < ids.length; ++i)
         document.getElementById(ids[i]).disabled = true;
     }
     for (var property in properties)
       document.getElementById(property).value = properties[property];
   },
 
   onCookieSelected: function () {
-    var properties, item;
+    var item;
     var seln = this._tree.view.selection;
     if (!this._view._filtered)
       item = this._view._getItemAtIndex(seln.currentIndex);
     else
       item = this._view._filterSet[seln.currentIndex];
 
     this._updateCookieData(item);
 
     var rangeCount = seln.getRangeCount();
     var selectedCookieCount = 0;
     for (var i = 0; i < rangeCount; ++i) {
       var min = {}; var max = {};
       seln.getRangeAt(i, min, max);
       for (var j = min.value; j <= max.value; ++j) {
         item = this._view._getItemAtIndex(j);
         if (!item) continue;
-        if (item.container && !item.open)
+        if (item.container)
           selectedCookieCount += item.cookies.length;
         else if (!item.container)
           ++selectedCookieCount;
       }
     }
-    var item = this._view._getItemAtIndex(seln.currentIndex);
-    if (item && seln.count == 1 && item.container && item.open)
-      selectedCookieCount += 2;
 
     let buttonLabel = this._bundle.getString("removeSelectedCookies");
     let removeSelectedCookies = document.getElementById("removeSelectedCookies");
     removeSelectedCookies.label = PluralForm.get(selectedCookieCount, buttonLabel)
                                             .replace("#1", selectedCookieCount);
 
     removeSelectedCookies.disabled = !(seln.count > 0);
   },