From fbaf0bb26397aa498eb9156f06d5a6fe34dd7dd8 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Fri, 19 Apr 2024 03:14:29 +0200 Subject: Merging upstream version 125.0.1. Signed-off-by: Daniel Baumann --- layout/tables/nsTableCellFrame.cpp | 19 ++++++++----------- 1 file changed, 8 insertions(+), 11 deletions(-) (limited to 'layout/tables/nsTableCellFrame.cpp') diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index 70556d5e28..6eb1c3146a 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -456,7 +456,7 @@ void nsTableCellFrame::BlockDirAlignChild(WritingMode aWM, nscoord aMaxAscent) { ReflowOutput desiredSize(aWM); desiredSize.SetSize(aWM, GetLogicalSize(aWM)); - nsRect overflow(nsPoint(0, 0), GetSize()); + nsRect overflow(nsPoint(), GetSize()); overflow.Inflate(GetBorderOverflow()); desiredSize.mOverflowAreas.SetAllTo(overflow); ConsiderChildOverflow(desiredSize.mOverflowAreas, firstKid); @@ -761,24 +761,21 @@ void nsTableCellFrame::Reflow(nsPresContext* aPresContext, kidReflowInput.Init(aPresContext, Nothing(), Nothing(), Some(padding)); if (firstKid->IsScrollFrame()) { // Propagate explicit block sizes to our inner frame, if it's a scroll - // frame. + // frame. Note that in table layout, explicit heights act as a minimum + // height, see nsTableRowFrame::CalcCellActualBSize. + // // Table cells don't respect box-sizing, so we need to remove the // padding, so that the scroll-frame sizes properly (since the // scrollbars also add to the padding area). auto ToScrolledBSize = [&](const nscoord aBSize) { return std::max(0, aBSize - padding.BStartEnd(kidWM)); }; + nscoord minBSize = aReflowInput.ComputedMinBSize(); if (aReflowInput.ComputedBSize() != NS_UNCONSTRAINEDSIZE) { - kidReflowInput.SetComputedBSize( - ToScrolledBSize(aReflowInput.ComputedBSize())); + minBSize = std::max(minBSize, aReflowInput.ComputedBSize()); } - if (aReflowInput.ComputedMinBSize() > 0) { - kidReflowInput.SetComputedMinBSize( - ToScrolledBSize(aReflowInput.ComputedMinBSize())); - } - if (aReflowInput.ComputedMaxBSize() != NS_UNCONSTRAINEDSIZE) { - kidReflowInput.SetComputedMaxBSize( - ToScrolledBSize(aReflowInput.ComputedMaxBSize())); + if (minBSize > 0) { + kidReflowInput.SetComputedMinBSize(ToScrolledBSize(minBSize)); } } } -- cgit v1.2.3