Bug 1403466 - 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
--- 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});