Bug 775624 Part 8 - Remove NS_FRAME_SET_OVERFLOW_INCOMPLETE. 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_SET_OVERFLOW_INCOMPLETE\(\*([a-zA-Z0-9.*]*)\)" "\1->SetOverflowIncomplete()"
rename "NS_FRAME_SET_OVERFLOW_INCOMPLETE\(([a-zA-Z0-9.*]*)\)" "\1.SetOverflowIncomplete()"
MozReview-Commit-ID: EJOIs84vwev
--- a/layout/generic/BlockReflowInput.cpp
+++ b/layout/generic/BlockReflowInput.cpp
@@ -1048,17 +1048,17 @@ BlockReflowInput::PushFloatPastBreak(nsI
FloatManager()->SetPushedRightFloatPastBreak();
}
// Put the float on the pushed floats list, even though it
// isn't actually a continuation.
DebugOnly<nsresult> rv = mBlock->StealFrame(aFloat);
NS_ASSERTION(NS_SUCCEEDED(rv), "StealFrame should succeed");
AppendPushedFloatChain(aFloat);
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(mReflowStatus);
+ mReflowStatus.SetOverflowIncomplete();
}
/**
* Place below-current-line floats.
*/
void
BlockReflowInput::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList,
nsLineBox* aLine)
--- a/layout/generic/nsAbsoluteContainingBlock.cpp
+++ b/layout/generic/nsAbsoluteContainingBlock.cpp
@@ -187,17 +187,17 @@ nsAbsoluteContainingBlock::Reflow(nsCont
kidFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
}
}
}
// Abspos frames can't cause their parent to be incomplete,
// only overflow incomplete.
if (reflowStatus.IsIncomplete())
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(reflowStatus);
+ reflowStatus.SetOverflowIncomplete();
NS_MergeReflowStatusInto(&aReflowStatus, reflowStatus);
}
static inline bool IsFixedPaddingSize(const nsStyleCoord& aCoord)
{ return aCoord.ConvertsToLength(); }
static inline bool IsFixedMarginSize(const nsStyleCoord& aCoord)
{ return aCoord.ConvertsToLength(); }
--- a/layout/generic/nsBlockFrame.cpp
+++ b/layout/generic/nsBlockFrame.cpp
@@ -1658,17 +1658,17 @@ nsBlockFrame::ComputeFinalSize(const Ref
}
if (IS_TRUE_OVERFLOW_CONTAINER(this)) {
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,
"overflow containers must be zero-block-size");
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(aState.mReflowStatus);
+ aState.mReflowStatus.SetOverflowIncomplete();
}
} else if (aReflowInput.AvailableBSize() != NS_UNCONSTRAINEDSIZE &&
!NS_INLINE_IS_BREAK_BEFORE(aState.mReflowStatus) &&
aState.mReflowStatus.IsComplete()) {
// Currently only used for grid items, but could be used in other contexts.
// The FragStretchBSizeProperty is our expected non-fragmented block-size
// we should stretch to (for align-self:stretch etc). In some fragmentation
// cases though, the last fragment (this frame since we're complete), needs
@@ -2571,17 +2571,17 @@ nsBlockFrame::ReflowDirtyLines(BlockRefl
skipPull=true;
}
}
}
if (skipPull && aState.mNextInFlow) {
NS_ASSERTION(heightConstrained, "Height should be constrained here\n");
if (IS_TRUE_OVERFLOW_CONTAINER(aState.mNextInFlow))
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(aState.mReflowStatus);
+ aState.mReflowStatus.SetOverflowIncomplete();
else
aState.mReflowStatus.SetIncomplete();
}
if (!skipPull && aState.mNextInFlow) {
// Pull data from a next-in-flow if there's still room for more
// content here.
while (keepGoing && aState.mNextInFlow) {
@@ -4319,17 +4319,17 @@ nsBlockFrame::SplitFloat(BlockReflowInpu
if (floatStyle == StyleFloat::Left) {
aState.FloatManager()->SetSplitLeftFloatAcrossBreak();
} else {
MOZ_ASSERT(floatStyle == StyleFloat::Right, "Unexpected float side!");
aState.FloatManager()->SetSplitRightFloatAcrossBreak();
}
aState.AppendPushedFloatChain(nextInFlow);
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(aState.mReflowStatus);
+ aState.mReflowStatus.SetOverflowIncomplete();
return NS_OK;
}
static nsFloatCache*
GetLastFloat(nsLineBox* aLine)
{
nsFloatCache* fc = aLine->GetFirstFloat();
while (fc && fc->Next()) {
@@ -7408,17 +7408,17 @@ nsBlockFrame::ComputeFinalBSize(const Re
computedBSizeLeftOver),
aBorderPadding.BEnd(wm));
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?
// XXXmats and why exclude the case when our size == AvailableBSize?
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(*aStatus);
+ aStatus->SetOverflowIncomplete();
}
if (aStatus->IsComplete()) {
if (computedBSizeLeftOver > 0 &&
NS_UNCONSTRAINEDSIZE != aReflowInput.AvailableBSize() &&
aFinalSize.BSize(wm) > aReflowInput.AvailableBSize()) {
if (ShouldAvoidBreakInside(aReflowInput)) {
*aStatus = NS_INLINE_LINE_BREAK_BEFORE();
--- a/layout/generic/nsContainerFrame.cpp
+++ b/layout/generic/nsContainerFrame.cpp
@@ -1279,17 +1279,17 @@ nsContainerFrame::ReflowOverflowContaine
FinishReflowChild(frame, aPresContext, desiredSize, &frameState,
wm, pos, containerSize, aFlags);
// Handle continuations
if (!frameStatus.IsFullyComplete()) {
if (frame->GetStateBits() & NS_FRAME_OUT_OF_FLOW) {
// Abspos frames can't cause their parent to be incomplete,
// only overflow incomplete.
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(frameStatus);
+ frameStatus.SetOverflowIncomplete();
}
else {
NS_ASSERTION(frameStatus.IsComplete(),
"overflow container frames can't be incomplete, only overflow-incomplete");
}
// Acquire a next-in-flow, creating it if necessary
nsIFrame* nif = frame->GetNextInFlow();
--- a/layout/generic/nsGridContainerFrame.cpp
+++ b/layout/generic/nsGridContainerFrame.cpp
@@ -5512,17 +5512,17 @@ nsGridContainerFrame::ReflowInFragmentai
bSize = ClampToCSSMaxBSize(bEndRow, aState.mReflowInput, &aStatus);
}
}
// If we can't fit all rows then we're at least overflow-incomplete.
if (endRow < numRows) {
childAvailableSize = bEndRow;
if (aStatus.IsComplete()) {
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(aStatus);
+ aStatus.SetOverflowIncomplete();
aStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
}
} else {
// Children always have the full size of the rows in this fragment.
childAvailableSize = std::max(childAvailableSize, bEndRow);
}
return ReflowRowsInFragmentainer(aState, aContentArea, aDesiredSize, aStatus,
@@ -5698,17 +5698,17 @@ nsGridContainerFrame::ReflowRowsInFragme
aState.mSharedGridData->mRows.BreakBeforeRow(aEndRow);
}
}
if (!pushedItems.IsEmpty() ||
!incompleteItems.IsEmpty() ||
!overflowIncompleteItems.IsEmpty()) {
if (aStatus.IsComplete()) {
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(aStatus);
+ aStatus.SetOverflowIncomplete();
aStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
}
// Iterate the children in normal document order and append them (or a NIF)
// to one of the following frame lists according to their status.
nsFrameList pushedList;
nsFrameList incompleteList;
nsFrameList overflowIncompleteList;
auto* pc = PresContext();
@@ -6168,17 +6168,17 @@ nsGridContainerFrame::Reflow(nsPresConte
bSize + bp.BStartEnd(wm));
aDesiredSize.SetSize(wm, desiredSize);
nsRect frameRect(0, 0, aDesiredSize.Width(), aDesiredSize.Height());
aDesiredSize.mOverflowAreas.UnionAllWith(frameRect);
// Convert INCOMPLETE -> OVERFLOW_INCOMPLETE and zero bsize if we're an OC.
if (HasAnyStateBits(NS_FRAME_IS_OVERFLOW_CONTAINER)) {
if (!aStatus.IsComplete()) {
- NS_FRAME_SET_OVERFLOW_INCOMPLETE(aStatus);
+ aStatus.SetOverflowIncomplete();
aStatus |= NS_FRAME_REFLOW_NEXTINFLOW;
}
bSize = 0;
desiredSize.BSize(wm) = bSize + bp.BStartEnd(wm);
aDesiredSize.SetSize(wm, desiredSize);
}
if (!gridReflowInput.mInFragmentainer) {
--- a/layout/generic/nsIFrame.h
+++ b/layout/generic/nsIFrame.h
@@ -298,21 +298,16 @@ private:
bool mOverflowIncomplete : 1;
};
#define NS_FRAME_COMPLETE 0 // Note: not a bit!
#define NS_FRAME_NOT_COMPLETE 0x1
#define NS_FRAME_REFLOW_NEXTINFLOW 0x2
#define NS_FRAME_OVERFLOW_INCOMPLETE 0x4
-// These macros set or switch incomplete statuses without touching the
-// NS_FRAME_REFLOW_NEXTINFLOW bit.
-#define NS_FRAME_SET_OVERFLOW_INCOMPLETE(status) \
- status = (status & ~NS_FRAME_NOT_COMPLETE) | NS_FRAME_OVERFLOW_INCOMPLETE
-
// This bit is set, when a break is requested. This bit is orthogonal
// to the nsIFrame::nsReflowStatus completion bits.
#define NS_INLINE_BREAK 0x0100
// When a break is requested, this bit when set indicates that the
// break should occur after the frame just reflowed; when the bit is
// clear the break should occur before the frame just reflowed.
#define NS_INLINE_BREAK_BEFORE 0x0000