Bug 1167696 part 2: Remove nsTableReflowState's frame constructor-arg; get it from passed-in reflow state instead. r=mats

This commit is contained in:
Daniel Holbert 2015-05-25 19:43:50 -07:00
parent b02fb700cb
commit 44cc7a2f3e

View File

@ -71,12 +71,14 @@ struct nsTableReflowState {
nscoord y;
nsTableReflowState(const nsHTMLReflowState& aReflowState,
nsTableFrame& aTableFrame,
nscoord aAvailWidth,
nscoord aAvailHeight)
: reflowState(aReflowState)
{
nsTableFrame* table = static_cast<nsTableFrame*>(aTableFrame.FirstInFlow());
MOZ_ASSERT(reflowState.frame->GetType() == nsGkAtoms::tableFrame,
"nsTableReflowState should only be created for nsTableFrame");
nsTableFrame* table =
static_cast<nsTableFrame*>(reflowState.frame->FirstInFlow());
nsMargin borderPadding = table->GetChildAreaOffset(&reflowState);
x = borderPadding.left + table->GetColSpacing(-1);
@ -2035,7 +2037,7 @@ nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
// and our reflow height to our avail height minus border, padding, cellspacing
aDesiredSize.Width() = aReflowState.ComputedWidth() +
aReflowState.ComputedPhysicalBorderPadding().LeftRight();
nsTableReflowState reflowState(aReflowState, *this,
nsTableReflowState reflowState(aReflowState,
aDesiredSize.Width(), aAvailHeight);
ReflowChildren(reflowState, aStatus, aLastChildReflowed,
aDesiredSize.mOverflowAreas);