Bug 1008917 - part 5,6,7, make ReflowChild() and FinishReflowChild() return type 'void', and make a few related helper methods 'void' too. r=roc

This commit is contained in:
Mats Palmgren
2014-05-13 00:47:53 +00:00
parent 84ce46d68c
commit e03220a2e3
11 changed files with 82 additions and 107 deletions

View File

@@ -1116,19 +1116,17 @@ nsFlexContainerFrame::
nsHTMLReflowMetrics childDesiredSize(childRSForMeasuringHeight);
nsReflowStatus childReflowStatus;
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
nsresult rv = ReflowChild(aFlexItem.Frame(), aPresContext,
childDesiredSize, childRSForMeasuringHeight,
0, 0, flags, childReflowStatus);
NS_ENSURE_SUCCESS(rv, rv);
ReflowChild(aFlexItem.Frame(), aPresContext,
childDesiredSize, childRSForMeasuringHeight,
0, 0, flags, childReflowStatus);
MOZ_ASSERT(NS_FRAME_IS_COMPLETE(childReflowStatus),
"We gave flex item unconstrained available height, so it "
"should be complete");
rv = FinishReflowChild(aFlexItem.Frame(), aPresContext,
childDesiredSize, &childRSForMeasuringHeight,
0, 0, flags);
NS_ENSURE_SUCCESS(rv, rv);
FinishReflowChild(aFlexItem.Frame(), aPresContext,
childDesiredSize, &childRSForMeasuringHeight,
0, 0, flags);
// Subtract border/padding in vertical axis, to get _just_
// the effective computed value of the "height" property.
@@ -2907,11 +2905,10 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
nsHTMLReflowMetrics childDesiredSize(aChildReflowState);
nsReflowStatus childReflowStatus;
const uint32_t flags = NS_FRAME_NO_MOVE_FRAME;
nsresult rv = ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, aChildReflowState,
0, 0, flags, childReflowStatus);
ReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, aChildReflowState,
0, 0, flags, childReflowStatus);
aItem.SetHadMeasuringReflow();
NS_ENSURE_SUCCESS(rv, rv);
// XXXdholbert Once we do pagination / splitting, we'll need to actually
// handle incomplete childReflowStatuses. But for now, we give our kids
@@ -2922,9 +2919,8 @@ nsFlexContainerFrame::SizeItemInCrossAxis(
// Tell the child we're done with its initial reflow.
// (Necessary for e.g. GetBaseline() to work below w/out asserting)
rv = FinishReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, &aChildReflowState, 0, 0, flags);
NS_ENSURE_SUCCESS(rv, rv);
FinishReflowChild(aItem.Frame(), aPresContext,
childDesiredSize, &aChildReflowState, 0, 0, flags);
// Save the sizing info that we learned from this reflow
// -----------------------------------------------------
@@ -3316,11 +3312,10 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
nsHTMLReflowMetrics childDesiredSize(childReflowState);
nsReflowStatus childReflowStatus;
nsresult rv = ReflowChild(item->Frame(), aPresContext,
childDesiredSize, childReflowState,
physicalPosn.x, physicalPosn.y,
0, childReflowStatus);
NS_ENSURE_SUCCESS(rv, rv);
ReflowChild(item->Frame(), aPresContext,
childDesiredSize, childReflowState,
physicalPosn.x, physicalPosn.y,
0, childReflowStatus);
// XXXdholbert Once we do pagination / splitting, we'll need to actually
// handle incomplete childReflowStatuses. But for now, we give our kids
@@ -3332,10 +3327,9 @@ nsFlexContainerFrame::DoFlexLayout(nsPresContext* aPresContext,
childReflowState.ApplyRelativePositioning(&physicalPosn);
rv = FinishReflowChild(item->Frame(), aPresContext,
childDesiredSize, &childReflowState,
physicalPosn.x, physicalPosn.y, 0);
NS_ENSURE_SUCCESS(rv, rv);
FinishReflowChild(item->Frame(), aPresContext,
childDesiredSize, &childReflowState,
physicalPosn.x, physicalPosn.y, 0);
// If this is our first child and we haven't established a baseline for
// the container yet (i.e. if we don't have 'align-self: baseline' on any