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()) if (aFloat->GetPrevInFlow())
floatMargin.BStart(wm) = 0; floatMargin.BStart(wm) = 0;
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus)) if (reflowStatus.IsIncomplete())
floatMargin.BEnd(wm) = 0; floatMargin.BEnd(wm) = 0;
// In the case that we're in columns and not splitting floats, we need // 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, nsFloatManager::CalculateRegionFor(wm, aFloat, floatMargin,
ContainerSize()); ContainerSize());
// if the float split, then take up all of the vertical height // 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())) { (NS_UNCONSTRAINEDSIZE != ContentBSize())) {
region.BSize(wm) = std::max(region.BSize(wm), region.BSize(wm) = std::max(region.BSize(wm),
ContentBSize() - floatPos.B(wm)); ContentBSize() - floatPos.B(wm));

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

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

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

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

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

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

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

@ -306,9 +306,6 @@ private:
#define NS_FRAME_IS_COMPLETE(status) \ #define NS_FRAME_IS_COMPLETE(status) \
(0 == ((status) & NS_FRAME_NOT_COMPLETE)) (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) \ #define NS_FRAME_OVERFLOW_IS_INCOMPLETE(status) \
(0 != ((status) & NS_FRAME_OVERFLOW_INCOMPLETE)) (0 != ((status) & NS_FRAME_OVERFLOW_INCOMPLETE))

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

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

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

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

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

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

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

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

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

@ -1184,7 +1184,7 @@ nsTableRowGroupFrame::SplitRowGroup(nsPresContext* aPresContext,
oldRowVisualOverflow, oldRowVisualOverflow,
false); 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 // The row frame is incomplete and all of the rowspan 1 cells' block frames split
if ((rowMetrics.Height() <= rowReflowInput.AvailableHeight()) || isTopOfPage) { 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. // 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; aStatus = NS_FRAME_NOT_COMPLETE;
} }
} }
if (NS_FRAME_IS_NOT_COMPLETE(aStatus) && !contRow) { if (aStatus.IsIncomplete() && !contRow) {
nsTableRowFrame* nextRow = lastRowThisPage->GetNextRow(); nsTableRowFrame* nextRow = lastRowThisPage->GetNextRow();
if (nextRow) { if (nextRow) {
PushChildren(nextRow, lastRowThisPage); PushChildren(nextRow, lastRowThisPage);