From 9a4427f454c0672d3c969575f5930853130c1ccf Mon Sep 17 00:00:00 2001 From: Jonathan Kew Date: Mon, 24 Nov 2014 21:44:06 +0000 Subject: [PATCH] Bug 1103613 - Use better inline-size for an orthogonal flow within a block of specified dimensions. r=smontagu --- layout/generic/nsHTMLReflowState.cpp | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/layout/generic/nsHTMLReflowState.cpp b/layout/generic/nsHTMLReflowState.cpp index dbb11cf73026..2a70601ecd61 100644 --- a/layout/generic/nsHTMLReflowState.cpp +++ b/layout/generic/nsHTMLReflowState.cpp @@ -192,6 +192,16 @@ nsHTMLReflowState::nsHTMLReflowState(nsPresContext* aPresContext, AvailableISize() = aAvailableSpace.ISize(mWritingMode); AvailableBSize() = aAvailableSpace.BSize(mWritingMode); + if (mWritingMode.IsOrthogonalTo(aParentReflowState.GetWritingMode())) { + // If we're setting up for an orthogonal flow, and the parent reflow state + // had a constrained ComputedBSize, we can use that as our AvailableISize + // in preference to leaving it unconstrained. + if (AvailableISize() == NS_UNCONSTRAINEDSIZE && + aParentReflowState.ComputedBSize() != NS_UNCONSTRAINEDSIZE) { + AvailableISize() = aParentReflowState.ComputedBSize(); + } + } + mFloatManager = aParentReflowState.mFloatManager; if (frame->IsFrameOfType(nsIFrame::eLineParticipant)) mLineLayout = aParentReflowState.mLineLayout;