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

@@ -932,7 +932,7 @@ nsContainerFrame::ComputeAutoSize(nsRenderingContext *aRenderingContext,
* requested), and then calls Reflow(). If the reflow succeeds and the child * requested), and then calls Reflow(). If the reflow succeeds and the child
* frame is complete, deletes any next-in-flows using DeleteNextInFlowChild() * frame is complete, deletes any next-in-flows using DeleteNextInFlowChild()
*/ */
nsresult void
nsContainerFrame::ReflowChild(nsIFrame* aKidFrame, nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
@@ -974,7 +974,6 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
->DeleteNextInFlowChild(kidNextInFlow, true); ->DeleteNextInFlowChild(kidNextInFlow, true);
} }
} }
return NS_OK;
} }
@@ -1030,7 +1029,7 @@ nsContainerFrame::PositionChildViews(nsIFrame* aFrame)
* don't want to automatically sync the frame and view * don't want to automatically sync the frame and view
* NS_FRAME_NO_SIZE_VIEW - don't size the frame's view * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
*/ */
nsresult void
nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame, nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext, nsPresContext* aPresContext,
const nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowMetrics& aDesiredSize,
@@ -1064,7 +1063,7 @@ nsContainerFrame::FinishReflowChild(nsIFrame* aKidFrame,
} }
} }
return aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED); aKidFrame->DidReflow(aPresContext, aReflowState, nsDidReflowStatus::FINISHED);
} }
nsresult nsresult
@@ -1075,7 +1074,6 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
nsReflowStatus& aStatus) nsReflowStatus& aStatus)
{ {
NS_PRECONDITION(aPresContext, "null pointer"); NS_PRECONDITION(aPresContext, "null pointer");
nsresult rv = NS_OK;
nsFrameList* overflowContainers = nsFrameList* overflowContainers =
GetPropTableFrames(OverflowContainersProperty()); GetPropTableFrames(OverflowContainersProperty());
@@ -1146,14 +1144,12 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
nsReflowStatus frameStatus; nsReflowStatus frameStatus;
// Reflow // Reflow
rv = ReflowChild(frame, aPresContext, desiredSize, frameState, ReflowChild(frame, aPresContext, desiredSize, frameState,
prevRect.x, 0, aFlags, frameStatus, &tracker); prevRect.x, 0, aFlags, frameStatus, &tracker);
NS_ENSURE_SUCCESS(rv, rv);
//XXXfr Do we need to override any shrinkwrap effects here? //XXXfr Do we need to override any shrinkwrap effects here?
// e.g. desiredSize.Width() = prevRect.width; // e.g. desiredSize.Width() = prevRect.width;
rv = FinishReflowChild(frame, aPresContext, desiredSize, &frameState, FinishReflowChild(frame, aPresContext, desiredSize, &frameState,
prevRect.x, 0, aFlags); prevRect.x, 0, aFlags);
NS_ENSURE_SUCCESS(rv, rv);
// Handle continuations // Handle continuations
if (!NS_FRAME_IS_FULLY_COMPLETE(frameStatus)) { if (!NS_FRAME_IS_FULLY_COMPLETE(frameStatus)) {
@@ -1177,7 +1173,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
} }
else if (!(nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) { else if (!(nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER)) {
// used to be a normal next-in-flow; steal it from the child list // used to be a normal next-in-flow; steal it from the child list
rv = static_cast<nsContainerFrame*>(nif->GetParent()) nsresult rv = static_cast<nsContainerFrame*>(nif->GetParent())
->StealFrame(nif); ->StealFrame(nif);
NS_ENSURE_SUCCESS(rv, rv); NS_ENSURE_SUCCESS(rv, rv);
} }

View File

@@ -190,15 +190,15 @@ public:
* NS_FRAME_NO_MOVE_FRAME - don't move the frame. aX and aY are ignored in this * NS_FRAME_NO_MOVE_FRAME - don't move the frame. aX and aY are ignored in this
* case. Also implies NS_FRAME_NO_MOVE_VIEW * case. Also implies NS_FRAME_NO_MOVE_VIEW
*/ */
nsresult ReflowChild(nsIFrame* aKidFrame, void ReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
nscoord aX, nscoord aX,
nscoord aY, nscoord aY,
uint32_t aFlags, uint32_t aFlags,
nsReflowStatus& aStatus, nsReflowStatus& aStatus,
nsOverflowContinuationTracker* aTracker = nullptr); nsOverflowContinuationTracker* aTracker = nullptr);
/** /**
* The second half of frame reflow. Does the following: * The second half of frame reflow. Does the following:
@@ -217,13 +217,13 @@ public:
* don't want to automatically sync the frame and view * don't want to automatically sync the frame and view
* NS_FRAME_NO_SIZE_VIEW - don't size the frame's view * NS_FRAME_NO_SIZE_VIEW - don't size the frame's view
*/ */
static nsresult FinishReflowChild(nsIFrame* aKidFrame, static void FinishReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext, nsPresContext* aPresContext,
const nsHTMLReflowMetrics& aDesiredSize, const nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState* aReflowState, const nsHTMLReflowState* aReflowState,
nscoord aX, nscoord aX,
nscoord aY, nscoord aY,
uint32_t aFlags); uint32_t aFlags);
static void PositionChildViews(nsIFrame* aFrame); static void PositionChildViews(nsIFrame* aFrame);

View File

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

View File

@@ -827,7 +827,7 @@ nsMathMLContainerFrame::UpdateOverflow()
return false; return false;
} }
nsresult void
nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame, nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
@@ -875,7 +875,6 @@ nsMathMLContainerFrame::ReflowChild(nsIFrame* aChildFrame,
aDesiredSize.mBoundingMetrics.descent = r.YMost() - aDesiredSize.TopAscent(); aDesiredSize.mBoundingMetrics.descent = r.YMost() - aDesiredSize.TopAscent();
aDesiredSize.mBoundingMetrics.width = aDesiredSize.Width(); aDesiredSize.mBoundingMetrics.width = aDesiredSize.Width();
} }
return NS_OK;
} }
void void

