Bug 1403466 - Don't set a max-height on panelviews used by WebExtensions, because it causes browser contents to be cut-off. r=Gijs, a=ritu
authorMike de Boer <mdeboer@mozilla.com>
Tue, 10 Oct 2017 12:44:04 +0200
changeset 434801 c609f1155d1633d0a9540fad22e6abec3fe59278
parent 434800 250948dc4a6bd4316f128c089ba43abf3d1e87bf
child 434802 d0b15c72dfcd7139763f1a6637416153e5028db9
push id1567
push userjlorenzo@mozilla.com
push dateThu, 02 Nov 2017 12:36:05 +0000
treeherdermozilla-release@e512c14a0406 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
reviewersGijs, ritu
bugs1403466
milestone57.0
Bug 1403466 - Don't set a max-height on panelviews used by WebExtensions, because it causes browser contents to be cut-off. r=Gijs, a=ritu 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
@@ -118,17 +118,16 @@ class BasePopup {
         this.browser.remove();
       }
       if (this.stack) {
         this.stack.remove();
       }
 
       if (this.viewNode) {
         this.viewNode.removeEventListener(this.DESTROY_EVENT, this);
-        this.viewNode.style.maxHeight = "";
         delete this.viewNode.customRectGetter;
       }
 
       let {panel} = this;
       if (panel) {
         panel.style.removeProperty("--arrowpanel-background");
         panel.style.removeProperty("--panel-arrow-image-vertical");
         panel.removeAttribute("remote");
@@ -326,26 +325,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});