mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-02-06 06:22:33 +00:00
Bug 874418: Assert that placeholders are reflowed before their out-of-flows. r=bz
This commit is contained in:
parent
2c39cbb922
commit
27947b9be3
@ -97,6 +97,33 @@ nsPlaceholderFrame::Reflow(nsPresContext* aPresContext,
|
||||
const nsHTMLReflowState& aReflowState,
|
||||
nsReflowStatus& aStatus)
|
||||
{
|
||||
#ifdef DEBUG
|
||||
// We should be getting reflowed before our out-of-flow.
|
||||
// If this is our first reflow, and our out-of-flow has already received its
|
||||
// first reflow (before us), complain.
|
||||
if ((GetStateBits() & NS_FRAME_FIRST_REFLOW) &&
|
||||
!(mOutOfFlowFrame->GetStateBits() & NS_FRAME_FIRST_REFLOW)) {
|
||||
|
||||
// Unfortunately, this can currently happen when the placeholder is in a
|
||||
// later continuation than its out-of-flow (as is the case in some unit
|
||||
// tests). So for now, in that case, we'll warn instead of asserting.
|
||||
bool isInContinuation = false;
|
||||
nsIFrame* ancestor = this;
|
||||
while ((ancestor = ancestor->GetParent())) {
|
||||
if (ancestor->GetPrevContinuation()) {
|
||||
isInContinuation = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
if (isInContinuation) {
|
||||
NS_WARNING("Out-of-flow frame got reflowed before its placeholder");
|
||||
} else {
|
||||
NS_ERROR("Out-of-flow frame got reflowed before its placeholder");
|
||||
}
|
||||
}
|
||||
#endif
|
||||
|
||||
DO_GLOBAL_REFLOW_COUNT("nsPlaceholderFrame");
|
||||
DISPLAY_REFLOW(aPresContext, this, aReflowState, aDesiredSize, aStatus);
|
||||
aDesiredSize.width = 0;
|
||||
|
Loading…
x
Reference in New Issue
Block a user