Bug 1177614 - Provide a utility method on nsHTMLReflowState to return the computed size including border-padding, for use as a container for logical coordinate conversions, or zero if unconstrained. r=dholbert

This commit is contained in:
Jonathan Kew
2015-07-16 10:07:46 +01:00
parent 60de05da69
commit f5df4578f3
7 changed files with 28 additions and 45 deletions

View File

@@ -2973,19 +2973,11 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
nsIFrame* prevKidFrame = nullptr;
WritingMode wm = aReflowState.reflowState.GetWritingMode();
nscoord containerWidth = aReflowState.reflowState.ComputedWidth();
if (containerWidth == NS_UNCONSTRAINEDSIZE) {
NS_WARN_IF_FALSE(wm.IsVertical(),
"shouldn't have unconstrained width in horizontal mode");
// We won't know the containerWidth until we've reflowed our contents,
// so use zero for now; in vertical-rl mode, this will mean the children
// are misplaced in the block-direction, and will need to be moved
// rightwards by the true containerWidth once we know it.
containerWidth = 0;
} else {
containerWidth +=
aReflowState.reflowState.ComputedPhysicalBorderPadding().LeftRight();
}
NS_WARN_IF_FALSE(wm.IsVertical() || NS_UNCONSTRAINEDSIZE !=
aReflowState.reflowState.ComputedWidth(),
"shouldn't have unconstrained width in horizontal mode");
nscoord containerWidth =
aReflowState.reflowState.ComputedSizeAsContainerIfConstrained().width;
nsPresContext* presContext = PresContext();
// XXXldb Should we be checking constrained height instead?
@@ -3388,12 +3380,8 @@ nsTableFrame::DistributeBSizeToRows(const nsHTMLReflowState& aReflowState,
WritingMode wm = aReflowState.GetWritingMode();
LogicalMargin borderPadding = GetChildAreaOffset(wm, &aReflowState);
nscoord containerWidth = aReflowState.ComputedWidth();
if (containerWidth == NS_UNCONSTRAINEDSIZE) {
containerWidth = 0;
} else {
containerWidth += aReflowState.ComputedPhysicalBorderPadding().LeftRight();
}
nscoord containerWidth =
aReflowState.ComputedSizeAsContainerIfConstrained().width;
RowGroupArray rowGroups;
OrderRowGroups(rowGroups);