support for Nav4 compatibility -- auto-width cells with 0-width content are 1 pixel wide

This commit is contained in:
buster
1998-06-26 23:31:33 +00:00
parent 30333abc30
commit 1272ec01e8
6 changed files with 64 additions and 10 deletions

View File

@@ -367,6 +367,25 @@ NS_METHOD nsTableCellFrame::Reflow(nsIPresContext* aPresContext,
cellWidth = kidSize.width; // at this point, we've factored in the cell's style attributes
if (NS_UNCONSTRAINEDSIZE!=cellWidth)
cellWidth += leftInset + rightInset;
// Nav4 hack for 0 width cells. If the cell has any content, it must have a desired width of at least 1
if (0==cellWidth)
{
PRInt32 childCount;
mFirstChild->ChildCount(childCount);
if (0!=childCount)
{
nsIFrame *grandChild;
mFirstChild->FirstChild(grandChild);
grandChild->ChildCount(childCount);
if (0!=childCount)
{
cellWidth=1;
if (nsnull!=aDesiredSize.maxElementSize && 0==pMaxElementSize->width)
pMaxElementSize->width=1;
}
}
}
// end Nav4 hack for 0 width cells
// set the cell's desired size and max element size
aDesiredSize.width = cellWidth;