work in progress for table visibility=collapse
This commit is contained in:
@@ -4949,3 +4949,9 @@ nsTableFrame::GetRowGroupFrameFor(nsIFrame* aFrame, const nsStyleDisplay* aDispl
|
||||
return (nsTableRowGroupFrame*)result;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsTableFrame::IsFinalPass(const nsReflowState& aState)
|
||||
{
|
||||
return (NS_UNCONSTRAINEDSIZE != aState.availableWidth) ||
|
||||
(NS_UNCONSTRAINEDSIZE != aState.availableHeight);
|
||||
}
|
||||
|
||||
@@ -402,6 +402,8 @@ public:
|
||||
|
||||
virtual void AddColumnFrame (nsTableColFrame *aColFrame);
|
||||
|
||||
static PRBool IsFinalPass(const nsReflowState& aReflowState);
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
||||
@@ -63,7 +63,6 @@ struct RowReflowState {
|
||||
|
||||
nsTableFrame *tableFrame;
|
||||
|
||||
|
||||
RowReflowState(const nsHTMLReflowState& aReflowState,
|
||||
nsTableFrame* aTableFrame)
|
||||
: reflowState(aReflowState)
|
||||
@@ -1417,6 +1416,17 @@ nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
|
||||
break;
|
||||
}
|
||||
|
||||
// check the visibility in the final pass. If it is collapse, set our desired size to 0
|
||||
if (nsTableFrame::IsFinalPass(aReflowState)) {
|
||||
const nsStyleDisplay *display;
|
||||
GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
|
||||
if (NS_STYLE_VISIBILITY_COLLAPSE == display->mVisible) {
|
||||
aDesiredSize.width = 0;
|
||||
aDesiredSize.height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// XXX TROY
|
||||
#if 0
|
||||
aStatus = NS_FRAME_COMPLETE; // we're never continued
|
||||
|
||||
@@ -643,7 +643,8 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
|
||||
{
|
||||
const nsStyleDisplay *childDisplay;
|
||||
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
|
||||
if ((NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay) &&
|
||||
(NS_STYLE_VISIBILITY_COLLAPSE != childDisplay->mVisible))
|
||||
{
|
||||
// get the height of the tallest cell in the row (excluding cells that span rows)
|
||||
nscoord maxCellHeight = ((nsTableRowFrame*)rowFrame)->GetTallestChild();
|
||||
@@ -1030,6 +1031,16 @@ nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// check the visibility in the final pass. If it is collapse, set our desired size to 0
|
||||
if (nsTableFrame::IsFinalPass(aReflowState)) {
|
||||
const nsStyleDisplay *display;
|
||||
GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
|
||||
if (NS_STYLE_VISIBILITY_COLLAPSE == display->mVisible) {
|
||||
aDesiredSize.width = 0;
|
||||
aDesiredSize.height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gsDebug==PR_TRUE)
|
||||
{
|
||||
if (nsnull!=aDesiredSize.maxElementSize)
|
||||
|
||||
@@ -4949,3 +4949,9 @@ nsTableFrame::GetRowGroupFrameFor(nsIFrame* aFrame, const nsStyleDisplay* aDispl
|
||||
return (nsTableRowGroupFrame*)result;
|
||||
}
|
||||
|
||||
PRBool
|
||||
nsTableFrame::IsFinalPass(const nsReflowState& aState)
|
||||
{
|
||||
return (NS_UNCONSTRAINEDSIZE != aState.availableWidth) ||
|
||||
(NS_UNCONSTRAINEDSIZE != aState.availableHeight);
|
||||
}
|
||||
|
||||
@@ -402,6 +402,8 @@ public:
|
||||
|
||||
virtual void AddColumnFrame (nsTableColFrame *aColFrame);
|
||||
|
||||
static PRBool IsFinalPass(const nsReflowState& aReflowState);
|
||||
|
||||
protected:
|
||||
|
||||
/** protected constructor.
|
||||
|
||||
@@ -63,7 +63,6 @@ struct RowReflowState {
|
||||
|
||||
nsTableFrame *tableFrame;
|
||||
|
||||
|
||||
RowReflowState(const nsHTMLReflowState& aReflowState,
|
||||
nsTableFrame* aTableFrame)
|
||||
: reflowState(aReflowState)
|
||||
@@ -1417,6 +1416,17 @@ nsTableRowFrame::Reflow(nsIPresContext& aPresContext,
|
||||
break;
|
||||
}
|
||||
|
||||
// check the visibility in the final pass. If it is collapse, set our desired size to 0
|
||||
if (nsTableFrame::IsFinalPass(aReflowState)) {
|
||||
const nsStyleDisplay *display;
|
||||
GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
|
||||
if (NS_STYLE_VISIBILITY_COLLAPSE == display->mVisible) {
|
||||
aDesiredSize.width = 0;
|
||||
aDesiredSize.height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
// XXX TROY
|
||||
#if 0
|
||||
aStatus = NS_FRAME_COMPLETE; // we're never continued
|
||||
|
||||
@@ -643,7 +643,8 @@ void nsTableRowGroupFrame::CalculateRowHeights(nsIPresContext& aPresContext,
|
||||
{
|
||||
const nsStyleDisplay *childDisplay;
|
||||
rowFrame->GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)childDisplay));
|
||||
if (NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay)
|
||||
if ((NS_STYLE_DISPLAY_TABLE_ROW == childDisplay->mDisplay) &&
|
||||
(NS_STYLE_VISIBILITY_COLLAPSE != childDisplay->mVisible))
|
||||
{
|
||||
// get the height of the tallest cell in the row (excluding cells that span rows)
|
||||
nscoord maxCellHeight = ((nsTableRowFrame*)rowFrame)->GetTallestChild();
|
||||
@@ -1030,6 +1031,16 @@ nsTableRowGroupFrame::Reflow(nsIPresContext& aPresContext,
|
||||
}
|
||||
}
|
||||
|
||||
// check the visibility in the final pass. If it is collapse, set our desired size to 0
|
||||
if (nsTableFrame::IsFinalPass(aReflowState)) {
|
||||
const nsStyleDisplay *display;
|
||||
GetStyleData(eStyleStruct_Display, ((const nsStyleStruct *&)display));
|
||||
if (NS_STYLE_VISIBILITY_COLLAPSE == display->mVisible) {
|
||||
aDesiredSize.width = 0;
|
||||
aDesiredSize.height = 0;
|
||||
}
|
||||
}
|
||||
|
||||
if (gsDebug==PR_TRUE)
|
||||
{
|
||||
if (nsnull!=aDesiredSize.maxElementSize)
|
||||
|
||||
Reference in New Issue
Block a user