diff --git a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp index ad35c59367d..d9e19b8781d 100644 --- a/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/html/table/src/BasicTableLayoutStrategy.cpp @@ -461,7 +461,7 @@ PRBool BasicTableLayoutStrategy::AssignPreliminaryColumnWidths() if (effectiveMinColumnWidth>specifiedFixedColWidth) specifiedFixedColWidth=effectiveMinColumnWidth; // do all the global bookkeeping, factoring in margins - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); // keep a running total of the amount of space taken up by all fixed-width columns if ((PR_TRUE==haveColWidth) && (nsTableColFrame::eWIDTH_SOURCE_CELL==colFrame->GetWidthSource())) { @@ -715,7 +715,7 @@ void BasicTableLayoutStrategy::SetMinAndMaxTableWidths() if (gsDebug) printf("SetMinAndMaxTableWidths\n"); PRInt32 colIndex, rowIndex; PRInt32 numRows = mTableFrame->GetRowCount(); - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); for (rowIndex = 0; rowIndexGetRowCount(); - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); PRInt32 colIndex; for (colIndex = 0; colIndexGetRowCount(); - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); for (PRInt32 colIndex = 0; colIndexCalcBorderPaddingFor(this, borderPadding); + const nsStyleSpacing* cellSpacingStyle; + GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacingStyle)); + cellSpacingStyle->CalcBorderPaddingFor(this, borderPadding); nscoord contentWidth = mPass1DesiredSize.width - (borderPadding.left+borderPadding.right); nscoord contentHeight = mPass1DesiredSize.height - (borderPadding.top+borderPadding.bottom); // empty cells do not render their border @@ -554,7 +554,8 @@ void nsTableCellFrame::MapBorderMarginPadding(nsIPresContext* aPresContext) return; nscoord padding = tableFrame->GetCellPadding(); - nscoord spacing = tableFrame->GetCellSpacing(); + nscoord spacingX = tableFrame->GetCellSpacingX(); + nscoord spacingY = tableFrame->GetCellSpacingY(); nscoord border = 1; @@ -565,10 +566,10 @@ void nsTableCellFrame::MapBorderMarginPadding(nsIPresContext* aPresContext) tableFrame->GetStyleData(eStyleStruct_Spacing,(const nsStyleStruct *&)tableSpacingStyle); nsStyleSpacing* spacingData = (nsStyleSpacing*)mStyleContext->GetMutableStyleData(eStyleStruct_Spacing); - spacingData->mMargin.SetTop(spacing); - spacingData->mMargin.SetLeft(spacing); - spacingData->mMargin.SetBottom(spacing); - spacingData->mMargin.SetRight(spacing); + spacingData->mMargin.SetTop(spacingY); + spacingData->mMargin.SetLeft(spacingX); + spacingData->mMargin.SetBottom(spacingY); + spacingData->mMargin.SetRight(spacingX); spacingData->mPadding.SetTop(padding); spacingData->mPadding.SetLeft(padding); spacingData->mPadding.SetBottom(padding); diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index ce53da0c124..bf18ff472bd 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -285,7 +285,8 @@ nsTableFrame::nsTableFrame() nsCRT::memset (mColumnWidths, 0, mColumnWidthsLength*sizeof(PRInt32)); mCellMap = new nsCellMap(0, 0); mColGroups=nsnull; - mDefaultCellSpacing=0; + mDefaultCellSpacingX=0; + mDefaultCellSpacingY=0; mDefaultCellPadding=0; } @@ -296,7 +297,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext, nsIStyleContext* aContext) { float p2t = aPresContext.GetPixelsToTwips(); - mDefaultCellSpacing = NSIntPixelsToTwips(2, p2t); + mDefaultCellSpacingX = NSIntPixelsToTwips(2, p2t); + mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t); mDefaultCellPadding = NSIntPixelsToTwips(1, p2t); return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext); @@ -2396,7 +2398,7 @@ void nsTableFrame::PlaceChild(nsIPresContext& aPresContext, const nsStyleSpacing* tableSpacing; GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)tableSpacing)); tableSpacing->CalcBorderPaddingFor(this, borderPadding); - nscoord cellSpacing = GetCellSpacing(); + nscoord cellSpacing = GetCellSpacingX(); nscoord kidWidth = aKidMaxElementSize.width + borderPadding.left + borderPadding.right + cellSpacing*2; aMaxElementSize->width = PR_MAX(aMaxElementSize->width, kidWidth); aMaxElementSize->height += aKidMaxElementSize.height; @@ -2783,7 +2785,7 @@ void nsTableFrame::SetTableWidth(nsIPresContext& aPresContext) NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); NS_ASSERTION(nsnull!=mCellMap, "never ever call me until the cell map is built!"); - nscoord cellSpacing = GetCellSpacing(); + nscoord cellSpacing = GetCellSpacingX(); if (gsDebug==PR_TRUE) printf ("SetTableWidth with cellSpacing = %d ", cellSpacing); PRInt32 tableWidth = cellSpacing; @@ -3595,26 +3597,56 @@ NS_METHOD nsTableFrame::GetCellMarginData(nsTableCellFrame* aKidFrame, nsMargin& return result; } -// XXX: could cache this. But be sure to check style changes if you do! -nscoord nsTableFrame::GetCellSpacing() +PRUint8 nsTableFrame::GetBorderCollapseStyle() +{ + const nsStyleTable* tableStyle; + GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); + return tableStyle->mBorderCollapse; +} + + +// XXX: could cache this. But be sure to check style changes if you do! +nscoord nsTableFrame::GetCellSpacingX() { - nsTableFrame* tableFrame = this; const nsStyleTable* tableStyle; GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); nscoord cellSpacing = 0; - if (tableStyle->mCellSpacing.GetUnit() == eStyleUnit_Coord) { - cellSpacing = tableStyle->mCellSpacing.GetCoordValue(); - } - else { - cellSpacing = mDefaultCellSpacing; + PRUint8 borderCollapseStyle = GetBorderCollapseStyle(); + if (NS_STYLE_TABLE_BORDER_COLLAPSE_COLLAPSE!=borderCollapseStyle) + { + if (tableStyle->mBorderSpacingX.GetUnit() == eStyleUnit_Coord) { + cellSpacing = tableStyle->mBorderSpacingX.GetCoordValue(); + } + else { + cellSpacing = mDefaultCellSpacingX; + } } return cellSpacing; } +// XXX: could cache this. But be sure to check style changes if you do! +nscoord nsTableFrame::GetCellSpacingY() +{ + const nsStyleTable* tableStyle; + GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); + nscoord cellSpacing = 0; + PRUint8 borderCollapseStyle = GetBorderCollapseStyle(); + if (NS_STYLE_TABLE_BORDER_COLLAPSE_COLLAPSE!=borderCollapseStyle) + { + if (tableStyle->mBorderSpacingY.GetUnit() == eStyleUnit_Coord) { + cellSpacing = tableStyle->mBorderSpacingY.GetCoordValue(); + } + else { + cellSpacing = mDefaultCellSpacingY; + } + } + return cellSpacing; +} + + // XXX: could cache this. But be sure to check style changes if you do! nscoord nsTableFrame::GetCellPadding() { - nsTableFrame* tableFrame = this; const nsStyleTable* tableStyle; GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); nscoord cellPadding = 0; diff --git a/mozilla/layout/html/table/src/nsTableFrame.h b/mozilla/layout/html/table/src/nsTableFrame.h index 3a69e050e58..9c6b10ef4ef 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.h +++ b/mozilla/layout/html/table/src/nsTableFrame.h @@ -193,16 +193,19 @@ public: /** set the width of the column at aColIndex to aWidth */ virtual void SetColumnWidth(PRInt32 aColIndex, nscoord aWidth); - /** helper to get the cell spacing style value */ - virtual nscoord GetCellSpacing(); + /** helper to get the border collapse style value */ + virtual PRUint8 GetBorderCollapseStyle(); - /** helper to get the cell spacing style value */ + /** helper to get the cell spacing X style value */ + virtual nscoord GetCellSpacingX(); + + /** helper to get the cell spacing Y style value */ + virtual nscoord GetCellSpacingY(); + + /** helper to get the cell padding style value */ virtual nscoord GetCellPadding(); - /** - * Calculate Layout Information - * - */ + /** Calculate Layout Information */ void AppendLayoutData(nsVoidArray* aList, nsTableCellFrame* aTableCell); void RecalcLayoutData(); @@ -632,7 +635,8 @@ private: ColumnInfoCache *mColCache; // cached information about the table columns nsITableLayoutStrategy * mTableLayoutStrategy; // the layout strategy for this frame nsIFrame* mColGroups; // the list of colgroup frames - nscoord mDefaultCellSpacing; // the default cell spacing for this table + nscoord mDefaultCellSpacingX;// the default cell spacing X for this table + nscoord mDefaultCellSpacingY;// the default cell spacing X for this table nscoord mDefaultCellPadding; // the default cell padding for this table }; diff --git a/mozilla/layout/html/table/src/nsTableRowFrame.cpp b/mozilla/layout/html/table/src/nsTableRowFrame.cpp index 16d0bf932fd..2c050013b0f 100644 --- a/mozilla/layout/html/table/src/nsTableRowFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableRowFrame.cpp @@ -493,7 +493,7 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, &kidMaxElementSize : nsnull; nscoord maxCellTopMargin = 0; nscoord maxCellBottomMargin = 0; - nscoord cellSpacing = aReflowState.tableFrame->GetCellSpacing(); + nscoord cellSpacingX = aReflowState.tableFrame->GetCellSpacingX(); PRInt32 cellColSpan=1; // must be defined here so it's set properly for non-cell kids if (PR_TRUE==gsDebug) printf("Row %p: Resize Reflow\n", this); @@ -522,13 +522,13 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, for (PRInt32 colIndex=prevColIndex+1; colIndexGetColumnWidth(colIndex); - aReflowState.x += cellSpacing; + aReflowState.x += cellSpacingX; if (PR_TRUE==gsDebug) printf(" Row: in loop, aReflowState.x set to %d from cellSpacing %d and col width\n", - aReflowState.x, aReflowState.tableFrame->GetColumnWidth(colIndex), cellSpacing); + aReflowState.x, aReflowState.tableFrame->GetColumnWidth(colIndex), cellSpacingX); } } - aReflowState.x += cellSpacing; + aReflowState.x += cellSpacingX; if (PR_TRUE==gsDebug) printf(" Row: past loop, aReflowState.x set to %d\n", aReflowState.x); // at this point, we know the column widths. @@ -541,11 +541,11 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, availWidth += aReflowState.tableFrame->GetColumnWidth(cellColIndex+numColSpan); if (numColSpan != 0) { - availWidth += cellSpacing; + availWidth += cellSpacingX; } if (PR_TRUE==gsDebug) printf(" Row: in loop, availWidth set to %d from colIndex %d width %d and cellSpacing\n", - availWidth, cellColIndex, aReflowState.tableFrame->GetColumnWidth(cellColIndex+numColSpan), cellSpacing); + availWidth, cellColIndex, aReflowState.tableFrame->GetColumnWidth(cellColIndex+numColSpan), cellSpacingX); } if (PR_TRUE==gsDebug) printf(" Row: availWidth for this cell is %d\n", availWidth); @@ -654,7 +654,7 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, // if this was the last child, and it had a colspan>1, add in the cellSpacing for the colspan // if the last kid wasn't a colspan, then we still have the colspan of the last real cell if ((nsnull==kidFrame) && (cellColSpan>1)) - aReflowState.x += cellSpacing; + aReflowState.x += cellSpacingX; } SetMaxChildHeight(aReflowState.maxCellHeight,maxCellTopMargin, maxCellBottomMargin); // remember height of tallest child who doesn't have a row span @@ -733,9 +733,9 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext, // get border padding values nsMargin borderPadding; - const nsStyleSpacing* cellSpacing; - kidFrame->GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacing)); - cellSpacing->CalcBorderPaddingFor(kidFrame, borderPadding); + const nsStyleSpacing* cellSpacingStyle; + kidFrame->GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacingStyle)); + cellSpacingStyle->CalcBorderPaddingFor(kidFrame, borderPadding); // Because we're not splittable always allow the child to be as high as // it wants. The default available width is also unconstrained so we can diff --git a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp index ad35c59367d..d9e19b8781d 100644 --- a/mozilla/layout/tables/BasicTableLayoutStrategy.cpp +++ b/mozilla/layout/tables/BasicTableLayoutStrategy.cpp @@ -461,7 +461,7 @@ PRBool BasicTableLayoutStrategy::AssignPreliminaryColumnWidths() if (effectiveMinColumnWidth>specifiedFixedColWidth) specifiedFixedColWidth=effectiveMinColumnWidth; // do all the global bookkeeping, factoring in margins - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); // keep a running total of the amount of space taken up by all fixed-width columns if ((PR_TRUE==haveColWidth) && (nsTableColFrame::eWIDTH_SOURCE_CELL==colFrame->GetWidthSource())) { @@ -715,7 +715,7 @@ void BasicTableLayoutStrategy::SetMinAndMaxTableWidths() if (gsDebug) printf("SetMinAndMaxTableWidths\n"); PRInt32 colIndex, rowIndex; PRInt32 numRows = mTableFrame->GetRowCount(); - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); for (rowIndex = 0; rowIndexGetRowCount(); - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); PRInt32 colIndex; for (colIndex = 0; colIndexGetRowCount(); - nscoord colInset = mTableFrame->GetCellSpacing(); + nscoord colInset = mTableFrame->GetCellSpacingX(); for (PRInt32 colIndex = 0; colIndexCalcBorderPaddingFor(this, borderPadding); + const nsStyleSpacing* cellSpacingStyle; + GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacingStyle)); + cellSpacingStyle->CalcBorderPaddingFor(this, borderPadding); nscoord contentWidth = mPass1DesiredSize.width - (borderPadding.left+borderPadding.right); nscoord contentHeight = mPass1DesiredSize.height - (borderPadding.top+borderPadding.bottom); // empty cells do not render their border @@ -554,7 +554,8 @@ void nsTableCellFrame::MapBorderMarginPadding(nsIPresContext* aPresContext) return; nscoord padding = tableFrame->GetCellPadding(); - nscoord spacing = tableFrame->GetCellSpacing(); + nscoord spacingX = tableFrame->GetCellSpacingX(); + nscoord spacingY = tableFrame->GetCellSpacingY(); nscoord border = 1; @@ -565,10 +566,10 @@ void nsTableCellFrame::MapBorderMarginPadding(nsIPresContext* aPresContext) tableFrame->GetStyleData(eStyleStruct_Spacing,(const nsStyleStruct *&)tableSpacingStyle); nsStyleSpacing* spacingData = (nsStyleSpacing*)mStyleContext->GetMutableStyleData(eStyleStruct_Spacing); - spacingData->mMargin.SetTop(spacing); - spacingData->mMargin.SetLeft(spacing); - spacingData->mMargin.SetBottom(spacing); - spacingData->mMargin.SetRight(spacing); + spacingData->mMargin.SetTop(spacingY); + spacingData->mMargin.SetLeft(spacingX); + spacingData->mMargin.SetBottom(spacingY); + spacingData->mMargin.SetRight(spacingX); spacingData->mPadding.SetTop(padding); spacingData->mPadding.SetLeft(padding); spacingData->mPadding.SetBottom(padding); diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index ce53da0c124..bf18ff472bd 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -285,7 +285,8 @@ nsTableFrame::nsTableFrame() nsCRT::memset (mColumnWidths, 0, mColumnWidthsLength*sizeof(PRInt32)); mCellMap = new nsCellMap(0, 0); mColGroups=nsnull; - mDefaultCellSpacing=0; + mDefaultCellSpacingX=0; + mDefaultCellSpacingY=0; mDefaultCellPadding=0; } @@ -296,7 +297,8 @@ nsTableFrame::Init(nsIPresContext& aPresContext, nsIStyleContext* aContext) { float p2t = aPresContext.GetPixelsToTwips(); - mDefaultCellSpacing = NSIntPixelsToTwips(2, p2t); + mDefaultCellSpacingX = NSIntPixelsToTwips(2, p2t); + mDefaultCellSpacingY = NSIntPixelsToTwips(2, p2t); mDefaultCellPadding = NSIntPixelsToTwips(1, p2t); return nsHTMLContainerFrame::Init(aPresContext, aContent, aParent, aContext); @@ -2396,7 +2398,7 @@ void nsTableFrame::PlaceChild(nsIPresContext& aPresContext, const nsStyleSpacing* tableSpacing; GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)tableSpacing)); tableSpacing->CalcBorderPaddingFor(this, borderPadding); - nscoord cellSpacing = GetCellSpacing(); + nscoord cellSpacing = GetCellSpacingX(); nscoord kidWidth = aKidMaxElementSize.width + borderPadding.left + borderPadding.right + cellSpacing*2; aMaxElementSize->width = PR_MAX(aMaxElementSize->width, kidWidth); aMaxElementSize->height += aKidMaxElementSize.height; @@ -2783,7 +2785,7 @@ void nsTableFrame::SetTableWidth(nsIPresContext& aPresContext) NS_ASSERTION(nsnull==mPrevInFlow, "never ever call me on a continuing frame!"); NS_ASSERTION(nsnull!=mCellMap, "never ever call me until the cell map is built!"); - nscoord cellSpacing = GetCellSpacing(); + nscoord cellSpacing = GetCellSpacingX(); if (gsDebug==PR_TRUE) printf ("SetTableWidth with cellSpacing = %d ", cellSpacing); PRInt32 tableWidth = cellSpacing; @@ -3595,26 +3597,56 @@ NS_METHOD nsTableFrame::GetCellMarginData(nsTableCellFrame* aKidFrame, nsMargin& return result; } -// XXX: could cache this. But be sure to check style changes if you do! -nscoord nsTableFrame::GetCellSpacing() +PRUint8 nsTableFrame::GetBorderCollapseStyle() +{ + const nsStyleTable* tableStyle; + GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); + return tableStyle->mBorderCollapse; +} + + +// XXX: could cache this. But be sure to check style changes if you do! +nscoord nsTableFrame::GetCellSpacingX() { - nsTableFrame* tableFrame = this; const nsStyleTable* tableStyle; GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); nscoord cellSpacing = 0; - if (tableStyle->mCellSpacing.GetUnit() == eStyleUnit_Coord) { - cellSpacing = tableStyle->mCellSpacing.GetCoordValue(); - } - else { - cellSpacing = mDefaultCellSpacing; + PRUint8 borderCollapseStyle = GetBorderCollapseStyle(); + if (NS_STYLE_TABLE_BORDER_COLLAPSE_COLLAPSE!=borderCollapseStyle) + { + if (tableStyle->mBorderSpacingX.GetUnit() == eStyleUnit_Coord) { + cellSpacing = tableStyle->mBorderSpacingX.GetCoordValue(); + } + else { + cellSpacing = mDefaultCellSpacingX; + } } return cellSpacing; } +// XXX: could cache this. But be sure to check style changes if you do! +nscoord nsTableFrame::GetCellSpacingY() +{ + const nsStyleTable* tableStyle; + GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); + nscoord cellSpacing = 0; + PRUint8 borderCollapseStyle = GetBorderCollapseStyle(); + if (NS_STYLE_TABLE_BORDER_COLLAPSE_COLLAPSE!=borderCollapseStyle) + { + if (tableStyle->mBorderSpacingY.GetUnit() == eStyleUnit_Coord) { + cellSpacing = tableStyle->mBorderSpacingY.GetCoordValue(); + } + else { + cellSpacing = mDefaultCellSpacingY; + } + } + return cellSpacing; +} + + // XXX: could cache this. But be sure to check style changes if you do! nscoord nsTableFrame::GetCellPadding() { - nsTableFrame* tableFrame = this; const nsStyleTable* tableStyle; GetStyleData(eStyleStruct_Table, (const nsStyleStruct *&)tableStyle); nscoord cellPadding = 0; diff --git a/mozilla/layout/tables/nsTableFrame.h b/mozilla/layout/tables/nsTableFrame.h index 3a69e050e58..9c6b10ef4ef 100644 --- a/mozilla/layout/tables/nsTableFrame.h +++ b/mozilla/layout/tables/nsTableFrame.h @@ -193,16 +193,19 @@ public: /** set the width of the column at aColIndex to aWidth */ virtual void SetColumnWidth(PRInt32 aColIndex, nscoord aWidth); - /** helper to get the cell spacing style value */ - virtual nscoord GetCellSpacing(); + /** helper to get the border collapse style value */ + virtual PRUint8 GetBorderCollapseStyle(); - /** helper to get the cell spacing style value */ + /** helper to get the cell spacing X style value */ + virtual nscoord GetCellSpacingX(); + + /** helper to get the cell spacing Y style value */ + virtual nscoord GetCellSpacingY(); + + /** helper to get the cell padding style value */ virtual nscoord GetCellPadding(); - /** - * Calculate Layout Information - * - */ + /** Calculate Layout Information */ void AppendLayoutData(nsVoidArray* aList, nsTableCellFrame* aTableCell); void RecalcLayoutData(); @@ -632,7 +635,8 @@ private: ColumnInfoCache *mColCache; // cached information about the table columns nsITableLayoutStrategy * mTableLayoutStrategy; // the layout strategy for this frame nsIFrame* mColGroups; // the list of colgroup frames - nscoord mDefaultCellSpacing; // the default cell spacing for this table + nscoord mDefaultCellSpacingX;// the default cell spacing X for this table + nscoord mDefaultCellSpacingY;// the default cell spacing X for this table nscoord mDefaultCellPadding; // the default cell padding for this table }; diff --git a/mozilla/layout/tables/nsTableRowFrame.cpp b/mozilla/layout/tables/nsTableRowFrame.cpp index 16d0bf932fd..2c050013b0f 100644 --- a/mozilla/layout/tables/nsTableRowFrame.cpp +++ b/mozilla/layout/tables/nsTableRowFrame.cpp @@ -493,7 +493,7 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, &kidMaxElementSize : nsnull; nscoord maxCellTopMargin = 0; nscoord maxCellBottomMargin = 0; - nscoord cellSpacing = aReflowState.tableFrame->GetCellSpacing(); + nscoord cellSpacingX = aReflowState.tableFrame->GetCellSpacingX(); PRInt32 cellColSpan=1; // must be defined here so it's set properly for non-cell kids if (PR_TRUE==gsDebug) printf("Row %p: Resize Reflow\n", this); @@ -522,13 +522,13 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, for (PRInt32 colIndex=prevColIndex+1; colIndexGetColumnWidth(colIndex); - aReflowState.x += cellSpacing; + aReflowState.x += cellSpacingX; if (PR_TRUE==gsDebug) printf(" Row: in loop, aReflowState.x set to %d from cellSpacing %d and col width\n", - aReflowState.x, aReflowState.tableFrame->GetColumnWidth(colIndex), cellSpacing); + aReflowState.x, aReflowState.tableFrame->GetColumnWidth(colIndex), cellSpacingX); } } - aReflowState.x += cellSpacing; + aReflowState.x += cellSpacingX; if (PR_TRUE==gsDebug) printf(" Row: past loop, aReflowState.x set to %d\n", aReflowState.x); // at this point, we know the column widths. @@ -541,11 +541,11 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, availWidth += aReflowState.tableFrame->GetColumnWidth(cellColIndex+numColSpan); if (numColSpan != 0) { - availWidth += cellSpacing; + availWidth += cellSpacingX; } if (PR_TRUE==gsDebug) printf(" Row: in loop, availWidth set to %d from colIndex %d width %d and cellSpacing\n", - availWidth, cellColIndex, aReflowState.tableFrame->GetColumnWidth(cellColIndex+numColSpan), cellSpacing); + availWidth, cellColIndex, aReflowState.tableFrame->GetColumnWidth(cellColIndex+numColSpan), cellSpacingX); } if (PR_TRUE==gsDebug) printf(" Row: availWidth for this cell is %d\n", availWidth); @@ -654,7 +654,7 @@ NS_METHOD nsTableRowFrame::ResizeReflow(nsIPresContext& aPresContext, // if this was the last child, and it had a colspan>1, add in the cellSpacing for the colspan // if the last kid wasn't a colspan, then we still have the colspan of the last real cell if ((nsnull==kidFrame) && (cellColSpan>1)) - aReflowState.x += cellSpacing; + aReflowState.x += cellSpacingX; } SetMaxChildHeight(aReflowState.maxCellHeight,maxCellTopMargin, maxCellBottomMargin); // remember height of tallest child who doesn't have a row span @@ -733,9 +733,9 @@ nsTableRowFrame::InitialReflow(nsIPresContext& aPresContext, // get border padding values nsMargin borderPadding; - const nsStyleSpacing* cellSpacing; - kidFrame->GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacing)); - cellSpacing->CalcBorderPaddingFor(kidFrame, borderPadding); + const nsStyleSpacing* cellSpacingStyle; + kidFrame->GetStyleData(eStyleStruct_Spacing , ((const nsStyleStruct *&)cellSpacingStyle)); + cellSpacingStyle->CalcBorderPaddingFor(kidFrame, borderPadding); // Because we're not splittable always allow the child to be as high as // it wants. The default available width is also unconstrained so we can