From 5284506712f6f1df81d776e8f456b72c61321a83 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Fri, 15 Jan 1999 18:25:58 +0000 Subject: [PATCH] Fix for bug #1998. Now we render the background image over the padding area and not over the border area --- layout/base/nsCSSRendering.cpp | 106 +++++++++++------- layout/base/nsCSSRendering.h | 13 ++- layout/forms/nsFieldSetFrame.cpp | 4 +- layout/forms/nsFormControlFrame.cpp | 13 ++- layout/forms/nsTextControlFrame.cpp | 2 +- layout/generic/nsBlockFrame.cpp | 2 +- layout/generic/nsBlockReflowState.cpp | 2 +- layout/generic/nsBlockReflowState.h | 2 +- layout/generic/nsHTMLContainerFrame.cpp | 2 +- layout/generic/nsLeafFrame.cpp | 2 +- layout/html/base/src/nsBlockFrame.cpp | 2 +- layout/html/base/src/nsBlockReflowState.cpp | 2 +- layout/html/base/src/nsBlockReflowState.h | 2 +- layout/html/base/src/nsHTMLContainerFrame.cpp | 2 +- layout/html/base/src/nsLeafFrame.cpp | 2 +- layout/html/forms/src/nsFieldSetFrame.cpp | 4 +- layout/html/forms/src/nsFormControlFrame.cpp | 13 ++- layout/html/forms/src/nsTextControlFrame.cpp | 2 +- layout/html/style/src/nsCSSRendering.cpp | 106 +++++++++++------- layout/html/style/src/nsCSSRendering.h | 13 ++- layout/html/table/src/nsTableCellFrame.cpp | 2 +- layout/html/table/src/nsTableFrame.cpp | 2 +- layout/tables/nsTableCellFrame.cpp | 2 +- layout/tables/nsTableFrame.cpp | 2 +- 24 files changed, 178 insertions(+), 126 deletions(-) diff --git a/layout/base/nsCSSRendering.cpp b/layout/base/nsCSSRendering.cpp index 4fd70c6dd3d..cba2f38b02d 100644 --- a/layout/base/nsCSSRendering.cpp +++ b/layout/base/nsCSSRendering.cpp @@ -1335,7 +1335,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleSpacing& aStyle, PRIntn aSkipSides, nsRect* aGap) @@ -1356,7 +1356,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, if (0 == border.bottom) aSkipSides |= (1 << NS_SIDE_BOTTOM); if (0 == border.left) aSkipSides |= (1 << NS_SIDE_LEFT); - nsRect inside(aBounds); + nsRect inside(aBorderArea); nsRect outside(inside); outside.Deflate(border); @@ -1414,7 +1414,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, nsBorderEdges * aBorderEdges, PRIntn aSkipSides, nsRect* aGap) @@ -1435,7 +1435,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, aSkipSides |= (1 << NS_SIDE_LEFT); // Draw any dashed or dotted segments separately - DrawDashedSegments(aRenderingContext, aBounds, aBorderEdges, aSkipSides, aGap); + DrawDashedSegments(aRenderingContext, aBorderArea, aBorderEdges, aSkipSides, aGap); // Draw all the other sides nscoord twipsPerPixel = (nscoord)aPresContext.GetPixelsToTwips(); @@ -1447,10 +1447,10 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, for (i=0; imEdges[NS_SIDE_TOP].ElementAt(i)); - nscoord y = aBounds.y; + nscoord y = aBorderArea.y; if (PR_TRUE==aBorderEdges->mOutsideEdge) // segments of the outside edge are bottom-aligned y += aBorderEdges->mMaxBorderWidth.top - borderEdge->mWidth; - nsRect inside(x, y, borderEdge->mLength, aBounds.height); + nsRect inside(x, y, borderEdge->mLength, aBorderArea.height); x += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(0, borderEdge->mWidth, 0, 0); @@ -1469,8 +1469,8 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, for (i=0; imEdges[NS_SIDE_LEFT].ElementAt(i)); - nscoord x = aBounds.x + (aBorderEdges->mMaxBorderWidth.left - borderEdge->mWidth); - nsRect inside(x, y, aBounds.width, borderEdge->mLength); + nscoord x = aBorderArea.x + (aBorderEdges->mMaxBorderWidth.left - borderEdge->mWidth); + nsRect inside(x, y, aBorderArea.width, borderEdge->mLength); y += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(borderEdge->mWidth, 0, 0, 0); @@ -1490,10 +1490,10 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, for (i=0; imEdges[NS_SIDE_BOTTOM].ElementAt(i)); - nscoord y = aBounds.y; + nscoord y = aBorderArea.y; if (PR_TRUE==aBorderEdges->mOutsideEdge) // segments of the outside edge are top-aligned y -= (aBorderEdges->mMaxBorderWidth.bottom - borderEdge->mWidth); - nsRect inside(x, y, borderEdge->mLength, aBounds.height); + nsRect inside(x, y, borderEdge->mLength, aBorderArea.height); x += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(0, 0, 0, borderEdge->mWidth); @@ -1516,14 +1516,14 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, nscoord width; if (PR_TRUE==aBorderEdges->mOutsideEdge) { - width = aBounds.width - aBorderEdges->mMaxBorderWidth.right; + width = aBorderArea.width - aBorderEdges->mMaxBorderWidth.right; width += borderEdge->mWidth; } else { - width = aBounds.width; + width = aBorderArea.width; } - nsRect inside(aBounds.x, y, width, borderEdge->mLength); + nsRect inside(aBorderArea.x, y, width, borderEdge->mLength); y += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(0, 0, (borderEdge->mWidth), 0); @@ -1623,8 +1623,9 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleColor& aColor, + const nsStyleSpacing& aSpacing, nscoord aDX, nscoord aDY) { @@ -1647,7 +1648,7 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, // Redraw will happen later if (!transparentBG) { aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(aBounds); + aRenderingContext.FillRect(aBorderArea); } return; } @@ -1671,6 +1672,23 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, return; } + // Background images are tiled over the 'content' and 'padding' areas + // only (not the 'border' area) + nsRect paddingArea(aBorderArea); + nsMargin border; + + aSpacing.GetBorder(border); + paddingArea.Deflate(border); + + // The actual dirty rect is the intersection of the padding area and the + // dirty rect we were given + nsRect dirtyRect; + + if (!dirtyRect.IntersectRect(paddingArea, aDirtyRect)) { + // Nothing to paint + return; + } + // Based on the repeat setting, compute how many tiles we should // lay down for each axis. The value computed is the maximum based // on the dirty rect before accounting for the background-position. @@ -1684,73 +1702,74 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, needBackgroundColor = PR_TRUE; break; case NS_STYLE_BG_REPEAT_X: - xDistance = aDirtyRect.width; + xDistance = dirtyRect.width; yDistance = tileHeight; needBackgroundColor = PR_TRUE; break; case NS_STYLE_BG_REPEAT_Y: xDistance = tileWidth; - yDistance = aDirtyRect.height; + yDistance = dirtyRect.height; needBackgroundColor = PR_TRUE; break; case NS_STYLE_BG_REPEAT_XY: - xDistance = aDirtyRect.width; - yDistance = aDirtyRect.height; + xDistance = dirtyRect.width; + yDistance = dirtyRect.height; break; } + + // The background color is rendered over the 'border' 'padding' and + // 'content' areas if (needBackgroundColor) { aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(aBounds); + aRenderingContext.FillRect(aBorderArea); } - // Compute the anchor point, relative to the bounding box - // (aBounds) where the background image rendering should - // begin. When tiling, the anchor coordinate values will be - // negative offsets from aBounds origin. + // Compute the anchor point, relative to the padding area where the + // background image rendering should begin. When tiling, the anchor + // coordinate values will be negative offsets from the padding area nsPoint anchor; - ComputeBackgroundAnchorPoint(aColor, aBounds, + ComputeBackgroundAnchorPoint(aColor, paddingArea, tileWidth, tileHeight, anchor); - // Setup clipping so that rendering doesn't leak out of the dirty rect + // Setup clipping so that rendering doesn't leak out of the computed + // dirty rect PRBool clipState; aRenderingContext.PushState(); - aRenderingContext.SetClipRect(aDirtyRect, nsClipCombine_kIntersect, + aRenderingContext.SetClipRect(dirtyRect, nsClipCombine_kIntersect, clipState); // Compute the x and y starting points and limits for tiling nscoord x0, x1; if (NS_STYLE_BG_REPEAT_X & aColor.mBackgroundRepeat) { - // When tiling in the x direction, adjust the starting position - // of the tile to account for the aDirtyRect.x. When tiling in - // x, the anchor.x value will be a negative value used to adjust - // the starting coordinate. - x0 = (aDirtyRect.x / tileWidth) * tileWidth + anchor.x; + // When tiling in the x direction, adjust the starting position of the + // tile to account for dirtyRect.x. When tiling in x, the anchor.x value + // will be a negative value used to adjust the starting coordinate. + x0 = (dirtyRect.x / tileWidth) * tileWidth + anchor.x; x1 = x0 + xDistance + tileWidth; if (0 != anchor.x) { x1 += tileWidth; } } else { - // When tiling is off in x, anchor.x is relative to aBounds.x - x0 = aBounds.x + anchor.x; + // When tiling is off in x, anchor.x is relative to padding area + x0 = paddingArea.x + anchor.x; x1 = x0 + tileWidth; } nscoord y0, y1; if (NS_STYLE_BG_REPEAT_Y & aColor.mBackgroundRepeat) { - // When tiling in the y direction, adjust the starting position - // of the tile to account for the aDirtyRect.y. When tiling in - // y, the anchor.y value will be a negative value used to adjust - // the starting coordinate. - y0 = (aDirtyRect.y / tileHeight) * tileHeight + anchor.y; + // When tiling in the y direction, adjust the starting position of the + // tile to account for dirtyRect.y. When tiling in y, the anchor.y value + // will be a negative value used to adjust the starting coordinate. + y0 = (dirtyRect.y / tileHeight) * tileHeight + anchor.y; y1 = y0 + yDistance + tileHeight; if (0 != anchor.y) { y1 += tileHeight; } } else { - // When tiling is off in y, anchor.y is relative to aBounds.y - y0 = aBounds.y + anchor.y; + // When tiling is off in y, anchor.y is relative to padding area + y0 = paddingArea.y + anchor.y; y1 = y0 + tileHeight; } @@ -1764,13 +1783,16 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, // Restore clipping aRenderingContext.PopState(clipState); + } else { + // See if there's a background color specified. The background color + // is rendered over the 'border' 'padding' and 'content' areas if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) { // XXX This step can be avoided if we have an image and it doesn't // have any transparent pixels, and the image is tiled in both // the x and the y aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(aBounds); + aRenderingContext.FillRect(aBorderArea); } } } diff --git a/layout/base/nsCSSRendering.h b/layout/base/nsCSSRendering.h index cb8317fd6cb..5a3e0db80de 100644 --- a/layout/base/nsCSSRendering.h +++ b/layout/base/nsCSSRendering.h @@ -29,14 +29,14 @@ public: * for borders. aSkipSides is a bitmask of the sides to skip * when rendering. If 0 then no sides are skipped. * - * Both aDirtyRect and aBounds are in the local coordinate space + * Both aDirtyRect and aBorderArea are in the local coordinate space * of aForFrame */ static void PaintBorder(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleSpacing& aStyle, PRIntn aSkipSides, nsRect* aGap = 0); @@ -49,14 +49,14 @@ public: * for borders. aSkipSides is a bitmask of the sides to skip * when rendering. If 0 then no sides are skipped. * - * Both aDirtyRect and aBounds are in the local coordinate space + * Both aDirtyRect and aBorderArea are in the local coordinate space * of aForFrame */ static void PaintBorderEdges(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, nsBorderEdges * aBorderEdges, PRIntn aSkipSides, nsRect* aGap = 0); @@ -66,15 +66,16 @@ public: * Render the background for an element using css rendering rules * for backgrounds. * - * Both aDirtyRect and aBounds are in the local coordinate space + * Both aDirtyRect and aBorderArea are in the local coordinate space * of aForFrame */ static void PaintBackground(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleColor& aColor, + const nsStyleSpacing& aStyle, nscoord aDX, nscoord aDY); diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index f38d3f84793..d1fc4ca49e3 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -194,13 +194,13 @@ nsFieldSetFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, mTopBorderOffset, mRect.width, mRect.height - margin.top - margin.bottom - mTopBorderOffset); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides, &mTopBorderGap); } else { nsRect rect(0, mTopBorderOffset, mRect.width, mRect.height - mTopBorderOffset); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides, &mTopBorderGap); } diff --git a/layout/forms/nsFormControlFrame.cpp b/layout/forms/nsFormControlFrame.cpp index 44d1e6f4310..7e95a805c2b 100644 --- a/layout/forms/nsFormControlFrame.cpp +++ b/layout/forms/nsFormControlFrame.cpp @@ -1120,7 +1120,7 @@ nsFormControlFrame::PaintArrow(nsArrowDirection aArrowDirection, { // Draw border using CSS nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, aRect, aColor, 0, 0); + aDirtyRect, aRect, aColor, aSpacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, aRect, aSpacing, 0); @@ -1158,7 +1158,8 @@ nsFormControlFrame::PaintScrollbar(nsIRenderingContext& aRenderingContext, // Paint background for scrollbar nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, aRect, *scrollbarColor, 0, 0); + aDirtyRect, aRect, *scrollbarColor, *arrowSpacing, + 0, 0); if (PR_TRUE == aHorizontal) { // Draw horizontal Arrow @@ -1169,7 +1170,8 @@ nsFormControlFrame::PaintScrollbar(nsIRenderingContext& aRenderingContext, nsRect thumbRect(aRect.x+arrowWidth, aRect.y, arrowWidth, arrowWidth); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, thumbRect, *arrowColor, 0, 0); + aDirtyRect, thumbRect, *arrowColor, *arrowSpacing, + 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, thumbRect, *arrowSpacing, 0); @@ -1187,7 +1189,8 @@ nsFormControlFrame::PaintScrollbar(nsIRenderingContext& aRenderingContext, nsRect thumbRect(aRect.x, aRect.y+arrowHeight, arrowHeight, arrowHeight); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, thumbRect, *arrowColor, 0, 0); + aDirtyRect, thumbRect, *arrowColor, *arrowSpacing, + 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, thumbRect, *arrowSpacing, 0); @@ -1328,7 +1331,7 @@ nsFormControlFrame::PaintRectangularButton(nsIPresContext& aPresContext, (const nsStyleColor*)aStyleContext->GetStyleData(eStyleStruct_Color); nsRect rect(0, 0, aWidth, aHeight); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, rect, *spacing, 0); diff --git a/layout/forms/nsTextControlFrame.cpp b/layout/forms/nsTextControlFrame.cpp index 4d5e6b3c116..bf8c1da1f1c 100644 --- a/layout/forms/nsTextControlFrame.cpp +++ b/layout/forms/nsTextControlFrame.cpp @@ -698,7 +698,7 @@ nsTextControlFrame::PaintTextControl(nsIPresContext& aPresContext, const nsStyleColor* sbColor = (const nsStyleColor*)scrollbarStyle->GetStyleData(eStyleStruct_Color); srect.SetRect(mRect.width-scrollbarScaledWidth-(2*onePixel), mRect.height-scrollbarScaledHeight-(onePixel*2), scrollbarScaledWidth, scrollbarScaledHeight); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, srect, *sbColor, 0, 0); + aDirtyRect, srect, *sbColor, *spacing, 0, 0); } diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 64dab7bba15..3328e0cfd94 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -3960,7 +3960,7 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, // Paint background and border nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index 64dab7bba15..3328e0cfd94 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -3960,7 +3960,7 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, // Paint background and border nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/generic/nsBlockReflowState.h b/layout/generic/nsBlockReflowState.h index 64dab7bba15..3328e0cfd94 100644 --- a/layout/generic/nsBlockReflowState.h +++ b/layout/generic/nsBlockReflowState.h @@ -3960,7 +3960,7 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, // Paint background and border nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index 49c872208ed..36ef2236ddd 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -63,7 +63,7 @@ nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/generic/nsLeafFrame.cpp b/layout/generic/nsLeafFrame.cpp index 0c3b81a2ee0..54c982d41ae 100644 --- a/layout/generic/nsLeafFrame.cpp +++ b/layout/generic/nsLeafFrame.cpp @@ -44,7 +44,7 @@ nsLeafFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Spacing); nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *myColor, 0, 0); + aDirtyRect, rect, *myColor, *mySpacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *mySpacing, 0); } diff --git a/layout/html/base/src/nsBlockFrame.cpp b/layout/html/base/src/nsBlockFrame.cpp index 64dab7bba15..3328e0cfd94 100644 --- a/layout/html/base/src/nsBlockFrame.cpp +++ b/layout/html/base/src/nsBlockFrame.cpp @@ -3960,7 +3960,7 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, // Paint background and border nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/html/base/src/nsBlockReflowState.cpp b/layout/html/base/src/nsBlockReflowState.cpp index 64dab7bba15..3328e0cfd94 100644 --- a/layout/html/base/src/nsBlockReflowState.cpp +++ b/layout/html/base/src/nsBlockReflowState.cpp @@ -3960,7 +3960,7 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, // Paint background and border nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/html/base/src/nsBlockReflowState.h b/layout/html/base/src/nsBlockReflowState.h index 64dab7bba15..3328e0cfd94 100644 --- a/layout/html/base/src/nsBlockReflowState.h +++ b/layout/html/base/src/nsBlockReflowState.h @@ -3960,7 +3960,7 @@ nsBaseIBFrame::Paint(nsIPresContext& aPresContext, // Paint background and border nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/html/base/src/nsHTMLContainerFrame.cpp b/layout/html/base/src/nsHTMLContainerFrame.cpp index 49c872208ed..36ef2236ddd 100644 --- a/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -63,7 +63,7 @@ nsHTMLContainerFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides); } diff --git a/layout/html/base/src/nsLeafFrame.cpp b/layout/html/base/src/nsLeafFrame.cpp index 0c3b81a2ee0..54c982d41ae 100644 --- a/layout/html/base/src/nsLeafFrame.cpp +++ b/layout/html/base/src/nsLeafFrame.cpp @@ -44,7 +44,7 @@ nsLeafFrame::Paint(nsIPresContext& aPresContext, mStyleContext->GetStyleData(eStyleStruct_Spacing); nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *myColor, 0, 0); + aDirtyRect, rect, *myColor, *mySpacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *mySpacing, 0); } diff --git a/layout/html/forms/src/nsFieldSetFrame.cpp b/layout/html/forms/src/nsFieldSetFrame.cpp index f38d3f84793..d1fc4ca49e3 100644 --- a/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/layout/html/forms/src/nsFieldSetFrame.cpp @@ -194,13 +194,13 @@ nsFieldSetFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, mTopBorderOffset, mRect.width, mRect.height - margin.top - margin.bottom - mTopBorderOffset); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides, &mTopBorderGap); } else { nsRect rect(0, mTopBorderOffset, mRect.width, mRect.height - mTopBorderOffset); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *spacing, skipSides, &mTopBorderGap); } diff --git a/layout/html/forms/src/nsFormControlFrame.cpp b/layout/html/forms/src/nsFormControlFrame.cpp index 44d1e6f4310..7e95a805c2b 100644 --- a/layout/html/forms/src/nsFormControlFrame.cpp +++ b/layout/html/forms/src/nsFormControlFrame.cpp @@ -1120,7 +1120,7 @@ nsFormControlFrame::PaintArrow(nsArrowDirection aArrowDirection, { // Draw border using CSS nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, aRect, aColor, 0, 0); + aDirtyRect, aRect, aColor, aSpacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, aRect, aSpacing, 0); @@ -1158,7 +1158,8 @@ nsFormControlFrame::PaintScrollbar(nsIRenderingContext& aRenderingContext, // Paint background for scrollbar nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, aRect, *scrollbarColor, 0, 0); + aDirtyRect, aRect, *scrollbarColor, *arrowSpacing, + 0, 0); if (PR_TRUE == aHorizontal) { // Draw horizontal Arrow @@ -1169,7 +1170,8 @@ nsFormControlFrame::PaintScrollbar(nsIRenderingContext& aRenderingContext, nsRect thumbRect(aRect.x+arrowWidth, aRect.y, arrowWidth, arrowWidth); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, thumbRect, *arrowColor, 0, 0); + aDirtyRect, thumbRect, *arrowColor, *arrowSpacing, + 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, thumbRect, *arrowSpacing, 0); @@ -1187,7 +1189,8 @@ nsFormControlFrame::PaintScrollbar(nsIRenderingContext& aRenderingContext, nsRect thumbRect(aRect.x, aRect.y+arrowHeight, arrowHeight, arrowHeight); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, thumbRect, *arrowColor, 0, 0); + aDirtyRect, thumbRect, *arrowColor, *arrowSpacing, + 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, thumbRect, *arrowSpacing, 0); @@ -1328,7 +1331,7 @@ nsFormControlFrame::PaintRectangularButton(nsIPresContext& aPresContext, (const nsStyleColor*)aStyleContext->GetStyleData(eStyleStruct_Color); nsRect rect(0, 0, aWidth, aHeight); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, aForFrame, aDirtyRect, rect, *spacing, 0); diff --git a/layout/html/forms/src/nsTextControlFrame.cpp b/layout/html/forms/src/nsTextControlFrame.cpp index 4d5e6b3c116..bf8c1da1f1c 100644 --- a/layout/html/forms/src/nsTextControlFrame.cpp +++ b/layout/html/forms/src/nsTextControlFrame.cpp @@ -698,7 +698,7 @@ nsTextControlFrame::PaintTextControl(nsIPresContext& aPresContext, const nsStyleColor* sbColor = (const nsStyleColor*)scrollbarStyle->GetStyleData(eStyleStruct_Color); srect.SetRect(mRect.width-scrollbarScaledWidth-(2*onePixel), mRect.height-scrollbarScaledHeight-(onePixel*2), scrollbarScaledWidth, scrollbarScaledHeight); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, srect, *sbColor, 0, 0); + aDirtyRect, srect, *sbColor, *spacing, 0, 0); } diff --git a/layout/html/style/src/nsCSSRendering.cpp b/layout/html/style/src/nsCSSRendering.cpp index 4fd70c6dd3d..cba2f38b02d 100644 --- a/layout/html/style/src/nsCSSRendering.cpp +++ b/layout/html/style/src/nsCSSRendering.cpp @@ -1335,7 +1335,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleSpacing& aStyle, PRIntn aSkipSides, nsRect* aGap) @@ -1356,7 +1356,7 @@ void nsCSSRendering::PaintBorder(nsIPresContext& aPresContext, if (0 == border.bottom) aSkipSides |= (1 << NS_SIDE_BOTTOM); if (0 == border.left) aSkipSides |= (1 << NS_SIDE_LEFT); - nsRect inside(aBounds); + nsRect inside(aBorderArea); nsRect outside(inside); outside.Deflate(border); @@ -1414,7 +1414,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, nsBorderEdges * aBorderEdges, PRIntn aSkipSides, nsRect* aGap) @@ -1435,7 +1435,7 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, aSkipSides |= (1 << NS_SIDE_LEFT); // Draw any dashed or dotted segments separately - DrawDashedSegments(aRenderingContext, aBounds, aBorderEdges, aSkipSides, aGap); + DrawDashedSegments(aRenderingContext, aBorderArea, aBorderEdges, aSkipSides, aGap); // Draw all the other sides nscoord twipsPerPixel = (nscoord)aPresContext.GetPixelsToTwips(); @@ -1447,10 +1447,10 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, for (i=0; imEdges[NS_SIDE_TOP].ElementAt(i)); - nscoord y = aBounds.y; + nscoord y = aBorderArea.y; if (PR_TRUE==aBorderEdges->mOutsideEdge) // segments of the outside edge are bottom-aligned y += aBorderEdges->mMaxBorderWidth.top - borderEdge->mWidth; - nsRect inside(x, y, borderEdge->mLength, aBounds.height); + nsRect inside(x, y, borderEdge->mLength, aBorderArea.height); x += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(0, borderEdge->mWidth, 0, 0); @@ -1469,8 +1469,8 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, for (i=0; imEdges[NS_SIDE_LEFT].ElementAt(i)); - nscoord x = aBounds.x + (aBorderEdges->mMaxBorderWidth.left - borderEdge->mWidth); - nsRect inside(x, y, aBounds.width, borderEdge->mLength); + nscoord x = aBorderArea.x + (aBorderEdges->mMaxBorderWidth.left - borderEdge->mWidth); + nsRect inside(x, y, aBorderArea.width, borderEdge->mLength); y += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(borderEdge->mWidth, 0, 0, 0); @@ -1490,10 +1490,10 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, for (i=0; imEdges[NS_SIDE_BOTTOM].ElementAt(i)); - nscoord y = aBounds.y; + nscoord y = aBorderArea.y; if (PR_TRUE==aBorderEdges->mOutsideEdge) // segments of the outside edge are top-aligned y -= (aBorderEdges->mMaxBorderWidth.bottom - borderEdge->mWidth); - nsRect inside(x, y, borderEdge->mLength, aBounds.height); + nsRect inside(x, y, borderEdge->mLength, aBorderArea.height); x += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(0, 0, 0, borderEdge->mWidth); @@ -1516,14 +1516,14 @@ void nsCSSRendering::PaintBorderEdges(nsIPresContext& aPresContext, nscoord width; if (PR_TRUE==aBorderEdges->mOutsideEdge) { - width = aBounds.width - aBorderEdges->mMaxBorderWidth.right; + width = aBorderArea.width - aBorderEdges->mMaxBorderWidth.right; width += borderEdge->mWidth; } else { - width = aBounds.width; + width = aBorderArea.width; } - nsRect inside(aBounds.x, y, width, borderEdge->mLength); + nsRect inside(aBorderArea.x, y, width, borderEdge->mLength); y += borderEdge->mLength; nsRect outside(inside); nsMargin outsideMargin(0, 0, (borderEdge->mWidth), 0); @@ -1623,8 +1623,9 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleColor& aColor, + const nsStyleSpacing& aSpacing, nscoord aDX, nscoord aDY) { @@ -1647,7 +1648,7 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, // Redraw will happen later if (!transparentBG) { aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(aBounds); + aRenderingContext.FillRect(aBorderArea); } return; } @@ -1671,6 +1672,23 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, return; } + // Background images are tiled over the 'content' and 'padding' areas + // only (not the 'border' area) + nsRect paddingArea(aBorderArea); + nsMargin border; + + aSpacing.GetBorder(border); + paddingArea.Deflate(border); + + // The actual dirty rect is the intersection of the padding area and the + // dirty rect we were given + nsRect dirtyRect; + + if (!dirtyRect.IntersectRect(paddingArea, aDirtyRect)) { + // Nothing to paint + return; + } + // Based on the repeat setting, compute how many tiles we should // lay down for each axis. The value computed is the maximum based // on the dirty rect before accounting for the background-position. @@ -1684,73 +1702,74 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, needBackgroundColor = PR_TRUE; break; case NS_STYLE_BG_REPEAT_X: - xDistance = aDirtyRect.width; + xDistance = dirtyRect.width; yDistance = tileHeight; needBackgroundColor = PR_TRUE; break; case NS_STYLE_BG_REPEAT_Y: xDistance = tileWidth; - yDistance = aDirtyRect.height; + yDistance = dirtyRect.height; needBackgroundColor = PR_TRUE; break; case NS_STYLE_BG_REPEAT_XY: - xDistance = aDirtyRect.width; - yDistance = aDirtyRect.height; + xDistance = dirtyRect.width; + yDistance = dirtyRect.height; break; } + + // The background color is rendered over the 'border' 'padding' and + // 'content' areas if (needBackgroundColor) { aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(aBounds); + aRenderingContext.FillRect(aBorderArea); } - // Compute the anchor point, relative to the bounding box - // (aBounds) where the background image rendering should - // begin. When tiling, the anchor coordinate values will be - // negative offsets from aBounds origin. + // Compute the anchor point, relative to the padding area where the + // background image rendering should begin. When tiling, the anchor + // coordinate values will be negative offsets from the padding area nsPoint anchor; - ComputeBackgroundAnchorPoint(aColor, aBounds, + ComputeBackgroundAnchorPoint(aColor, paddingArea, tileWidth, tileHeight, anchor); - // Setup clipping so that rendering doesn't leak out of the dirty rect + // Setup clipping so that rendering doesn't leak out of the computed + // dirty rect PRBool clipState; aRenderingContext.PushState(); - aRenderingContext.SetClipRect(aDirtyRect, nsClipCombine_kIntersect, + aRenderingContext.SetClipRect(dirtyRect, nsClipCombine_kIntersect, clipState); // Compute the x and y starting points and limits for tiling nscoord x0, x1; if (NS_STYLE_BG_REPEAT_X & aColor.mBackgroundRepeat) { - // When tiling in the x direction, adjust the starting position - // of the tile to account for the aDirtyRect.x. When tiling in - // x, the anchor.x value will be a negative value used to adjust - // the starting coordinate. - x0 = (aDirtyRect.x / tileWidth) * tileWidth + anchor.x; + // When tiling in the x direction, adjust the starting position of the + // tile to account for dirtyRect.x. When tiling in x, the anchor.x value + // will be a negative value used to adjust the starting coordinate. + x0 = (dirtyRect.x / tileWidth) * tileWidth + anchor.x; x1 = x0 + xDistance + tileWidth; if (0 != anchor.x) { x1 += tileWidth; } } else { - // When tiling is off in x, anchor.x is relative to aBounds.x - x0 = aBounds.x + anchor.x; + // When tiling is off in x, anchor.x is relative to padding area + x0 = paddingArea.x + anchor.x; x1 = x0 + tileWidth; } nscoord y0, y1; if (NS_STYLE_BG_REPEAT_Y & aColor.mBackgroundRepeat) { - // When tiling in the y direction, adjust the starting position - // of the tile to account for the aDirtyRect.y. When tiling in - // y, the anchor.y value will be a negative value used to adjust - // the starting coordinate. - y0 = (aDirtyRect.y / tileHeight) * tileHeight + anchor.y; + // When tiling in the y direction, adjust the starting position of the + // tile to account for dirtyRect.y. When tiling in y, the anchor.y value + // will be a negative value used to adjust the starting coordinate. + y0 = (dirtyRect.y / tileHeight) * tileHeight + anchor.y; y1 = y0 + yDistance + tileHeight; if (0 != anchor.y) { y1 += tileHeight; } } else { - // When tiling is off in y, anchor.y is relative to aBounds.y - y0 = aBounds.y + anchor.y; + // When tiling is off in y, anchor.y is relative to padding area + y0 = paddingArea.y + anchor.y; y1 = y0 + tileHeight; } @@ -1764,13 +1783,16 @@ nsCSSRendering::PaintBackground(nsIPresContext& aPresContext, // Restore clipping aRenderingContext.PopState(clipState); + } else { + // See if there's a background color specified. The background color + // is rendered over the 'border' 'padding' and 'content' areas if (0 == (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) { // XXX This step can be avoided if we have an image and it doesn't // have any transparent pixels, and the image is tiled in both // the x and the y aRenderingContext.SetColor(aColor.mBackgroundColor); - aRenderingContext.FillRect(aBounds); + aRenderingContext.FillRect(aBorderArea); } } } diff --git a/layout/html/style/src/nsCSSRendering.h b/layout/html/style/src/nsCSSRendering.h index cb8317fd6cb..5a3e0db80de 100644 --- a/layout/html/style/src/nsCSSRendering.h +++ b/layout/html/style/src/nsCSSRendering.h @@ -29,14 +29,14 @@ public: * for borders. aSkipSides is a bitmask of the sides to skip * when rendering. If 0 then no sides are skipped. * - * Both aDirtyRect and aBounds are in the local coordinate space + * Both aDirtyRect and aBorderArea are in the local coordinate space * of aForFrame */ static void PaintBorder(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleSpacing& aStyle, PRIntn aSkipSides, nsRect* aGap = 0); @@ -49,14 +49,14 @@ public: * for borders. aSkipSides is a bitmask of the sides to skip * when rendering. If 0 then no sides are skipped. * - * Both aDirtyRect and aBounds are in the local coordinate space + * Both aDirtyRect and aBorderArea are in the local coordinate space * of aForFrame */ static void PaintBorderEdges(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, nsBorderEdges * aBorderEdges, PRIntn aSkipSides, nsRect* aGap = 0); @@ -66,15 +66,16 @@ public: * Render the background for an element using css rendering rules * for backgrounds. * - * Both aDirtyRect and aBounds are in the local coordinate space + * Both aDirtyRect and aBorderArea are in the local coordinate space * of aForFrame */ static void PaintBackground(nsIPresContext& aPresContext, nsIRenderingContext& aRenderingContext, nsIFrame* aForFrame, const nsRect& aDirtyRect, - const nsRect& aBounds, + const nsRect& aBorderArea, const nsStyleColor& aColor, + const nsStyleSpacing& aStyle, nscoord aDX, nscoord aDY); diff --git a/layout/html/table/src/nsTableCellFrame.cpp b/layout/html/table/src/nsTableCellFrame.cpp index d2cfebf2e2a..7ddcbaba8c5 100644 --- a/layout/html/table/src/nsTableCellFrame.cpp +++ b/layout/html/table/src/nsTableCellFrame.cpp @@ -122,7 +122,7 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *myColor, 0, 0); + aDirtyRect, rect, *myColor, *mySpacing, 0, 0); // empty cells do not render their border PRBool renderBorder = PR_TRUE; diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index 4445e3077ea..a3031627311 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -2212,7 +2212,7 @@ NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); PRIntn skipSides = GetSkipSides(); if (NS_STYLE_BORDER_SEPARATE==tableStyle->mBorderCollapse) { diff --git a/layout/tables/nsTableCellFrame.cpp b/layout/tables/nsTableCellFrame.cpp index d2cfebf2e2a..7ddcbaba8c5 100644 --- a/layout/tables/nsTableCellFrame.cpp +++ b/layout/tables/nsTableCellFrame.cpp @@ -122,7 +122,7 @@ NS_METHOD nsTableCellFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *myColor, 0, 0); + aDirtyRect, rect, *myColor, *mySpacing, 0, 0); // empty cells do not render their border PRBool renderBorder = PR_TRUE; diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index 4445e3077ea..a3031627311 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -2212,7 +2212,7 @@ NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, rect, *color, 0, 0); + aDirtyRect, rect, *color, *spacing, 0, 0); PRIntn skipSides = GetSkipSides(); if (NS_STYLE_BORDER_SEPARATE==tableStyle->mBorderCollapse) {