More robust handling of the overflow property, bug 315210 r/sr=roc

This commit is contained in:
bmlk%gmx.de 2005-11-11 05:30:31 +00:00
Родитель 2163d4caa2
Коммит ac3f79fa07
2 изменённых файлов: 11 добавлений и 18 удалений

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

@ -4268,6 +4268,7 @@ nsIFrame::GetOverflowAreaProperty(PRBool aCreateIfNecessary)
return overflow;
}
NS_NOTREACHED("Frame abuses NS_FRAME_OUTSIDE_CHILDREN flag");
return nsnull;
}

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

@ -847,11 +847,10 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
nsRect rect(nsPoint(0, 0), GetSize());
if (ComputesOwnOverflowArea()) {
if (GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
nsRect* overflow = GetOverflowAreaProperty();
NS_ASSERTION(overflow, "should have overflow area property");
nsRect* overflow = GetOverflowAreaProperty();
if (overflow)
rect = *overflow;
}
} else {
if (!DoesClipChildren()) {
// See if our child frames caused us to overflow after being laid
@ -861,21 +860,14 @@ nsBox::SyncLayout(nsBoxLayoutState& aState)
// frames in HTML inside XUL).
nsIFrame* box;
GetChildBox(&box);
while (box)
{
nsRect bounds;
if (box->GetStateBits() & NS_FRAME_OUTSIDE_CHILDREN) {
nsRect* overflowArea = box->GetOverflowAreaProperty();
NS_ASSERTION(overflowArea,
"Should have created property for overflowing frame");
bounds = *overflowArea + box->GetPosition();
} else {
bounds = box->GetRect();
}
rect.UnionRect(rect, bounds);
while (box) {
nsRect* overflowArea = box->GetOverflowAreaProperty();
nsRect bounds = overflowArea ? *overflowArea + box->GetPosition() :
bounds = box->GetRect();
rect.UnionRect(rect, bounds);
box->GetNextBox(&box);
}
box->GetNextBox(&box);
}
}
const nsStyleDisplay* disp = GetStyleDisplay();