зеркало из https://github.com/mozilla/gecko-dev.git
Bug 398332. Merge reflow statuses from out-of-flow frames more carefully so that we don't lose information about the primary reflow. r=fantasai,r+sr=dbaron,a=shaver
This commit is contained in:
Родитель
ceacb00c81
Коммит
d8e8b9dda2
|
@ -181,7 +181,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);
|
||||
reflowStatus = NS_FRAME_MERGE_INCOMPLETE(reflowStatus, kidStatus);
|
||||
NS_MergeReflowStatusInto(&reflowStatus, kidStatus);
|
||||
}
|
||||
else {
|
||||
// Delete any continuations
|
||||
|
@ -205,7 +205,7 @@ nsAbsoluteContainingBlock::Reflow(nsContainerFrame* aDelegatingFrame,
|
|||
if (NS_FRAME_IS_NOT_COMPLETE(reflowStatus))
|
||||
NS_FRAME_SET_OVERFLOW_INCOMPLETE(reflowStatus);
|
||||
|
||||
aReflowStatus = NS_FRAME_MERGE_INCOMPLETE(reflowStatus, aReflowStatus);
|
||||
NS_MergeReflowStatusInto(&aReflowStatus, reflowStatus);
|
||||
return NS_OK;
|
||||
}
|
||||
|
||||
|
|
|
@ -3132,8 +3132,7 @@ nsBlockFrame::ReflowBlockFrame(nsBlockReflowState& aState,
|
|||
|
||||
// Put it in our overflow list
|
||||
aState.mOverflowTracker.Insert(nextFrame, frameReflowStatus);
|
||||
aState.mReflowStatus = NS_FRAME_MERGE_INCOMPLETE(frameReflowStatus,
|
||||
aState.mReflowStatus);
|
||||
NS_MergeReflowStatusInto(&aState.mReflowStatus, frameReflowStatus);
|
||||
|
||||
#ifdef NOISY_VERTICAL_MARGINS
|
||||
ListTag(stdout);
|
||||
|
|
|
@ -1010,7 +1010,7 @@ nsContainerFrame::ReflowOverflowContainerChildren(nsPresContext* aPres
|
|||
|
||||
tracker.Insert(nif, frameStatus);
|
||||
}
|
||||
aStatus = NS_FRAME_MERGE_INCOMPLETE(aStatus, frameStatus);
|
||||
NS_MergeReflowStatusInto(&aStatus, 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.
|
||||
|
|
|
@ -525,8 +525,7 @@ public:
|
|||
NS_PRECONDITION(aChild, "null ptr");
|
||||
if (aChild == mSentry) {
|
||||
StepForward();
|
||||
aReflowStatus = NS_FRAME_MERGE_INCOMPLETE(aReflowStatus,
|
||||
NS_FRAME_OVERFLOW_INCOMPLETE);
|
||||
NS_MergeReflowStatusInto(&aReflowStatus, NS_FRAME_OVERFLOW_INCOMPLETE);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -279,6 +279,17 @@ nsIFrameDebug::RootFrameList(nsPresContext* aPresContext, FILE* out, PRInt32 aIn
|
|||
#endif
|
||||
// end nsIFrameDebug
|
||||
|
||||
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)
|
||||
{
|
||||
|
|
|
@ -316,7 +316,7 @@ enum nsSpread {
|
|||
* frame. See nsContainerFrame.h for more information.
|
||||
* This bit is mutually exclusive with NS_FRAME_NOT_COMPLETE.
|
||||
*
|
||||
* Please use the SET and MERGE macros below for handling
|
||||
* Please use the SET macro for handling
|
||||
* NS_FRAME_NOT_COMPLETE and NS_FRAME_OVERFLOW_INCOMPLETE.
|
||||
*
|
||||
* NS_FRAME_REFLOW_NEXTINFLOW bit flag means that the next-in-flow is
|
||||
|
@ -358,15 +358,6 @@ typedef PRUint32 nsReflowStatus;
|
|||
#define NS_FRAME_SET_OVERFLOW_INCOMPLETE(status) \
|
||||
status = status & ~NS_FRAME_NOT_COMPLETE | NS_FRAME_OVERFLOW_INCOMPLETE
|
||||
|
||||
// Combines two statuses and returns the most severe bits of the pair
|
||||
#define NS_FRAME_MERGE_INCOMPLETE(status1, status2) \
|
||||
( (NS_FRAME_REFLOW_NEXTINFLOW & (status1 | status2)) \
|
||||
| ( (NS_FRAME_NOT_COMPLETE & (status1 | status2)) \
|
||||
? NS_FRAME_NOT_COMPLETE \
|
||||
: NS_FRAME_OVERFLOW_INCOMPLETE & (status1 | status2) \
|
||||
) \
|
||||
)
|
||||
|
||||
// This macro tests to see if an nsReflowStatus is an error value
|
||||
// or just a regular return value
|
||||
#define NS_IS_REFLOW_ERROR(_status) (PRInt32(_status) < 0)
|
||||
|
@ -429,6 +420,11 @@ typedef PRUint32 nsReflowStatus;
|
|||
#define NS_FRAME_SET_TRUNCATION(status, aReflowState, aMetrics) \
|
||||
aReflowState.SetTruncated(aMetrics, &status);
|
||||
|
||||
// Merge the incompleteness, truncation and NS_FRAME_REFLOW_NEXTINFLOW
|
||||
// status from aSecondary into aPrimary.
|
||||
void NS_MergeReflowStatusInto(nsReflowStatus* aPrimary,
|
||||
nsReflowStatus aSecondary);
|
||||
|
||||
//----------------------------------------------------------------------
|
||||
|
||||
/**
|
||||
|
|
Загрузка…
Ссылка в новой задаче