Bug 398453 - Add unconstrained size check for pagebreakframe reflow. r+sr=roc, a=blocking1.9+
authordholbert@cs.stanford.edu
Wed, 07 Nov 2007 11:49:44 -0800
changeset 7666 321468a03d63f79c770efbf82c10167f11fc4124
parent 7665 eaa2b0789a8e20736a73fd10df2cc38ce61cce36
child 7667 f4855ed2fb5b327e8885011074a70b45891d4bee
push idunknown
push userunknown
push dateunknown
reviewersblocking1.9
bugs398453
milestone1.9b2pre
Bug 398453 - Add unconstrained size check for pagebreakframe reflow. r+sr=roc, a=blocking1.9+
layout/generic/nsPageFrame.cpp
--- a/layout/generic/nsPageFrame.cpp
+++ b/layout/generic/nsPageFrame.cpp
@@ -606,17 +606,18 @@ nsPageBreakFrame::Reflow(nsPresContext* 
                          nsReflowStatus&          aStatus)
 {
   DO_GLOBAL_REFLOW_COUNT("nsPageBreakFrame");
   DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
 
   // Override reflow, since we don't want to deal with what our
   // computed values are.
   aDesiredSize.width = GetIntrinsicWidth();
-  aDesiredSize.height = aReflowState.availableHeight;
+  aDesiredSize.height = (aReflowState.availableHeight == NS_UNCONSTRAINEDSIZE ?
+                         0 : aReflowState.availableHeight);
   // round the height down to the nearest pixel
   aDesiredSize.height -=
     aDesiredSize.height % nsPresContext::CSSPixelsToAppUnits(1);
 
   // Note: not using NS_FRAME_FIRST_REFLOW here, since it's not clear whether
   // DidReflow will always get called before the next Reflow() call.
   mHaveReflowed = PR_TRUE;
   aStatus = NS_FRAME_COMPLETE;