Bug 1400117 - Initialize Application handlers after pageshow to avoid delaying painting of Preferences page r?jaws,florian
MozReview-Commit-ID: Cla3vz3YF38
--- a/browser/components/preferences/in-content/main.js
+++ b/browser/components/preferences/in-content/main.js
@@ -431,29 +431,24 @@ var gMainPane = {
// from the xul file was used. If we are sorting on the other
// column, we should remove it.
document.getElementById("typeColumn").removeAttribute("sortDirection");
} else {
this._sortColumn = document.getElementById("typeColumn");
}
// Load the data and build the list of handlers.
- // By doing this in a timeout, we let the preferences dialog resize itself
- // to an appropriate size before we add a bunch of items to the list.
- // Otherwise, if there are many items, and the Applications prefpane
- // is the one that gets displayed when the user first opens the dialog,
- // the dialog might stretch too much in an attempt to fit them all in.
- // XXX Shouldn't we perhaps just set a max-height on the richlistbox?
- var _delayedPaneLoad = function(self) {
- self._loadData();
- self._rebuildVisibleTypes();
- self._sortVisibleTypes();
- self._rebuildView();
- }
- setTimeout(_delayedPaneLoad, 0, this);
+ // By doing this after pageshow, we ensure it doesn't delay painting
+ // of the preferences page.
+ window.addEventListener("pageshow", () => {
+ this._loadData();
+ this._rebuildVisibleTypes();
+ this._sortVisibleTypes();
+ this._rebuildView();
+ });
let browserBundle = document.getElementById("browserBundle");
appendSearchKeywords("browserContainersSettings", [
browserBundle.getString("userContextPersonal.label"),
browserBundle.getString("userContextWork.label"),
browserBundle.getString("userContextBanking.label"),
browserBundle.getString("userContextShopping.label"),
]);
--- a/browser/themes/shared/incontentprefs/preferences.inc.css
+++ b/browser/themes/shared/incontentprefs/preferences.inc.css
@@ -218,17 +218,24 @@ separator.thin:not([orient="vertical"])
}
#handlersView {
height: 25em;
margin-inline-end: 0;
}
#handlersView > richlistitem {
- min-height: 36px !important;
+ min-height: 30px !important;
+}
+
+#handlersView > richlistitem > hbox > hbox > menulist {
+ margin-top: 0;
+ margin-bottom: 0;
+ margin-inline-end: 0;
+ min-height: 0;
}
.typeIcon {
margin-inline-start: 10px !important;
margin-inline-end: 9px !important;
}
.actionIcon {