View File

@@ -277,7 +277,7 @@ public:
// helper method to reflow a child frame. We are inline frames, and we don't // helper method to reflow a child frame. We are inline frames, and we don't
// know our positions until reflow is finished. That's why we ask the // know our positions until reflow is finished. That's why we ask the
// base method not to worry about our position. // base method not to worry about our position.
nsresult void
ReflowChild(nsIFrame* aKidFrame, ReflowChild(nsIFrame* aKidFrame,
nsPresContext* aPresContext, nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,

View File

@@ -1996,14 +1996,13 @@ nsTableFrame::UpdateOverflow()
return FinishAndStoreOverflow(overflowAreas, GetSize()); return FinishAndStoreOverflow(overflowAreas, GetSize());
} }
nsresult void
nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize, nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
nscoord aAvailHeight, nscoord aAvailHeight,
nsIFrame*& aLastChildReflowed, nsIFrame*& aLastChildReflowed,
nsReflowStatus& aStatus) nsReflowStatus& aStatus)
{ {
nsresult rv = NS_OK;
aLastChildReflowed = nullptr; aLastChildReflowed = nullptr;
if (!GetPrevInFlow()) { if (!GetPrevInFlow()) {
@@ -2019,7 +2018,6 @@ nsTableFrame::ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
aDesiredSize.mOverflowAreas); aDesiredSize.mOverflowAreas);
ReflowColGroups(aReflowState.rendContext); ReflowColGroups(aReflowState.rendContext);
return rv;
} }
nsIFrame* nsIFrame*
@@ -2831,9 +2829,8 @@ nsTableFrame::SetupHeaderFooterChild(const nsTableReflowState& aReflowState,
nsHTMLReflowMetrics desiredSize(aReflowState.reflowState); nsHTMLReflowMetrics desiredSize(aReflowState.reflowState);
desiredSize.Width() = desiredSize.Height() = 0; desiredSize.Width() = desiredSize.Height() = 0;
nsReflowStatus status; nsReflowStatus status;
nsresult rv = ReflowChild(aFrame, presContext, desiredSize, kidReflowState, ReflowChild(aFrame, presContext, desiredSize, kidReflowState,
aReflowState.x, aReflowState.y, 0, status); aReflowState.x, aReflowState.y, 0, status);
NS_ENSURE_SUCCESS(rv, rv);
// The child will be reflowed again "for real" so no need to place it now // The child will be reflowed again "for real" so no need to place it now
aFrame->SetRepeatable(IsRepeatable(desiredSize.Height(), pageHeight)); aFrame->SetRepeatable(IsRepeatable(desiredSize.Height(), pageHeight));
@@ -2871,7 +2868,7 @@ nsTableFrame::PlaceRepeatedFooter(nsTableReflowState& aReflowState,
// Reflow the children based on the avail size and reason in aReflowState // Reflow the children based on the avail size and reason in aReflowState
// update aReflowMetrics a aStatus // update aReflowMetrics a aStatus
nsresult void
nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState, nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
nsReflowStatus& aStatus, nsReflowStatus& aStatus,
nsIFrame*& aLastChildReflowed, nsIFrame*& aLastChildReflowed,
@@ -2881,7 +2878,6 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
aLastChildReflowed = nullptr; aLastChildReflowed = nullptr;
nsIFrame* prevKidFrame = nullptr; nsIFrame* prevKidFrame = nullptr;
nsresult rv = NS_OK;
nscoord cellSpacingY = GetCellSpacingY(); nscoord cellSpacingY = GetCellSpacingY();
nsPresContext* presContext = PresContext(); nsPresContext* presContext = PresContext();
@@ -2916,14 +2912,14 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
if (isPaginated) { if (isPaginated) {
if (thead && !GetPrevInFlow()) { if (thead && !GetPrevInFlow()) {
nscoord desiredHeight; nscoord desiredHeight;
rv = SetupHeaderFooterChild(aReflowState, thead, &desiredHeight); nsresult rv = SetupHeaderFooterChild(aReflowState, thead, &desiredHeight);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return;
} }
if (tfoot) { if (tfoot) {
rv = SetupHeaderFooterChild(aReflowState, tfoot, &footerHeight); nsresult rv = SetupHeaderFooterChild(aReflowState, tfoot, &footerHeight);
if (NS_FAILED(rv)) if (NS_FAILED(rv))
return rv; return;
} }
} }
// if the child is a tbody in paginated mode reduce the height by a repeated footer // if the child is a tbody in paginated mode reduce the height by a repeated footer
@@ -2995,8 +2991,8 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
if (kidFrame->GetNextInFlow()) if (kidFrame->GetNextInFlow())
reorder = true; reorder = true;
rv = ReflowChild(kidFrame, presContext, desiredSize, kidReflowState, ReflowChild(kidFrame, presContext, desiredSize, kidReflowState,
aReflowState.x, aReflowState.y, 0, aStatus); aReflowState.x, aReflowState.y, 0, aStatus);
if (reorder) { if (reorder) {
// reorder row groups the reflow may have changed the nextinflows // reorder row groups the reflow may have changed the nextinflows
@@ -3152,8 +3148,6 @@ nsTableFrame::ReflowChildren(nsTableReflowState& aReflowState,
// the children. // the children.
mBits.mResizedColumns = false; mBits.mResizedColumns = false;
ClearGeometryDirty(); ClearGeometryDirty();
return rv;
} }
void void

View File

@@ -343,11 +343,11 @@ public:
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
nsReflowStatus& aStatus) MOZ_OVERRIDE; nsReflowStatus& aStatus) MOZ_OVERRIDE;
nsresult ReflowTable(nsHTMLReflowMetrics& aDesiredSize, void ReflowTable(nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
nscoord aAvailHeight, nscoord aAvailHeight,
nsIFrame*& aLastChildReflowed, nsIFrame*& aLastChildReflowed,
nsReflowStatus& aStatus); nsReflowStatus& aStatus);
nsFrameList& GetColGroups(); nsFrameList& GetColGroups();
@@ -542,10 +542,10 @@ protected:
nsTableRowGroupFrame* aFrame, nsTableRowGroupFrame* aFrame,
nscoord* aDesiredHeight); nscoord* aDesiredHeight);
nsresult ReflowChildren(nsTableReflowState& aReflowState, void ReflowChildren(nsTableReflowState& aReflowState,
nsReflowStatus& aStatus, nsReflowStatus& aStatus,
nsIFrame*& aLastChildReflowed, nsIFrame*& aLastChildReflowed,
nsOverflowAreas& aOverflowAreas); nsOverflowAreas& aOverflowAreas);
// This calls the col group and column reflow methods, which do two things: // This calls the col group and column reflow methods, which do two things:
// (1) set all the dimensions to 0 // (1) set all the dimensions to 0

