Bug 1567371 - Port bug 1493844, subdialogs.js part, to fix connection settings subdialog. r+a=jorgk
authorRichard Marti <richard.marti@gmail.com>
Sat, 20 Jul 2019 00:06:36 +0200
changeset 36114 0cb3f49224430ab6e0d656f22ff07ec97d3ba8ce
parent 36113 5f9e6bc285fda009d417329525d4fbe80e15bf0d
child 36115 8ed355a905feffd822c5a543344018f1c38566b6
push id392
push userclokep@gmail.com
push dateMon, 02 Sep 2019 20:17:19 +0000
bugs1567371, 1493844
Bug 1567371 - Port bug 1493844, subdialogs.js part, to fix connection settings subdialog. r+a=jorgk
mail/components/preferences/subdialogs.js
--- 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", {