Bug 775624 Part 11 - Convert NS_MergeReflowStatusInto() to a method. r=dholbert

Also, remove NS_FRAME_TRUNCATED and NS_FRAME_REFLOW_NEXTINFLOW because both
are used only by NS_MergeReflowStatusInto().

MozReview-Commit-ID: LsPOji9j2e

--HG--
extra : rebase_source : 7cf1421c066f0f8df3e8402b84ae0f584cad2d11
This commit is contained in:
Ting-Yu Lin 2017-02-13 17:15:01 +08:00
Родитель a4633d568d
Коммит 19a2af3275
9 изменённых файлов: 29 добавлений и 32 удалений

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

@ -574,7 +574,7 @@ nsFieldSetFrame::Reflow(nsPresContext* aPresContext,
// Merge overflow container bounds and status.
aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
NS_MergeReflowStatusInto(&aStatus, ocStatus);
aStatus.MergeCompletionStatusFrom(ocStatus);
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus);

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

@ -151,7 +151,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
// See bug 154892. Not sure how to do it "right" yet; probably want
// to keep continuations within an nsAbsoluteContainingBlock eventually.
tracker.Insert(nextFrame, kidStatus);
NS_MergeReflowStatusInto(&reflowStatus, kidStatus);
reflowStatus.MergeCompletionStatusFrom(kidStatus);
}
else {
// Delete any continuations
@ -194,7 +194,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
if (reflowStatus.IsIncomplete())
reflowStatus.SetOverflowIncomplete();
NS_MergeReflowStatusInto(&aReflowStatus, reflowStatus);
aReflowStatus.MergeCompletionStatusFrom(reflowStatus);
}
static inline bool IsFixedPaddingSize(const nsStyleCoord& aCoord)

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

@ -1251,9 +1251,11 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
nsBlockFrame* nif = static_cast<nsBlockFrame*>(GetNextInFlow());
while (nif) {
if (nif->HasPushedFloatsFromPrevContinuation()) {
bool oc = nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER;
NS_MergeReflowStatusInto(&state.mReflowStatus,
oc ? NS_FRAME_OVERFLOW_INCOMPLETE : NS_FRAME_NOT_COMPLETE);
if (nif->GetStateBits() & NS_FRAME_IS_OVERFLOW_CONTAINER) {
state.mReflowStatus.SetOverflowIncomplete();
} else {
state.mReflowStatus.SetIncomplete();
}
break;
}
@ -1261,8 +1263,8 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext,
}
}
NS_MergeReflowStatusInto(&state.mReflowStatus, ocStatus);
NS_MergeReflowStatusInto(&state.mReflowStatus, fcStatus);
state.mReflowStatus.MergeCompletionStatusFrom(ocStatus);
state.mReflowStatus.MergeCompletionStatusFrom(fcStatus);
// If we end in a BR with clear and affected floats continue,
// we need to continue, too.
@ -3719,7 +3721,7 @@ nsBlockFrame::ReflowBlockFrame(BlockReflowInput& aState,
// Put it in our overflow list
aState.mOverflowTracker->Insert(nextFrame, frameReflowStatus);
NS_MergeReflowStatusInto(&aState.mReflowStatus, frameReflowStatus);
aState.mReflowStatus.MergeCompletionStatusFrom(frameReflowStatus);
#ifdef NOISY_BLOCK_DIR_MARGINS
ListTag(stdout);

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

@ -1108,7 +1108,7 @@ nsColumnSetFrame::Reflow(nsPresContext* aPresContext,
// Merge overflow container bounds and status.
aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
NS_MergeReflowStatusInto(&aStatus, ocStatus);
aStatus.MergeCompletionStatusFrom(ocStatus);
FinishReflowWithAbsoluteFrames(aPresContext, aDesiredSize, aReflowInput, aStatus, false);

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

@ -1309,7 +1309,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
tracker.Insert(nif, frameStatus);
}
NS_MergeReflowStatusInto(&aStatus, frameStatus);
aStatus.MergeCompletionStatusFrom(frameStatus);
// At this point it would be nice to assert !frame->GetOverflowRect().IsEmpty(),
// but we have some unsplittable frames that, when taller than
// availableHeight will push zero-height content into a next-in-flow.

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

@ -851,7 +851,9 @@ public:
NS_PRECONDITION(aChild, "null ptr");
if (aChild == mSentry) {
StepForward();
NS_MergeReflowStatusInto(&aReflowStatus, NS_FRAME_OVERFLOW_INCOMPLETE);
if (aReflowStatus.IsComplete()) {
aReflowStatus.SetOverflowIncomplete();
}
}
}

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

@ -379,17 +379,6 @@ nsIFrame::ContentStatesChanged(mozilla::EventStates aStates)
{
}
void
NS_MergeReflowStatusInto(nsReflowStatus* aPrimary, nsReflowStatus aSecondary)
{
*aPrimary |= aSecondary &
(NS_FRAME_NOT_COMPLETE | NS_FRAME_OVERFLOW_INCOMPLETE |
NS_FRAME_TRUNCATED | NS_FRAME_REFLOW_NEXTINFLOW);
if (*aPrimary & NS_FRAME_NOT_COMPLETE) {
*aPrimary &= ~NS_FRAME_OVERFLOW_INCOMPLETE;
}
}
void
nsWeakFrame::Init(nsIFrame* aFrame)
{

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

@ -5860,7 +5860,7 @@ nsGridContainerFrame::ReflowChildren(GridReflowInput& aState,
// Merge overflow container bounds and status.
aDesiredSize.mOverflowAreas.UnionWith(ocBounds);
NS_MergeReflowStatusInto(&aStatus, ocStatus);
aStatus.MergeCompletionStatusFrom(ocStatus);
if (IsAbsoluteContainer()) {
nsFrameList children(GetChildList(GetAbsoluteListID()));

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

@ -297,6 +297,18 @@ public:
void UpdateTruncated(const mozilla::ReflowInput& aReflowInput,
const mozilla::ReflowOutput& aMetrics);
// Merge the frame completion status bits from aStatus into this.
void MergeCompletionStatusFrom(const nsReflowStatus& aStatus)
{
mIncomplete |= aStatus.mIncomplete;
mOverflowIncomplete |= aStatus.mOverflowIncomplete;
mNextInFlowNeedsReflow |= aStatus.mNextInFlowNeedsReflow;
mTruncated |= aStatus.mTruncated;
if (mIncomplete) {
mOverflowIncomplete = false;
}
}
private:
uint32_t mStatus;
@ -309,7 +321,6 @@ private:
#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
// This bit is set, when a break is requested. This bit is orthogonal
@ -361,16 +372,9 @@ private:
((_completionStatus) | NS_INLINE_BREAK | NS_INLINE_BREAK_AFTER | \
NS_INLINE_MAKE_BREAK_TYPE(StyleClear::Line))
#define NS_FRAME_TRUNCATED 0x0010
#define NS_FRAME_SET_TRUNCATION(aStatus, aReflowInput, aMetrics) \
aStatus.UpdateTruncated(aReflowInput, aMetrics);
// Merge the incompleteness, truncation and NS_FRAME_REFLOW_NEXTINFLOW
// status from aSecondary into aPrimary.
void NS_MergeReflowStatusInto(nsReflowStatus* aPrimary,
nsReflowStatus aSecondary);
//----------------------------------------------------------------------
/**