Bug 1313634 - Fix undefined variables issues in cookies.js that lead to the cookies window not updating properly when open. r?jaws
MozReview-Commit-ID: RBhuCbjrYT
--- a/browser/components/preferences/cookies.js
+++ b/browser/components/preferences/cookies.js
@@ -122,20 +122,20 @@ var gCookiesWindow = {
// We don't yet handle aData == "deleted" - it's a less common case
// and is rather complicated as selection tracking is difficult
},
_handleCookieChanged: function (changedCookie, strippedHost) {
var rowIndex = 0;
var cookieItem = null;
if (!this._view._filtered) {
- for (let host of this._hostsOrder) { // (var host in this._hosts) {
+ for (let host of this._hostOrder) {
++rowIndex;
var hostItem = this._hosts[host];
- if (this._hostOrder[i] == strippedHost) { // host == strippedHost) {
+ if (host == strippedHost) {
// Host matches, look for the cookie within this Host collection
// and update its data
for (let currCookie of hostItem.cookies) {
++rowIndex;
if (this._cookieEquals(currCookie, changedCookie, strippedHost)) {
currCookie.value = changedCookie.value;
currCookie.isSecure = changedCookie.isSecure;
currCookie.isDomain = changedCookie.isDomain;
@@ -883,17 +883,17 @@ var gCookiesWindow = {
for (let i = 0; i < rangeCount; ++i) {
var min = {}; var max = {};
seln.getRangeAt(i, min, max);
this._lastSelectedRanges.push({ min: min.value, max: max.value });
}
// Save open states
this._openIndices = [];
- for (i = 0; i < this._view.rowCount; ++i) {
+ for (let i = 0; i < this._view.rowCount; ++i) {
var item = this._view._getItemAtIndex(i);
if (item && item.container && item.open)
this._openIndices.push(i);
}
},
_updateRemoveAllButton: function gCookiesWindow__updateRemoveAllButton() {
document.getElementById("removeAllCookies").disabled = this._view._rowCount == 0;