Bug 398453 - Add unconstrained size check for pagebreakframe reflow. r+sr=roc, a=blocking1.9+
--- 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;