Bug 463350. Don't allow fieldsets to break vertically. r+sr=dbaron
authorRobert O'Callahan <robert@ocallahan.org>
Fri, 08 May 2009 13:55:22 +1200
changeset 28110 f053a233cc7b
parent 28109 3802713fbe2e
child 28111 24793a90135d
push id6896
push userrocallahan@mozilla.com
push date2009-05-08 03:22 +0000
treeherdermozilla-central@c97e93f23f89 [default view] [failures only]
perfherder[talos] [build metrics] [platform microbench] (compared to previous push)
bugs463350
milestone1.9.2a1pre
Bug 463350. Don't allow fieldsets to break vertically. r+sr=dbaron
layout/forms/nsFieldSetFrame.cpp
--- a/layout/forms/nsFieldSetFrame.cpp
+++ b/layout/forms/nsFieldSetFrame.cpp
@@ -426,17 +426,19 @@ nsFieldSetFrame::Reflow(nsPresContext*  
   if (aReflowState.ShouldReflowAllKids()) {
     reflowContent = mContentFrame != nsnull;
     reflowLegend = mLegendFrame != nsnull;
   } else {
     reflowContent = mContentFrame && NS_SUBTREE_DIRTY(mContentFrame);
     reflowLegend = mLegendFrame && NS_SUBTREE_DIRTY(mLegendFrame);
   }
 
-  nsSize availSize(aReflowState.ComputedWidth(), aReflowState.availableHeight);
+  // We don't allow fieldsets to break vertically. If we did, we'd
+  // need logic here to push and pull overflow frames.
+  nsSize availSize(aReflowState.ComputedWidth(), NS_UNCONSTRAINEDSIZE);
   NS_ASSERTION(!mContentFrame ||
       nsLayoutUtils::IntrinsicForContainer(aReflowState.rendContext,
                                            mContentFrame,
                                            nsLayoutUtils::MIN_WIDTH) <=
                availSize.width,
                "Bogus availSize.width; should be bigger");
   NS_ASSERTION(!mLegendFrame ||
       nsLayoutUtils::IntrinsicForContainer(aReflowState.rendContext,
@@ -481,22 +483,16 @@ nsFieldSetFrame::Reflow(nsPresContext*  
     }
 
     // if the legend space changes then we need to reflow the 
     // content area as well.
     if (mLegendSpace != oldSpace && mContentFrame) {
       reflowContent = PR_TRUE;
     }
 
-    // if we are contrained then remove the legend from our available height.
-    if (NS_INTRINSICSIZE != availSize.height) {
-      availSize.height -= mLegendSpace;
-      availSize.height = PR_MAX(availSize.height, 0);
-    }
-
     FinishReflowChild(mLegendFrame, aPresContext, &legendReflowState, 
                       legendDesiredSize, 0, 0, NS_FRAME_NO_MOVE_FRAME);    
   } else if (!mLegendFrame) {
     mLegendRect.Empty();
     mLegendSpace = 0;
   } else {
     // mLegendSpace and mLegendRect haven't changed, but we need
     // the used margin when placing the legend.