Bug 385823 - Let us call NotifyPercentHeight even when computed height is already set, because it'll be set on imageFrames. r+sr=dbaron, a=beltzner

This commit is contained in:
dholbert@cs.stanford.edu 2007-11-06 14:47:29 -08:00
parent 6c93fa8fe6
commit bfeb48e02e
2 changed files with 14 additions and 11 deletions

View File

@ -3160,14 +3160,11 @@ nsFrame::DidReflow(nsPresContext* aPresContext,
NS_FRAME_HAS_DIRTY_CHILDREN);
}
// Notify the percent height observer if there is a percent height
// but no computed height. The observer may be able to initiate
// another reflow with a computed height. This happens in the case
// where a table cell has no computed height but can fabricate one
// when the cell height is known.
// Notify the percent height observer if there is a percent height.
// The observer may be able to initiate another reflow with a computed
// height. This happens in the case where a table cell has no computed
// height but can fabricate one when the cell height is known.
if (aReflowState && aReflowState->mPercentHeightObserver &&
((NS_UNCONSTRAINEDSIZE == aReflowState->ComputedHeight()) || // no computed height
(0 == aReflowState->ComputedHeight())) &&
(eStyleUnit_Percent == aReflowState->mStylePosition->mHeight.GetUnit())) {
nsIFrame* prevInFlow = GetPrevInFlow();

View File

@ -835,10 +835,16 @@ NS_METHOD nsTableCellFrame::Reflow(nsPresContext* aPresContext,
nsHTMLReflowState kidReflowState(aPresContext, aReflowState, firstKid,
availSize);
// mIPercentHeightObserver is for children of cells in quirks mode,
// but only those than are tables in standards mode. NeedsToObserve
// will determine how far this is propagated to descendants.
kidReflowState.mPercentHeightObserver = this;
// Don't be a percent height observer if we're in the middle of
// special-height reflow, in case we get an accidental NotifyPercentHeight()
// call (which we shouldn't honor during special-height reflow)
if (!aReflowState.mFlags.mSpecialHeightReflow) {
// mPercentHeightObserver is for children of cells in quirks mode,
// but only those than are tables in standards mode. NeedsToObserve
// will determine how far this is propagated to descendants.
kidReflowState.mPercentHeightObserver = this;
}
// Don't propagate special height reflow state to our kids
kidReflowState.mFlags.mSpecialHeightReflow = PR_FALSE;