From 413a084535aaf50af3d7b0f87a2fbb975a271fc4 Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Wed, 28 Oct 1998 04:11:14 +0000 Subject: [PATCH] Fixed bug #1154 - made fieldset frame aware of a constrained width on itself and pass that through to a child body git-svn-id: svn://10.0.0.236/trunk@13596 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/forms/nsFieldSetFrame.cpp | 9 +++++++-- mozilla/layout/html/forms/src/nsFieldSetFrame.cpp | 9 +++++++-- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index 41a6e6b9328..a026ac564dd 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -266,8 +266,13 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, nscoord horTaken = borderPadding.left + borderPadding.right + (2 * minTopBorder) + legendMargin.left + legendMargin.right; nscoord verTaken = padding.top + borderPadding.bottom + legendMargin.top + legendMargin.bottom; - if (NS_UNCONSTRAINEDSIZE != availSize.width) - availSize.width -= horTaken; + if (aReflowState.HaveConstrainedWidth()) { + availSize.width = aReflowState.minWidth; + } + else { + if (NS_UNCONSTRAINEDSIZE != availSize.width) + availSize.width -= horTaken; + } if (NS_UNCONSTRAINEDSIZE != availSize.height) { // XXX this assumes that the legend is taller than the top border width availSize.height -= verTaken; diff --git a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp index 41a6e6b9328..a026ac564dd 100644 --- a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp @@ -266,8 +266,13 @@ nsFieldSetFrame::Reflow(nsIPresContext& aPresContext, nscoord horTaken = borderPadding.left + borderPadding.right + (2 * minTopBorder) + legendMargin.left + legendMargin.right; nscoord verTaken = padding.top + borderPadding.bottom + legendMargin.top + legendMargin.bottom; - if (NS_UNCONSTRAINEDSIZE != availSize.width) - availSize.width -= horTaken; + if (aReflowState.HaveConstrainedWidth()) { + availSize.width = aReflowState.minWidth; + } + else { + if (NS_UNCONSTRAINEDSIZE != availSize.width) + availSize.width -= horTaken; + } if (NS_UNCONSTRAINEDSIZE != availSize.height) { // XXX this assumes that the legend is taller than the top border width availSize.height -= verTaken;