bug 88524 - don't skip the reflow of the inner table if it is pct height. sr=timeout, r=alexsavulov

This commit is contained in:
karnaze%netscape.com 2001-08-06 14:23:50 +00:00
Родитель 0a1340f34e
Коммит b275f456fe
2 изменённых файлов: 36 добавлений и 4 удалений

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

@ -1428,7 +1428,22 @@ PRBool nsTableOuterFrame::IR_CaptionChangedAxis(const nsStyleTable* aOldStyle,
}
static PRBool
IsPctHeight(nsIFrame* aFrame)
{
if (aFrame) {
nsCOMPtr<nsIStyleContext> styleContext;
aFrame->GetStyleContext(getter_AddRefs(styleContext));
nsStylePosition* position = (nsStylePosition*)styleContext->GetStyleData(eStyleStruct_Position);
if (eStyleUnit_Percent == position->mHeight.GetUnit()) {
float percent = position->mHeight.GetPercentValue();
if (percent > 0.0f) {
return PR_TRUE;
}
}
}
return PR_FALSE;
}
/**
* Reflow is a multi-step process.
@ -1472,7 +1487,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
if ((eReflowReason_Resize == aOuterRS.reason) &&
(aOuterRS.availableWidth == mPriorAvailWidth) &&
!isPaginated) {
!isPaginated &&
!::IsPctHeight(mInnerTableFrame)) {
// don't do much if we are resize reflowed exactly like last time
aDesiredSize.width = mRect.width;
aDesiredSize.height = mRect.height;

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

@ -1428,7 +1428,22 @@ PRBool nsTableOuterFrame::IR_CaptionChangedAxis(const nsStyleTable* aOldStyle,
}
static PRBool
IsPctHeight(nsIFrame* aFrame)
{
if (aFrame) {
nsCOMPtr<nsIStyleContext> styleContext;
aFrame->GetStyleContext(getter_AddRefs(styleContext));
nsStylePosition* position = (nsStylePosition*)styleContext->GetStyleData(eStyleStruct_Position);
if (eStyleUnit_Percent == position->mHeight.GetUnit()) {
float percent = position->mHeight.GetPercentValue();
if (percent > 0.0f) {
return PR_TRUE;
}
}
}
return PR_FALSE;
}
/**
* Reflow is a multi-step process.
@ -1472,7 +1487,8 @@ NS_METHOD nsTableOuterFrame::Reflow(nsIPresContext* aPresContext,
if ((eReflowReason_Resize == aOuterRS.reason) &&
(aOuterRS.availableWidth == mPriorAvailWidth) &&
!isPaginated) {
!isPaginated &&
!::IsPctHeight(mInnerTableFrame)) {
// don't do much if we are resize reflowed exactly like last time
aDesiredSize.width = mRect.width;
aDesiredSize.height = mRect.height;