Bug 1402845 - Don't set a max-height on panelviews used by WebExtensions, because it causes browser contents to be cut-off. r?Gijs draft
authorMike de Boer <mdeboer@mozilla.com>
Fri, 06 Oct 2017 11:16:50 +0200
changeset 675968 187541488dd35952978648d79d763eb0624691cc
parent 675967 300cde2c2282b8ddc4d734bb90f1fd7cb0a630dd
child 734787 296c54e6a56fd43ee527882fccc96e31ff36daca
push id83326
push usermdeboer@mozilla.com
push dateFri, 06 Oct 2017 09:23:00 +0000
reviewersGijs
bugs1402845
milestone58.0a1
Bug 1402845 - Don't set a max-height on panelviews used by WebExtensions, because it causes browser contents to be cut-off. r?Gijs Setting a max-height caused the '_handleDOMChange' method in ext-browser-content.js to consistently lie about the scrollHeight, since it was never allowed to grow beyond the maxHeight - even when the document needs to be larger to fit its contents. We don't need this aggressiveness in Photon panels anyway, so that makes it doubly safe to remove this code. MozReview-Commit-ID: HJVMXXHS4By
browser/components/extensions/ExtensionPopups.jsm
--- a/browser/components/extensions/ExtensionPopups.jsm
+++ b/browser/components/extensions/ExtensionPopups.jsm
@@ -326,26 +326,19 @@ class BasePopup {
       // Figure out how much extra space we have on the side of the panel
       // opposite the arrow.
       let side = this.panel.getAttribute("side") == "top" ? "bottom" : "top";
       let maxHeight = this.viewHeight + this.extraHeight[side];
 
       height = Math.min(height, maxHeight);
       this.browser.style.height = `${height}px`;
 
-      // Set a maximum height on the <panelview> element to our preferred
-      // maximum height, so that the PanelUI resizing code can make an accurate
-      // calculation. If we don't do this, the flex sizing logic will prevent us
-      // from ever reporting a preferred size smaller than the height currently
-      // available to us in the panel.
-      height = Math.max(height, this.viewHeight);
-      this.viewNode.style.maxHeight = `${height}px`;
       // Used by the panelmultiview code to figure out sizing without reparenting
       // (which would destroy the browser and break us).
-      this.lastCalculatedInViewHeight = height;
+      this.lastCalculatedInViewHeight = Math.max(height, this.viewHeight);
     } else {
       this.browser.style.width = `${width}px`;
       this.browser.style.minWidth = `${width}px`;
       this.browser.style.height = `${height}px`;
       this.browser.style.minHeight = `${height}px`;
     }
 
     let event = new this.window.CustomEvent("WebExtPopupResized", {detail});