commit 49cad6474205d4aa20122884c666fdba9b752a9a
parent 5f45348f92aff96aeb7dc58601476fe39f8e380d
Author: Emilio Cobos Álvarez <emilio@crisal.io>
Date: Thu, 2 Oct 2025 18:46:08 +0000
Bug 1986711 - Closed menupopups shouldn't have an intrinsic size. r=layout-reviewers,dshin
We already avoid most of the reflow work during Reflow(), but this
code-path can still be expensive. We get it to try to compute the
hypothetical position of a popup, which arguably we should never need to
begin with, but this seems trivial to do here.
Differential Revision: https://phabricator.services.mozilla.com/D267288
Diffstat:
1 file changed, 3 insertions(+), 0 deletions(-)
diff --git a/layout/xul/nsMenuPopupFrame.cpp b/layout/xul/nsMenuPopupFrame.cpp
@@ -500,6 +500,9 @@ void nsMenuPopupFrame::DidSetComputedStyle(ComputedStyle* aOldStyle) {
nscoord nsMenuPopupFrame::IntrinsicISize(const IntrinsicSizeInput& aInput,
IntrinsicISizeType aType) {
+ if (!IsOpen()) {
+ return 0;
+ }
nscoord iSize = nsBlockFrame::IntrinsicISize(aInput, aType);
if (!ShouldExpandToInflowParentOrAnchor()) {
return iSize;