Bug 1173689: allow column sets in an orthogonal writing mode to their container to expand in the container's block direction, r=roc

This commit is contained in:
Simon Montagu 2015-06-19 01:09:19 -07:00
parent 78ffa8b527
commit fd24391154
2 changed files with 20 additions and 6 deletions

View File

@ -1050,8 +1050,14 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
//------------ Handle Incremental Reflow -----------------
ReflowConfig config = ChooseColumnStrategy(aReflowState);
// If inline size is unconstrained, set aForceAuto to true to allow
// the columns to expand in the inline direction. (This typically
// happens in orthogonal flows where the inline direction is the
// container's block direction).
ReflowConfig config =
ChooseColumnStrategy(aReflowState,
aReflowState.ComputedISize() == NS_UNCONSTRAINEDSIZE);
// If balancing, then we allow the last column to grow to unbounded
// height during the first reflow. This gives us a way to estimate
// what the average column height should be, because we can measure

View File

@ -440,11 +440,19 @@ nsHTMLReflowState::Init(nsPresContext* aPresContext,
}
}
if (AvailableBSize() != NS_UNCONSTRAINEDSIZE && parentReflowState &&
if (parentReflowState &&
parentReflowState->GetWritingMode().IsOrthogonalTo(mWritingMode)) {
// Orthogonal frames are always reflowed with unconstrained block-size,
// to avoid incomplete reflow across an orthogonal boundary.
AvailableBSize() = NS_UNCONSTRAINEDSIZE;
// Orthogonal frames are always reflowed with an unconstrained
// dimension to avoid incomplete reflow across an orthogonal
// boundary. Normally this is the block-size, but for column sets
// with auto-height it's the inline-size, so that they can add
// columns in the container's block direction
if (type == nsGkAtoms::columnSetFrame &&
eStyleUnit_Auto == mStylePosition->ISize(mWritingMode).GetUnit()) {
ComputedISize() = NS_UNCONSTRAINEDSIZE;
} else {
AvailableBSize() = NS_UNCONSTRAINEDSIZE;
}
}
LAYOUT_WARN_IF_FALSE((mFrameType == NS_CSS_FRAME_TYPE_INLINE &&