diff --git a/layout/generic/nsPageFrame.cpp b/layout/generic/nsPageFrame.cpp index 7963a735d22..3cbd7e1057e 100644 --- a/layout/generic/nsPageFrame.cpp +++ b/layout/generic/nsPageFrame.cpp @@ -110,7 +110,9 @@ NS_IMETHODIMP nsPageFrame::Reflow(nsPresContext* aPresContext, avHeight); float scale = aPresContext->GetPageScale(); maxSize.width = NSToCoordCeil(maxSize.width / scale); - maxSize.height = NSToCoordCeil(maxSize.height / scale); + if (maxSize.height != NS_UNCONSTRAINEDSIZE) { + maxSize.height = NSToCoordCeil(maxSize.height / scale); + } // Get the number of Twips per pixel from the PresContext nscoord onePixelInTwips = nsPresContext::CSSPixelsToAppUnits(1); // insurance against infinite reflow, when reflowing less than a pixel