Bug 775624 Part 3 - Remove NS_FRAME_IS_NOT_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_NOT_COMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.IsIncomplete()"

MozReview-Commit-ID: GOd4y2N6dcz

--HG--
extra : rebase_source : 412b60e7954118d8443ebf2a786046d7cd38c516
This commit is contained in:
Ting-Yu Lin 2017-02-11 22:17:26 +08:00
Родитель 36df42df35
Коммит b31150930a
12 изменённых файлов: 24 добавлений и 27 удалений

Просмотреть файл

@ -912,7 +912,7 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
}
if (aFloat->GetPrevInFlow())
floatMargin.BStart(wm) = 0;
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus))
if (reflowStatus.IsIncomplete())
floatMargin.BEnd(wm) = 0;
// In the case that we're in columns and not splitting floats, we need
@ -980,7 +980,7 @@ BlockReflowInput::FlowAndPlaceFloat(nsIFrame* aFloat)
nsFloatManager::CalculateRegionFor(wm, aFloat, floatMargin,
ContainerSize());
// if the float split, then take up all of the vertical height
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus) &&
if (reflowStatus.IsIncomplete() &&
(NS_UNCONSTRAINEDSIZE != ContentBSize())) {
region.BSize(wm) = std::max(region.BSize(wm),
ContentBSize() - floatPos.B(wm));

Просмотреть файл

@ -191,7 +191,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
// Abspos frames can't cause their parent to be incomplete,
// only overflow incomplete.
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus))
if (reflowStatus.IsIncomplete())
NS_FRAME_SET_OVERFLOW_INCOMPLETE(reflowStatus);
NS_MergeReflowStatusInto(&aReflowStatus, reflowStatus);

Просмотреть файл

