Bug 1567371 - Port bug 1493844, subdialogs.js part, to fix connection settings subdialog. r=jorgk
authorRichard Marti <richard.marti@gmail.com>
Sat, 20 Jul 2019 00:06:36 +0200
changeset 35411 183d48f45b75f3ca4506a78f9bc705355e3863ed
parent 35410 d564bfe65f47e790b1241f5bd7b02dd83acfa5bd
child 35412 e94d7ea656dc7f32c197fc9a0386f7153a1cee7a
push id2486
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:24:43 +0000
treeherdercomm-beta@1b30a9a6e7f6 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersjorgk
bugs1567371, 1493844
Bug 1567371 - Port bug 1493844, subdialogs.js part, to fix connection settings subdialog. r=jorgk
mail/components/preferences/connection.js
mail/components/preferences/subdialogs.js
--- 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", {