Bug 1372954 - Do not persist sidebar checked state to document;r=Gijs
The the state will be properly set in the show() call anyway, and the xulstore
doesn't track attribute removals which led to improper checked state
MozReview-Commit-ID: rGb6Td55eW
--- a/browser/base/content/browser-sidebar.js
+++ b/browser/base/content/browser-sidebar.js
@@ -63,17 +63,16 @@ var SidebarUI = {
});
},
uninit() {
let enumerator = Services.wm.getEnumerator(null);
enumerator.getNext();
if (!enumerator.hasMoreElements()) {
document.persist("sidebar-box", "sidebarcommand");
- document.persist("sidebar-box", "checked");
document.persist("sidebar-box", "width");
document.persist("sidebar-title", "value");
}
},
/**
* Opens the switcher panel if it's closed, or closes it if it's open.
*/
--- a/browser/components/nsBrowserGlue.js
+++ b/browser/components/nsBrowserGlue.js
@@ -1708,17 +1708,17 @@ BrowserGlue.prototype = {
return;
this._openPreferences("sync", { origin: "doorhanger" });
}
AlertsService.showAlertNotification(null, title, body, true, null, clickCallback);
},
// eslint-disable-next-line complexity
_migrateUI: function BG__migrateUI() {
- const UI_VERSION = 47;
+ const UI_VERSION = 48;
const BROWSER_DOCURL = "chrome://browser/content/browser.xul";
let currentUIVersion;
if (Services.prefs.prefHasUserValue("browser.migration.version")) {
currentUIVersion = Services.prefs.getIntPref("browser.migration.version");
} else {
// This is a new profile, nothing to migrate.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
@@ -2038,16 +2038,24 @@ BrowserGlue.prototype = {
// In this case just fallback to the safest side and disable suggestions.
Services.prefs.setBoolPref("browser.urlbar.suggest.searches", false);
}
} catch (ex) {
// A missing pref is not a fatal error.
}
}
+ if (currentUIVersion < 48) {
+ // Bug 1372954 - the checked value was persisted but the attribute removal wouldn't
+ // be persisted (Bug 15232). Turns out we can just not persist the value in this case.
+ // The situation was only happening for a few nightlies in 56, so this migration can
+ // be removed in version 58.
+ xulStore.removeValue(BROWSER_DOCURL, "sidebar-box", "checked");
+ }
+
// Update the migration version.
Services.prefs.setIntPref("browser.migration.version", UI_VERSION);
},
// ------------------------------
// public nsIBrowserGlue members
// ------------------------------