@ -263,14 +263,14 @@ RecordReflowStatus(bool aChildIsBlock, nsReflowStatus aFrameReflowStatus)
if (NS_INLINE_IS_BREAK_BEFORE(aFrameReflowStatus)) {
newS |= 1;
}
else if (NS_FRAME_IS_NOT_COMPLETE(aFrameReflowStatus)) {
else if (aFrameReflowStatus.IsIncomplete()) {
newS |= 2;
}
else {
newS |= 4;
}
}
else if (NS_FRAME_IS_NOT_COMPLETE(aFrameReflowStatus)) {
else if (aFrameReflowStatus.IsIncomplete()) {
newS |= 8;
}
else {
@ -1658,7 +1658,7 @@ nsBlockFrame::ComputeFinalSize(const ReflowInput& aReflowInput,
}
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
if (NS_FRAME_IS_NOT_COMPLETE(aState.mReflowStatus)) {
if (aState.mReflowStatus.IsIncomplete()) {
// Overflow containers can only be overflow complete.
// Note that auto height overflow containers have no normal children
NS_ASSERTION(finalSize.BSize(wm) == 0,
@ -2683,7 +2683,7 @@ nsBlockFrame::ReflowDirtyLines(BlockReflowInput& aState)
}
}
if (NS_FRAME_IS_NOT_COMPLETE(aState.mReflowStatus)) {
if (aState.mReflowStatus.IsIncomplete()) {
aState.mReflowStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
} //XXXfr shouldn't set this flag when nextinflow has no lines
}
@ -3635,7 +3635,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
nsIFrame* nextFrame = frame->GetNextInFlow();
NS_ASSERTION(nextFrame, "We're supposed to have a next-in-flow by now");
if (NS_FRAME_IS_NOT_COMPLETE(frameReflowStatus)) {
if (frameReflowStatus.IsIncomplete()) {
// If nextFrame used to be an overflow container, make it a normal block
if (!madeContinuation &&
(NS_FRAME_IS_OVERFLOW_CONTAINER & nextFrame->GetStateBits())) {
@ -6276,7 +6276,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
if (!NS_FRAME_IS_FULLY_COMPLETE(aReflowStatus) &&
ShouldAvoidBreakInside(floatRS)) {
aReflowStatus = NS_INLINE_LINE_BREAK_BEFORE();
} else if (NS_FRAME_IS_NOT_COMPLETE(aReflowStatus) &&
} else if (aReflowStatus.IsIncomplete() &&
(NS_UNCONSTRAINEDSIZE == aAdjustedAvailableSpace.BSize(wm))) {
// An incomplete reflow status means we should split the float
// if the height is constrained (bug 145305).
@ -6291,7 +6291,7 @@ nsBlockFrame::ReflowFloat(BlockReflowInput& aState,
// We never split floating first letters; an incomplete state for
// such frames simply means that there is more content to be
// reflowed on the line.
if (NS_FRAME_IS_NOT_COMPLETE(aReflowStatus))
if (aReflowStatus.IsIncomplete())
aReflowStatus = NS_FRAME_COMPLETE;
}
@ -7408,7 +7408,7 @@ nsBlockFrame::ComputeFinalBSize(const ReflowInput& aReflowInput,
computedBSizeLeftOver),
aBorderPadding.BEnd(wm));
if (NS_FRAME_IS_NOT_COMPLETE(*aStatus) &&
if (aStatus->IsIncomplete() &&
aFinalSize.BSize(wm) < aReflowInput.AvailableBSize()) {
// We fit in the available space - change status to OVERFLOW_INCOMPLETE.
// XXXmats why didn't Reflow report OVERFLOW_INCOMPLETE in the first place?

Просмотреть файл

@ -10340,7 +10340,7 @@ nsFrame::Trace(const char* aMethod, bool aEnter, nsReflowStatus aStatus)
GetTagName(this, mContent, sizeof(tagbuf), tagbuf);
PR_LogPrint("%s: %s %s, status=%scomplete%s",
tagbuf, aEnter ? "enter" : "exit", aMethod,
NS_FRAME_IS_NOT_COMPLETE(aStatus) ? "not" : "",
aStatus.IsIncomplete() ? "not" : "",
(aStatus & NS_FRAME_REFLOW_NEXTINFLOW) ? "+reflow" : "");
}
}

Просмотреть файл

@ -5653,7 +5653,7 @@ nsGridContainerFrame::ReflowRowsInFragmentainer(
aFragmentainer.mToFragmentainerEnd = bEndRow;
if (aFragmentainer.mIsAutoBSize) {
aBSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowInput, &aStatus);
} else if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
} else if (aStatus.IsIncomplete()) {
aBSize = NS_CSS_MINMAX(aState.mReflowInput->ComputedBSize(),
aState.mReflowInput->ComputedMinBSize(),
aState.mReflowInput->ComputedMaxBSize());
@ -5683,7 +5683,7 @@ nsGridContainerFrame::ReflowRowsInFragmentainer(
MOZ_ASSERT_UNREACHABLE("unexpected child reflow status");
}
if (NS_FRAME_IS_NOT_COMPLETE(childStatus)) {
if (childStatus.IsIncomplete()) {
incompleteItems.PutEntry(child);
} else if (!NS_FRAME_IS_FULLY_COMPLETE(childStatus)) {
overflowIncompleteItems.PutEntry(child);

Просмотреть файл

@ -306,9 +306,6 @@ private:
#define NS_FRAME_IS_COMPLETE(status) \
(0 == ((status) & NS_FRAME_NOT_COMPLETE))
#define NS_FRAME_IS_NOT_COMPLETE(status) \
(0 != ((status) & NS_FRAME_NOT_COMPLETE))
#define NS_FRAME_OVERFLOW_IS_INCOMPLETE(status) \
(0 != ((status) & NS_FRAME_OVERFLOW_INCOMPLETE))

Просмотреть файл

@ -688,7 +688,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
bool reflowingFirstLetter = lineLayout->GetFirstLetterStyleOK();
ReflowInlineFrame(aPresContext, aReflowInput, irs, frame, aStatus);
done = NS_INLINE_IS_BREAK(aStatus) ||
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus));
(!reflowingFirstLetter && aStatus.IsIncomplete());
if (done) {
if (!irs.mSetParentPointer) {
break;
@ -726,7 +726,7 @@ nsInlineFrame::ReflowFrames(nsPresContext* aPresContext,
}
ReflowInlineFrame(aPresContext, aReflowInput, irs, frame, aStatus);
if (NS_INLINE_IS_BREAK(aStatus) ||
(!reflowingFirstLetter && NS_FRAME_IS_NOT_COMPLETE(aStatus))) {
(!reflowingFirstLetter && aStatus.IsIncomplete())) {
break;
}
irs.mPrevFrame = frame;

Просмотреть файл

@ -1293,7 +1293,7 @@ nsLineLayout::CanPlaceFrame(PerFrameData* pfd,
* For box-decoration-break:clone we apply the end margin on all
* continuations (that are not letter frames).
*/
if ((NS_FRAME_IS_NOT_COMPLETE(aStatus) ||
if ((aStatus.IsIncomplete() ||
pfd->mFrame->LastInFlow()->GetNextContinuation() ||
pfd->mFrame->FrameIsNonLastInIBSplit()) &&
!pfd->mIsLetterFrame &&

Просмотреть файл

@ -217,7 +217,7 @@ nsRubyFrame::ReflowSegment(nsPresContext* aPresContext,
// text containers paired with it.
return;
}
if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
if (aStatus.IsIncomplete()) {
// It always promise that if the status is incomplete, there is a
// break occurs. Break before has been processed above. However,
// it is possible that break after happens with the frame reflow

Просмотреть файл

@ -1942,7 +1942,7 @@ nsTableFrame::Reflow(nsPresContext* aPresContext,
ReflowTable(aDesiredSize, aReflowInput, aReflowInput.AvailableBSize(),
lastChildReflowed, aStatus);
if (lastChildReflowed && NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
if (lastChildReflowed && aStatus.IsIncomplete()) {
// if there is an incomplete child, then set the desired bsize
// to include it but not the next one
LogicalMargin borderPadding = GetChildAreaOffset(wm, &aReflowInput);
@ -3249,11 +3249,11 @@ nsTableFrame::ReflowChildren(TableReflowInput& aReflowInput,
// Remember where we just were in case we end up pushing children
prevKidFrame = kidFrame;
MOZ_ASSERT(!NS_FRAME_IS_NOT_COMPLETE(aStatus) || isPaginated,
MOZ_ASSERT(!aStatus.IsIncomplete() || isPaginated,
"Table contents should only fragment in paginated contexts");
// Special handling for incomplete children
if (isPaginated && NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
if (isPaginated && aStatus.IsIncomplete()) {
nsIFrame* kidNextInFlow = kidFrame->GetNextInFlow();
if (!kidNextInFlow) {
// The child doesn't have a next-in-flow so create a continuing

Просмотреть файл

@ -936,7 +936,7 @@ nsTableRowFrame::ReflowChildren(nsPresContext* aPresContext,
// 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 (NS_FRAME_IS_NOT_COMPLETE(status)) {
if (status.IsIncomplete()) {
aStatus = NS_FRAME_NOT_COMPLETE;
}
} else {

Просмотреть файл

@ -1184,7 +1184,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
oldRowVisualOverflow,
false);
if (NS_FRAME_IS_NOT_COMPLETE(aStatus)) {
if (aStatus.IsIncomplete()) {
// The row frame is incomplete and all of the rowspan 1 cells' block frames split
if ((rowMetrics.Height() <= rowReflowInput.AvailableHeight()) || isTopOfPage) {
// The row stays on this page because either it split ok or we're on the top of page.
@ -1323,7 +1323,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
aStatus = NS_FRAME_NOT_COMPLETE;
}
}
if (NS_FRAME_IS_NOT_COMPLETE(aStatus) && !contRow) {
if (aStatus.IsIncomplete() && !contRow) {
nsTableRowFrame* nextRow = lastRowThisPage->GetNextRow();
if (nextRow) {
PushChildren(nextRow, lastRowThisPage);