Bug 1567371 - Port
bug 1493844, subdialogs.js part, to fix connection settings subdialog. r=jorgk
--- a/mail/components/preferences/connection.js
+++ b/mail/components/preferences/connection.js
@@ -341,17 +341,17 @@ var gConnectionsDialog = {
// called to update checked element property to reflect current pref value
let enabled = this.isDnsOverHttpsEnabled();
let uriPref = Preferences.get("network.trr.uri");
uriPref.disabled = !enabled || this.isDnsOverHttpsLocked();
// this is the first signal we get when the prefs are available, so
// lazy-init if appropriate
if (!this._areTrrPrefsReady) {
this._areTrrPrefsReady = true;
- this._handleTrrPrefsReady();
+ gConnectionsDialog._handleTrrPrefsReady();
} else {
this.updateDnsOverHttpsUI();
}
return enabled;
},
writeDnsOverHttpsMode() {
// called to update pref with user change
--- a/mail/components/preferences/subdialogs.js
+++ b/mail/components/preferences/subdialogs.js
@@ -335,23 +335,26 @@ SubDialog.prototype = {
Cu.reportError("This dialog (" + this._frame.contentWindow.location.href + ") " +
"set a height in non-px-non-em units ('" + frameHeight + "'), " +
"which is likely to lead to bad sizing in in-content preferences. " +
"Please consider changing this.");
comparisonFrameHeight = parseFloat(frameHeight);
}
if (comparisonFrameHeight > maxHeight) {
- // If the height is bigger than that of the window, we should let the contents scroll:
+ // If the height is bigger than that of the window, we should let the
+ // contents scroll. The class is set on the "dialog" element, unless a
+ // content pane exists, which is usually the case when the "window"
+ // element is used to implement the subdialog instead.
frameHeight = maxHeight + "px";
frameMinHeight = maxHeight + "px";
- let containers = this._frame.contentDocument.querySelectorAll(".largeDialogContainer");
- for (let container of containers) {
- container.classList.add("doScroll");
- }
+ let contentPane =
+ this._frame.contentDocument.querySelector(".contentPane") ||
+ this._frame.contentDocument.documentElement;
+ contentPane.classList.add("doScroll");
}
this._frame.style.height = frameHeight;
this._box.style.minHeight = "calc(" +
(boxVerticalBorder + titleBarHeight + frameVerticalMargin) +
"px + " + frameMinHeight + ")";
this._overlay.dispatchEvent(new CustomEvent("dialogopen", {