From b909fccc9246dc96a32f68cd6de4a5a90cd31cdb Mon Sep 17 00:00:00 2001 From: Moonchild Date: Mon, 27 Jul 2026 17:59:43 +0200 Subject: [PATCH] Revert "Issue #3153 - Make sure buttons report a definite size for flex containers." This reverts commit 3e223cbfb42e6d4eaac4429b62eb032ba4bab71a. --- layout/forms/nsHTMLButtonControlFrame.cpp | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/layout/forms/nsHTMLButtonControlFrame.cpp b/layout/forms/nsHTMLButtonControlFrame.cpp index 068f9d06dd..d1fbfbabd7 100644 --- a/layout/forms/nsHTMLButtonControlFrame.cpp +++ b/layout/forms/nsHTMLButtonControlFrame.cpp @@ -234,13 +234,7 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext, { WritingMode wm = GetWritingMode(); LogicalSize availSize = aButtonReflowInput.ComputedSize(wm); - - // Preserve the button's definite BSize so that flex/grid children inside - // see a definite containing block main size. Only clobber to intrinsic - // when the button itself has an indefinite BSize. - if (aButtonReflowInput.ComputedBSize() == NS_INTRINSICSIZE) { - availSize.BSize(wm) = NS_INTRINSICSIZE; - } + availSize.BSize(wm) = NS_INTRINSICSIZE; // shorthand for a value we need to use in a bunch of places const LogicalMargin& clbp = aButtonReflowInput.ComputedLogicalBorderPadding(); @@ -254,12 +248,6 @@ nsHTMLButtonControlFrame::ReflowButtonContents(nsPresContext* aPresContext, aFirstKid, availSize); - // Also set the computed BSize directly on the inner reflow input so it - // gets used as-is by the anonymous flex container: - if (aButtonReflowInput.ComputedBSize() != NS_INTRINSICSIZE) { - contentsReflowInput.SetComputedBSize(aButtonReflowInput.ComputedBSize()); - } - nsReflowStatus contentsReflowStatus; ReflowOutput contentsDesiredSize(aButtonReflowInput); childPos.B(wm) = 0; // This will be set properly later, after reflowing the