From 9864b12d262c923733ef9874de9503e09ad51d6e Mon Sep 17 00:00:00 2001 From: "buster%netscape.com" Date: Wed, 30 Dec 1998 22:40:36 +0000 Subject: [PATCH] collapsing borders with odd width have correct width now git-svn-id: svn://10.0.0.236/trunk@17012 18797224-902f-48f8-a5cc-f745e15eee43 --- .../layout/html/table/src/nsTableFrame.cpp | 28 +++++++++---------- mozilla/layout/tables/nsTableFrame.cpp | 28 +++++++++---------- 2 files changed, 28 insertions(+), 28 deletions(-) diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index e9cbdd0b38f..496db2e7fda 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -1503,6 +1503,11 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, widthToAdd = NSToCoordCeil(p2t); border.mWidth *= NSToCoordCeil(p2t); border.mLength = rowRect.height; + if (nsnull!=cellFrame) + { + cellFrame->SetBorderEdge(NS_SIDE_RIGHT, aRowIndex, aColIndex, &border, widthToAdd); + } + border.mWidth += widthToAdd; // right edge of this cell get's odd pixel if (nsnull==rightNeighborFrame) { nsBorderEdge * tableBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_RIGHT].ElementAt(aRowIndex)); @@ -1515,13 +1520,8 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, } else { - border.mWidth += widthToAdd; // right edge of this cell get's odd pixel rightNeighborFrame->SetBorderEdge(NS_SIDE_LEFT, aRowIndex, aColIndex, &border, 0); } - if (nsnull!=cellFrame) - { - cellFrame->SetBorderEdge(NS_SIDE_RIGHT, aRowIndex, aColIndex, &border, widthToAdd); - } } void nsTableFrame::ComputeTopBorderForEdgeAt(nsIPresContext& aPresContext, @@ -1720,6 +1720,11 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, widthToAdd = NSToCoordCeil(p2t); border.mWidth *= NSToCoordCeil(p2t); border.mLength = GetColumnWidth(aColIndex); + if (nsnull!=cellFrame) + { + cellFrame->SetBorderEdge(NS_SIDE_BOTTOM, aRowIndex, aColIndex, &border, widthToAdd); + } + border.mWidth += widthToAdd; // bottom edge of this cell get's odd pixel if (nsnull==bottomNeighborFrame) { nsBorderEdge * tableBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_BOTTOM].ElementAt(aColIndex)); @@ -1741,13 +1746,8 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, } else { - border.mWidth += widthToAdd; // bottom edge of this cell get's odd pixel bottomNeighborFrame->SetBorderEdge(NS_SIDE_TOP, aRowIndex, aColIndex, &border, 0); } - if (nsnull!=cellFrame) - { - cellFrame->SetBorderEdge(NS_SIDE_BOTTOM, aRowIndex, aColIndex, &border, widthToAdd); - } } nscoord nsTableFrame::GetWidthForSide(const nsMargin &aBorder, PRUint8 aSide) @@ -4330,10 +4330,10 @@ void nsTableFrame::MapHTMLBorderStyle(nsStyleSpacing& aSpacingStyle, nscoord aBo aSpacingStyle.mBorder.SetBottom(width); aSpacingStyle.mBorder.SetRight(width); - aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_OUTSET); - aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_OUTSET); - aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_OUTSET); - aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_OUTSET); nsIStyleContext* styleContext = mStyleContext; const nsStyleColor* colorData = (const nsStyleColor*) diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index e9cbdd0b38f..496db2e7fda 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -1503,6 +1503,11 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, widthToAdd = NSToCoordCeil(p2t); border.mWidth *= NSToCoordCeil(p2t); border.mLength = rowRect.height; + if (nsnull!=cellFrame) + { + cellFrame->SetBorderEdge(NS_SIDE_RIGHT, aRowIndex, aColIndex, &border, widthToAdd); + } + border.mWidth += widthToAdd; // right edge of this cell get's odd pixel if (nsnull==rightNeighborFrame) { nsBorderEdge * tableBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_RIGHT].ElementAt(aRowIndex)); @@ -1515,13 +1520,8 @@ void nsTableFrame::ComputeRightBorderForEdgeAt(nsIPresContext& aPresContext, } else { - border.mWidth += widthToAdd; // right edge of this cell get's odd pixel rightNeighborFrame->SetBorderEdge(NS_SIDE_LEFT, aRowIndex, aColIndex, &border, 0); } - if (nsnull!=cellFrame) - { - cellFrame->SetBorderEdge(NS_SIDE_RIGHT, aRowIndex, aColIndex, &border, widthToAdd); - } } void nsTableFrame::ComputeTopBorderForEdgeAt(nsIPresContext& aPresContext, @@ -1720,6 +1720,11 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, widthToAdd = NSToCoordCeil(p2t); border.mWidth *= NSToCoordCeil(p2t); border.mLength = GetColumnWidth(aColIndex); + if (nsnull!=cellFrame) + { + cellFrame->SetBorderEdge(NS_SIDE_BOTTOM, aRowIndex, aColIndex, &border, widthToAdd); + } + border.mWidth += widthToAdd; // bottom edge of this cell get's odd pixel if (nsnull==bottomNeighborFrame) { nsBorderEdge * tableBorder = (nsBorderEdge *)(mBorderEdges.mEdges[NS_SIDE_BOTTOM].ElementAt(aColIndex)); @@ -1741,13 +1746,8 @@ void nsTableFrame::ComputeBottomBorderForEdgeAt(nsIPresContext& aPresContext, } else { - border.mWidth += widthToAdd; // bottom edge of this cell get's odd pixel bottomNeighborFrame->SetBorderEdge(NS_SIDE_TOP, aRowIndex, aColIndex, &border, 0); } - if (nsnull!=cellFrame) - { - cellFrame->SetBorderEdge(NS_SIDE_BOTTOM, aRowIndex, aColIndex, &border, widthToAdd); - } } nscoord nsTableFrame::GetWidthForSide(const nsMargin &aBorder, PRUint8 aSide) @@ -4330,10 +4330,10 @@ void nsTableFrame::MapHTMLBorderStyle(nsStyleSpacing& aSpacingStyle, nscoord aBo aSpacingStyle.mBorder.SetBottom(width); aSpacingStyle.mBorder.SetRight(width); - aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_OUTSET); - aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_OUTSET); - aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_OUTSET); - aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_TOP, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_LEFT, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_BOTTOM, NS_STYLE_BORDER_STYLE_OUTSET); + aSpacingStyle.SetBorderStyle(NS_SIDE_RIGHT, NS_STYLE_BORDER_STYLE_OUTSET); nsIStyleContext* styleContext = mStyleContext; const nsStyleColor* colorData = (const nsStyleColor*)