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