Bug 775624 Part 4 - Remove NS_FRAME_IS_FULLY_COMPLETE. r=dholbert

This patch is written by the help of the following script.

function rename() {
find layout\
     -type f\
     \( -name "*.cpp" -or\
        -name "*.h" \)\
        -exec sed -i -r "s/$1/$2/g" "{}" \;
}

rename "NS_FRAME_IS_FULLY_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsFullyComplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 200639e836cebe26fd77cde21f478fd027e1725f
This commit is contained in:
Ting-Yu Lin 2017-02-11 22:38:48 +08:00
parent b31150930a
commit 99ebdf6cf3
21 changed files with 40 additions and 43 deletions

View File

@ -898,7 +898,7 @@ nsComboboxControlFrame::Reflow(nsPresContext* aPresContext,
mButtonFrame->SetRect(buttonRect, containerSize);
if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
!aStatus.IsFullyComplete()) {
// This frame didn't fit inside a fragmentation container. Splitting
// a nsComboboxControlFrame makes no sense, so we override the status here.
aStatus = NS_FRAME_COMPLETE;

View File

@ -235,7 +235,7 @@ nsDateTimeControlFrame::Reflow(nsPresContext* aPresContext,
ReflowChild(inputAreaFrame, aPresContext, childDesiredSize,
childReflowOuput, myWM, childOffset, dummyContainerSize, 0,
childStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
MOZ_ASSERT(childStatus.IsFullyComplete(),
"We gave our child unconstrained available block-size, "
"so it should be complete");

View File

@ -183,7 +183,7 @@ nsNumberControlFrame::Reflow(nsPresContext* aPresContext,
ReflowChild(outerWrapperFrame, aPresContext, wrappersDesiredSize,
wrapperReflowInput, myWM, wrapperOffset, dummyContainerSize, 0,
childStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(childStatus),
MOZ_ASSERT(childStatus.IsFullyComplete(),
"We gave our child unconstrained available block-size, "
"so it should be complete");

View File

@ -418,7 +418,7 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
ReflowOutput trackDesiredSize(aReflowInput);
ReflowChild(trackFrame, aPresContext, trackDesiredSize,
trackReflowInput, trackX, trackY, 0, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
MOZ_ASSERT(frameStatus.IsFullyComplete(),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(trackFrame, aPresContext, trackDesiredSize,
&trackReflowInput, trackX, trackY, 0);
@ -440,7 +440,7 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
ReflowOutput thumbDesiredSize(aReflowInput);
ReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
thumbReflowInput, 0, 0, 0, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
MOZ_ASSERT(frameStatus.IsFullyComplete(),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(thumbFrame, aPresContext, thumbDesiredSize,
&thumbReflowInput, 0, 0, 0);
@ -466,7 +466,7 @@ nsRangeFrame::ReflowAnonymousContent(nsPresContext* aPresContext,
ReflowChild(rangeProgressFrame, aPresContext,
progressDesiredSize, progressReflowInput, 0, 0,
0, frameStatus);
MOZ_ASSERT(NS_FRAME_IS_FULLY_COMPLETE(frameStatus),
MOZ_ASSERT(frameStatus.IsFullyComplete(),
"We gave our child unconstrained height, so it should be complete");
FinishReflowChild(rangeProgressFrame, aPresContext,
progressDesiredSize, &progressReflowInput, 0, 0, 0);

View File

@ -941,7 +941,7 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
!mustPlaceFloat &&
(!mReflowInput.mFlags.mIsTopOfPage || floatPos.B(wm) > 0) &&
NS_STYLE_PAGE_BREAK_AVOID == aFloat->StyleDisplay()->mBreakInside &&
(!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus) ||
(!reflowStatus.IsFullyComplete() ||
aFloat->BSize(wm) + floatMargin.BStartEnd(wm) >
ContentBEnd() - floatPos.B(wm)) &&
!aFloat->GetPrevInFlow()) {
@ -1002,7 +1002,7 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
FloatManager()->IncludeInDamage(blockStart, blockEnd);
}
if (!NS_FRAME_IS_FULLY_COMPLETE(reflowStatus)) {
if (!reflowStatus.IsFullyComplete()) {
mBlock->SplitFloat(*this, aFloat, reflowStatus);
} else {
MOZ_ASSERT(!aFloat->GetNextInFlow());

View File

@ -138,7 +138,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
ReflowAbsoluteFrame(aDelegatingFrame, aPresContext, aReflowInput, cb,
aFlags, kidFrame, kidStatus, aOverflowAreas);
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
if (!NS_FRAME_IS_FULLY_COMPLETE(kidStatus) &&
if (!kidStatus.IsFullyComplete() &&
aDelegatingFrame->IsFrameOfType(nsIFrame::eCanContainOverflowContainers)) {
// Need a continuation
if (!nextFrame) {

View File

@ -1238,8 +1238,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
// If we have a next-in-flow, and that next-in-flow has pushed floats from
// this frame from a previous iteration of reflow, then we should not return
// a status of NS_FRAME_IS_FULLY_COMPLETE, since we actually have overflow,
// it's just already been handled.
// a status with IsFullyComplete() equals to true, since we actually have
// overflow, it's just already been handled.
// NOTE: This really shouldn't happen, since we _should_ pull back our floats
// and reflow them, but just in case it does, this is a safety precaution so
@ -1247,7 +1247,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
// been deleted as part of removing our next-in-flow.
// XXXmats maybe this code isn't needed anymore?
// XXXmats (layout/generic/crashtests/600100.xhtml doesn't crash without it)
if (NS_FRAME_IS_FULLY_COMPLETE(state.mReflowStatus)) {
if (state.mReflowStatus.IsFullyComplete()) {
nsBlockFrame* nif = static_cast<nsBlockFrame*>(GetNextInFlow());
while (nif) {
if (nif->HasPushedFloatsFromPrevContinuation()) {
@ -1272,7 +1272,7 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
NS_FRAME_SET_INCOMPLETE(state.mReflowStatus);
}
if (!NS_FRAME_IS_FULLY_COMPLETE(state.mReflowStatus)) {
if (!state.mReflowStatus.IsFullyComplete()) {
if (HasOverflowLines() || HasPushedFloats()) {
state.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
}
@ -3604,7 +3604,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
collapsedBEndMargin,
overflowAreas,
frameReflowStatus);
if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus) &&
if (!frameReflowStatus.IsFullyComplete() &&
ShouldAvoidBreakInside(aState.mReflowInput)) {
*aKeepReflowGoing = false;
}
@ -3628,7 +3628,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
// Continue the block frame now if it didn't completely fit in
// the available space.
if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus)) {
if (!frameReflowStatus.IsFullyComplete()) {
bool madeContinuation =
CreateContinuationFor(aState, nullptr, frame);
@ -4240,7 +4240,7 @@ nsBlockFrame::ReflowInlineFrame(BlockReflowInput& aState,
}
}
if (!NS_FRAME_IS_FULLY_COMPLETE(frameReflowStatus)) {
if (!frameReflowStatus.IsFullyComplete()) {
// Create a continuation for the incomplete frame. Note that the
// frame may already have a continuation.
CreateContinuationFor(aState, aLine, aFrame);
@ -4291,7 +4291,7 @@ nsBlockFrame::SplitFloat(BlockReflowInput& aState,
nsIFrame* aFloat,
nsReflowStatus aFloatStatus)
{
MOZ_ASSERT(!NS_FRAME_IS_FULLY_COMPLETE(aFloatStatus),
MOZ_ASSERT(!aFloatStatus.IsFullyComplete(),
"why split the frame if it's fully complete?");
MOZ_ASSERT(aState.mBlock == this);
@ -4639,7 +4639,7 @@ nsBlockFrame::PlaceLine(BlockReflowInput& aState,
newBCoord = aState.mBCoord + dy;
}
if (!NS_FRAME_IS_FULLY_COMPLETE(aState.mReflowStatus) &&
if (!aState.mReflowStatus.IsFullyComplete() &&
ShouldAvoidBreakInside(aState.mReflowInput)) {
aLine->AppendFloats(aState.mCurrentLineFloats);
aState.mReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
@ -6273,7 +6273,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
aReflowStatus, aState);
} while (clearanceFrame);
if (!NS_FRAME_IS_FULLY_COMPLETE(aReflowStatus) &&
if (!aReflowStatus.IsFullyComplete() &&
ShouldAvoidBreakInside(floatRS)) {
aReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
} else if (aReflowStatus.IsIncomplete() &&

View File

@ -336,7 +336,7 @@ nsBlockReflowContext::ReflowBlock(const LogicalRect& aSpace,
// them now. Do not do this when a break-before is signaled because
// the frame is going to get reflowed again (and may end up wanting
// a next-in-flow where it ends up), unless it is an out of flow frame.
if (NS_FRAME_IS_FULLY_COMPLETE(aFrameReflowStatus)) {
if (aFrameReflowStatus.IsFullyComplete()) {
nsIFrame* kidNextInFlow = mFrame->GetNextInFlow();
if (nullptr != kidNextInFlow) {
// Remove all of the childs next-in-flows. Make sure that we ask

View File

@ -715,7 +715,7 @@ nsCanvasFrame::Reflow(nsPresContext* aPresContext,
FinishReflowChild(kidFrame, aPresContext, kidDesiredSize, &kidReflowInput,
kidWM, kidPt, containerSize, 0);
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
if (!aStatus.IsFullyComplete()) {
nsIFrame* nextFrame = kidFrame->GetNextInFlow();
NS_ASSERTION(nextFrame || aStatus & NS_FRAME_REFLOW_NEXTINFLOW,
"If it's incomplete and has no nif yet, it must flag a nif reflow.");

View File

@ -683,7 +683,7 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
// Build a continuation column if necessary
nsIFrame* kidNextInFlow = child->GetNextInFlow();
if (NS_FRAME_IS_FULLY_COMPLETE(aStatus) && !NS_FRAME_IS_TRUNCATED(aStatus)) {
if (aStatus.IsFullyComplete() && !NS_FRAME_IS_TRUNCATED(aStatus)) {
NS_ASSERTION(!kidNextInFlow, "next in flow should have been deleted");
child = nullptr;
break;
@ -828,10 +828,10 @@ nsColumnSetFrame::ReflowChildren(ReflowOutput& aDesiredSize,
}
#ifdef DEBUG_roc
printf("*** DONE PASS feasible=%d\n", allFit && NS_FRAME_IS_FULLY_COMPLETE(aStatus)
printf("*** DONE PASS feasible=%d\n", allFit && aStatus.IsFullyComplete()
&& !NS_FRAME_IS_TRUNCATED(aStatus));
#endif
return allFit && NS_FRAME_IS_FULLY_COMPLETE(aStatus)
return allFit && aStatus.IsFullyComplete()
&& !NS_FRAME_IS_TRUNCATED(aStatus);
}
@ -1102,7 +1102,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
aStatus = NS_FRAME_COMPLETE;
}
NS_ASSERTION(NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
NS_ASSERTION(aStatus.IsFullyComplete() ||
aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE,
"Column set should be complete if the available block-size is unconstrained");

View File

@ -1030,7 +1030,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
// If the child frame is complete, delete any next-in-flows,
// but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
if (!NS_INLINE_IS_BREAK_BEFORE(aStatus) &&
NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
aStatus.IsFullyComplete() &&
!(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
if (kidNextInFlow) {
@ -1073,7 +1073,7 @@ nsContainerFrame::ReflowChild(nsIFrame* aKidFrame,
// If the child frame is complete, delete any next-in-flows,
// but only if the NO_DELETE_NEXT_IN_FLOW flag isn't set.
if (NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
if (aStatus.IsFullyComplete() &&
!(aFlags & NS_FRAME_NO_DELETE_NEXT_IN_FLOW_CHILD)) {
nsIFrame* kidNextInFlow = aKidFrame->GetNextInFlow();
if (kidNextInFlow) {
@ -1280,7 +1280,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
wm, pos, containerSize, aFlags);
// Handle continuations
if (!NS_FRAME_IS_FULLY_COMPLETE(frameStatus)) {
if (!frameStatus.IsFullyComplete()) {
if (frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
// Abspos frames can't cause their parent to be incomplete,
// only overflow incomplete.

View File

@ -11225,7 +11225,7 @@ void nsFrame::DisplayReflowExit(nsPresContext* aPresContext,
DR_state->PrettyUC(aMetrics.Height(), height, 16);
printf("Reflow d=%s,%s", width, height);
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
if (!aStatus.IsFullyComplete()) {
printf(" status=0x%x", aStatus);
}
if (aFrame->HasOverflowAreas()) {

View File

@ -5626,7 +5626,7 @@ nsGridContainerFrame::ReflowRowsInFragmentainer(
ReflowInFlowChild(child, info, aContainerSize, Some(bSize), &aFragmentainer,
aState, aContentArea, aDesiredSize, childStatus);
MOZ_ASSERT(NS_INLINE_IS_BREAK_BEFORE(childStatus) ||
!NS_FRAME_IS_FULLY_COMPLETE(childStatus) ||
!childStatus.IsFullyComplete() ||
!child->GetNextInFlow(),
"fully-complete reflow should destroy any NIFs");
@ -5685,7 +5685,7 @@ nsGridContainerFrame::ReflowRowsInFragmentainer(
if (childStatus.IsIncomplete()) {
incompleteItems.PutEntry(child);
} else if (!NS_FRAME_IS_FULLY_COMPLETE(childStatus)) {
} else if (!childStatus.IsFullyComplete()) {
overflowIncompleteItems.PutEntry(child);
}
}
@ -6415,7 +6415,7 @@ nsGridContainerFrame::Reflow(nsPresContext* aPresContext,
if (!prevInFlow) {
SharedGridData* sharedGridData = Properties().Get(SharedGridData::Prop());
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
if (!aStatus.IsFullyComplete()) {
if (!sharedGridData) {
sharedGridData = new SharedGridData;
Properties().Set(SharedGridData::Prop(), sharedGridData);

View File

@ -309,9 +309,6 @@ private:
#define NS_FRAME_OVERFLOW_IS_INCOMPLETE(status) \
(0 != ((status) & NS_FRAME_OVERFLOW_INCOMPLETE))
#define NS_FRAME_IS_FULLY_COMPLETE(status) \
(NS_FRAME_IS_COMPLETE(status) && !NS_FRAME_OVERFLOW_IS_INCOMPLETE(status))
// These macros set or switch incomplete statuses without touching the
// NS_FRAME_REFLOW_NEXTINFLOW bit.
#define NS_FRAME_SET_INCOMPLETE(status) \

View File

@ -822,7 +822,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
}
// Create a next-in-flow if needed.
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus)) {
if (!aStatus.IsFullyComplete()) {
CreateNextInFlow(aFrame);
}
@ -847,7 +847,7 @@ nsInlineFrame::ReflowInlineFrame(nsPresContext* aPresContext,
return;
}
if (!NS_FRAME_IS_FULLY_COMPLETE(aStatus) && !reflowingFirstLetter) {
if (!aStatus.IsFullyComplete() && !reflowingFirstLetter) {
nsIFrame* nextFrame = aFrame->GetNextSibling();
if (nextFrame) {
PushFrames(aPresContext, nextFrame, aFrame, irs);

View File

@ -88,7 +88,7 @@ nsPageContentFrame::Reflow(nsPresContext* aPresContext,
// Place and size the child
FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, 0, 0, 0);
NS_ASSERTION(aPresContext->IsDynamic() || !NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
NS_ASSERTION(aPresContext->IsDynamic() || !aStatus.IsFullyComplete() ||
!frame->GetNextInFlow(), "bad child flow list");
}

View File

@ -146,7 +146,7 @@ nsPageFrame::Reflow(nsPresContext* aPresContext,
// Place and size the child
FinishReflowChild(frame, aPresContext, aDesiredSize, &kidReflowInput, xc, yc, 0);
NS_ASSERTION(!NS_FRAME_IS_FULLY_COMPLETE(aStatus) ||
NS_ASSERTION(!aStatus.IsFullyComplete() ||
!frame->GetNextInFlow(), "bad child flow list");
}
PR_PL(("PageFrame::Reflow %p ", this));

View File

@ -283,7 +283,7 @@ nsSimplePageSequenceFrame::Reflow(nsPresContext* aPresContext,
// Is the page complete?
nsIFrame* kidNextInFlow = kidFrame->GetNextInFlow();
if (NS_FRAME_IS_FULLY_COMPLETE(status)) {
if (status.IsFullyComplete()) {
NS_ASSERTION(!kidNextInFlow, "bad child flow list");
} else if (!kidNextInFlow) {
// The page isn't complete and it doesn't have a next-in-flow, so

View File

@ -3163,7 +3163,7 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
childX = rowGroups.Length();
}
}
if (isPaginated && !NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
if (isPaginated && !aStatus.IsFullyComplete() &&
ShouldAvoidBreakInside(aReflowInput.reflowInput)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
break;

View File

@ -1118,7 +1118,7 @@ nsTableRowFrame::Reflow(nsPresContext* aPresContext,
ReflowChildren(aPresContext, aDesiredSize, aReflowInput, *tableFrame, aStatus);
if (aPresContext->IsPaginated() && !NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
if (aPresContext->IsPaginated() && !aStatus.IsFullyComplete() &&
ShouldAvoidBreakInside(aReflowInput)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
}

View File

@ -1174,7 +1174,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
rowFrame->DidReflow(aPresContext, nullptr, nsDidReflowStatus::FINISHED);
rowFrame->DidResize();
if (!aRowForcedPageBreak && !NS_FRAME_IS_FULLY_COMPLETE(aStatus) &&
if (!aRowForcedPageBreak && !aStatus.IsFullyComplete() &&
ShouldAvoidBreakInside(aReflowInput)) {
aStatus = NS_INLINE_LINE_BREAK_BEFORE();
break;