View File

@@ -792,7 +792,7 @@ nscoord CalcHeightFromUnpaginatedHeight(nsPresContext* aPresContext,
return std::max(height, 0); return std::max(height, 0);
} }
nsresult void
nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext, nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
@@ -804,7 +804,7 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
// XXXldb Should we be checking constrained height instead? // XXXldb Should we be checking constrained height instead?
const bool isPaginated = aPresContext->IsPaginated(); const bool isPaginated = aPresContext->IsPaginated();
const bool borderCollapse = aTableFrame.IsBorderCollapse(); const bool borderCollapse = aTableFrame.IsBorderCollapse();
nsresult rv = NS_OK;
nscoord cellSpacingX = aTableFrame.GetCellSpacingX(); nscoord cellSpacingX = aTableFrame.GetCellSpacingX();
int32_t cellColSpan = 1; // must be defined here so it's set properly for non-cell kids int32_t cellColSpan = 1; // must be defined here so it's set properly for non-cell kids
@@ -912,8 +912,8 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
kidReflowState); kidReflowState);
nsReflowStatus status; nsReflowStatus status;
rv = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState,
x, 0, 0, status); x, 0, 0, status);
// allow the table to determine if/how the table needs to be rebalanced // allow the table to determine if/how the table needs to be rebalanced
// If any of the cells are not complete, then we're not complete // If any of the cells are not complete, then we're not complete
@@ -1029,7 +1029,6 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
} }
aDesiredSize.UnionOverflowAreasWithDesiredBounds(); aDesiredSize.UnionOverflowAreasWithDesiredBounds();
FinishAndStoreOverflow(&aDesiredSize); FinishAndStoreOverflow(&aDesiredSize);
return rv;
} }
/** Layout the entire row. /** Layout the entire row.

View File

@@ -254,11 +254,11 @@ protected:
* Called for incremental/dirty and resize reflows. If aDirtyOnly is true then * Called for incremental/dirty and resize reflows. If aDirtyOnly is true then
* only reflow dirty cells. * only reflow dirty cells.
*/ */
nsresult ReflowChildren(nsPresContext* aPresContext, void ReflowChildren(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
const nsHTMLReflowState& aReflowState, const nsHTMLReflowState& aReflowState,
nsTableFrame& aTableFrame, nsTableFrame& aTableFrame,
nsReflowStatus& aStatus); nsReflowStatus& aStatus);
private: private:
struct RowBits { struct RowBits {

View File

@@ -329,7 +329,7 @@ CacheRowHeightsForPrinting(nsPresContext* aPresContext,
} }
} }
nsresult void
nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext, nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
nsRowGroupReflowState& aReflowState, nsRowGroupReflowState& aReflowState,
@@ -340,7 +340,6 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
*aPageBreakBeforeEnd = false; *aPageBreakBeforeEnd = false;
nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this); nsTableFrame* tableFrame = nsTableFrame::GetTableFrame(this);
nsresult rv = NS_OK;
const bool borderCollapse = tableFrame->IsBorderCollapse(); const bool borderCollapse = tableFrame->IsBorderCollapse();
nscoord cellSpacingY = tableFrame->GetCellSpacingY(); nscoord cellSpacingY = tableFrame->GetCellSpacingY();
@@ -403,8 +402,8 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
kidReflowState.mFlags.mIsTopOfPage = false; kidReflowState.mFlags.mIsTopOfPage = false;
} }
rv = ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState, ReflowChild(kidFrame, aPresContext, desiredSize, kidReflowState,
0, aReflowState.y, 0, aStatus); 0, aReflowState.y, 0, aStatus);
// Place the child // Place the child
PlaceChild(aPresContext, aReflowState, kidFrame, desiredSize, PlaceChild(aPresContext, aReflowState, kidFrame, desiredSize,
@@ -472,8 +471,6 @@ nsTableRowGroupFrame::ReflowChildren(nsPresContext* aPresContext,
InvalidateFrame(); InvalidateFrame();
} }
} }
return rv;
} }
nsTableRowFrame* nsTableRowFrame*
@@ -1046,7 +1043,6 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
{ {
NS_PRECONDITION(aPresContext->IsPaginated(), "SplitRowGroup currently supports only paged media"); NS_PRECONDITION(aPresContext->IsPaginated(), "SplitRowGroup currently supports only paged media");
nsresult rv = NS_OK;
nsTableRowFrame* prevRowFrame = nullptr; nsTableRowFrame* prevRowFrame = nullptr;
aDesiredSize.Height() = 0; aDesiredSize.Height() = 0;
@@ -1099,9 +1095,8 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
// Reflow the cell with the constrained height. A cell with rowspan >1 will get this // Reflow the cell with the constrained height. A cell with rowspan >1 will get this
// reflow later during SplitSpanningCells. // reflow later during SplitSpanningCells.
rv = ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowState, ReflowChild(rowFrame, aPresContext, rowMetrics, rowReflowState,
0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus); 0, 0, NS_FRAME_NO_MOVE_FRAME, aStatus);
if (NS_FAILED(rv)) return rv;
rowFrame->SetSize(nsSize(rowMetrics.Width(), rowMetrics.Height())); rowFrame->SetSize(nsSize(rowMetrics.Width(), rowMetrics.Height()));
rowFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED); rowFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
rowFrame->DidResize(); rowFrame->DidResize();

View File

@@ -358,14 +358,12 @@ protected:
* *
* @param aPresContext presentation context to use * @param aPresContext presentation context to use
* @param aReflowState current inline state * @param aReflowState current inline state
* @return true if we successfully reflowed all the mapped children and false
* otherwise, e.g. we pushed children to the next in flow
*/ */
nsresult ReflowChildren(nsPresContext* aPresContext, void ReflowChildren(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,
nsRowGroupReflowState& aReflowState, nsRowGroupReflowState& aReflowState,
nsReflowStatus& aStatus, nsReflowStatus& aStatus,
bool* aPageBreakBeforeEnd = nullptr); bool* aPageBreakBeforeEnd = nullptr);
nsresult SplitRowGroup(nsPresContext* aPresContext, nsresult SplitRowGroup(nsPresContext* aPresContext,
nsHTMLReflowMetrics& aDesiredSize, nsHTMLReflowMetrics& aDesiredSize,