From ad79d0e7daac29168a73137a88295fd6ff0cc98c Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Sun, 23 Feb 2003 02:49:22 +0000 Subject: [PATCH] Bug 191938. 'Dont print backgrounds' by setting background to white. also clean up unused params and make background-attachment:fixed work in printing/printpreview. r+sr=bzbarsky git-svn-id: svn://10.0.0.236/trunk@138258 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/content/base/src/nsPrintEngine.cpp | 26 ++------ mozilla/layout/base/nsCSSRendering.cpp | 62 +++++++++++-------- mozilla/layout/base/nsCSSRendering.h | 12 +--- mozilla/layout/base/nsLayoutUtils.cpp | 16 +++++ mozilla/layout/base/nsLayoutUtils.h | 5 ++ mozilla/layout/base/public/nsLayoutUtils.h | 5 ++ mozilla/layout/base/src/nsLayoutUtils.cpp | 16 +++++ .../layout/forms/nsButtonFrameRenderer.cpp | 2 +- mozilla/layout/forms/nsFieldSetFrame.cpp | 2 +- .../forms/nsGfxCheckboxControlFrame.cpp | 2 +- .../layout/forms/nsGfxRadioControlFrame.cpp | 3 +- mozilla/layout/generic/nsFrame.cpp | 5 +- mozilla/layout/generic/nsFrame.h | 3 +- mozilla/layout/generic/nsPageFrame.cpp | 2 +- mozilla/layout/html/base/src/nsFrame.cpp | 5 +- mozilla/layout/html/base/src/nsFrame.h | 3 +- mozilla/layout/html/base/src/nsHRFrame.cpp | 4 +- mozilla/layout/html/base/src/nsPageFrame.cpp | 2 +- .../html/forms/src/nsButtonFrameRenderer.cpp | 2 +- .../layout/html/forms/src/nsFieldSetFrame.cpp | 2 +- .../forms/src/nsGfxCheckboxControlFrame.cpp | 2 +- .../html/forms/src/nsGfxRadioControlFrame.cpp | 3 +- .../layout/html/style/src/nsCSSRendering.cpp | 62 +++++++++++-------- .../layout/html/style/src/nsCSSRendering.h | 12 +--- .../html/table/src/nsTableCellFrame.cpp | 4 +- .../layout/html/table/src/nsTableFrame.cpp | 2 +- .../layout/mathml/base/src/nsMathMLChar.cpp | 4 +- mozilla/layout/printing/nsPrintEngine.cpp | 26 ++------ .../svg/base/src/nsSVGOuterSVGFrame.cpp | 2 +- mozilla/layout/tables/nsTableCellFrame.cpp | 4 +- mozilla/layout/tables/nsTableFrame.cpp | 2 +- mozilla/layout/xul/base/src/nsBoxFrame.cpp | 2 +- .../layout/xul/base/src/nsGroupBoxFrame.cpp | 2 +- .../xul/base/src/tree/src/nsTreeBodyFrame.cpp | 2 +- 34 files changed, 163 insertions(+), 145 deletions(-) diff --git a/mozilla/content/base/src/nsPrintEngine.cpp b/mozilla/content/base/src/nsPrintEngine.cpp index 5655bfd8e0e..5b9aba6888a 100644 --- a/mozilla/content/base/src/nsPrintEngine.cpp +++ b/mozilla/content/base/src/nsPrintEngine.cpp @@ -133,6 +133,7 @@ static const char* kPrintingPromptService = "@mozilla.org/embedcomp/printingprom #include "nsLayoutCID.h" #include "nsGenericHTMLElement.h" #include "nsIPresShell.h" +#include "nsLayoutUtils.h" #include "nsViewsCID.h" #include "nsWidgetsCID.h" @@ -3687,25 +3688,6 @@ nsPrintEngine::DoProgressForSeparateFrames() } } -/** --------------------------------------------------- - * Giving a child frame it searches "up" the tree until it - * finds a "Page" frame. - */ -static nsIFrame * GetPageFrame(nsIFrame * aFrame) -{ - nsIFrame * frame = aFrame; - while (frame != nsnull) { - nsCOMPtr type; - frame->GetFrameType(getter_AddRefs(type)); - if (type.get() == nsLayoutAtoms::pageFrame) { - return frame; - } - frame->GetParent(&frame); - } - return nsnull; -} - - /** --------------------------------------------------- * Find by checking content's tag type */ @@ -3900,12 +3882,12 @@ nsPrintEngine::GetPageRangeForSelection(nsIPresShell * aPresShell, // the FindSelectionBounds step, but walking up to find // the parent of a child frame isn't expensive and it makes // FindSelectionBounds a little easier to understand - startPageFrame = GetPageFrame(startFrame); + startPageFrame = nsLayoutUtils::GetPageFrame(startFrame); endPageFrame = startPageFrame; aEndRect = aStartRect; } else { - startPageFrame = GetPageFrame(startFrame); - endPageFrame = GetPageFrame(endFrame); + startPageFrame = nsLayoutUtils::GetPageFrame(startFrame); + endPageFrame = nsLayoutUtils::GetPageFrame(endFrame); } } else { return NS_ERROR_FAILURE; diff --git a/mozilla/layout/base/nsCSSRendering.cpp b/mozilla/layout/base/nsCSSRendering.cpp index 9859ad4fd65..acae38a40b8 100644 --- a/mozilla/layout/base/nsCSSRendering.cpp +++ b/mozilla/layout/base/nsCSSRendering.cpp @@ -63,6 +63,7 @@ #include "nsIServiceManager.h" #include "nsIDOMHTMLBodyElement.h" #include "nsIDOMHTMLDocument.h" +#include "nsLayoutUtils.h" #define BORDER_FULL 0 //entire side #define BORDER_INSIDE 1 //inside half @@ -2749,8 +2750,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext, const nsRect& aBorderArea, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY,PRBool aUsePrintSettings) + PRBool aUsePrintSettings) { NS_PRECONDITION(aForFrame, "Frame is expected to be provided to PaintBackground"); @@ -2786,7 +2786,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext, if (!isCanvas) { PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame, aDirtyRect, aBorderArea, *color, aBorder, - aPadding, aDX, aDY, aUsePrintSettings); + aPadding, aUsePrintSettings); return; } @@ -2827,7 +2827,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext, PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame, aDirtyRect, aBorderArea, canvasColor, - aBorder, aPadding, aDX, aDY, aUsePrintSettings); + aBorder, aPadding, aUsePrintSettings); } void @@ -2839,24 +2839,19 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY, PRBool aUsePrintSettings) { NS_PRECONDITION(aForFrame, "Frame is expected to be provided to PaintBackground"); - // if we are printing, bail for now - PRBool canDrawBackgroundImage=PR_TRUE,canDrawBackgroundColor=PR_TRUE; - if(aUsePrintSettings){ + PRBool canDrawBackgroundImage = PR_TRUE; + PRBool canDrawBackgroundColor = PR_TRUE; + + if (aUsePrintSettings) { aPresContext->GetBackgroundImageDraw(canDrawBackgroundImage); aPresContext->GetBackgroundColorDraw(canDrawBackgroundColor); - - // only turn off background printing if we are currently printing. - if(!canDrawBackgroundImage && !canDrawBackgroundColor){ - return; - } } + // Check to see if we have an appearance defined. If so, we let the theme // renderer draw the background and bail out. const nsStyleDisplay* displayData; @@ -2890,9 +2885,9 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, } // if there is no background image or background images are turned off, try a color. - if (aColor.mBackgroundImage.IsEmpty() || (canDrawBackgroundColor && !canDrawBackgroundImage)) { + if (aColor.mBackgroundImage.IsEmpty() || !canDrawBackgroundImage) { PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea, - aColor, aBorder, aPadding, aDX, aDY); + aColor, aBorder, aPadding, canDrawBackgroundColor); return; } @@ -2915,7 +2910,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, if (NS_FAILED(rv) || !req || !(status & imgIRequest::STATUS_FRAME_COMPLETE) || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) { PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea, - aColor, aBorder, aPadding, aDX, aDY); + aColor, aBorder, aPadding, canDrawBackgroundColor); return; } @@ -3011,7 +3006,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, // The background color is rendered over the 'background-clip' area if (needBackgroundColor) { PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea, - aColor, aBorder, aPadding, aDX, aDY); + aColor, aBorder, aPadding, canDrawBackgroundColor); } if ((tileWidth == 0) || (tileHeight == 0) || dirtyRect.IsEmpty()) { @@ -3057,6 +3052,14 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, presShell->GetRootFrame(&rootFrame); NS_ASSERTION(rootFrame, "no root frame"); + PRBool isPaginated = PR_FALSE; + aPresContext->IsPaginated(&isPaginated); + if (isPaginated) { + nsIFrame* page = nsLayoutUtils::GetPageFrame(aForFrame); + NS_ASSERTION(page, "no page"); + rootFrame = page; + } + rootFrame->GetView(aPresContext, &viewportView); NS_ASSERTION(viewportView, "no viewport view"); viewportView->GetBounds(viewportArea); @@ -3321,8 +3324,7 @@ nsCSSRendering::PaintBackgroundColor(nsIPresContext* aPresContext, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY) + PRBool aCanPaintNonWhite) { if (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) { // nothing to paint @@ -3364,7 +3366,8 @@ nsCSSRendering::PaintBackgroundColor(nsIPresContext* aPresContext, for (side = 0; side < 4; ++side) { if (borderRadii[side] > 0) { PaintRoundedBackground(aPresContext, aRenderingContext, aForFrame, - bgClipArea, aColor, aBorder, aDX, aDY, borderRadii); + bgClipArea, aColor, aBorder, borderRadii, + aCanPaintNonWhite); return; } } @@ -3379,7 +3382,11 @@ nsCSSRendering::PaintBackgroundColor(nsIPresContext* aPresContext, bgClipArea.Deflate(border); } - aRenderingContext.SetColor(aColor.mBackgroundColor); + nscolor color = aColor.mBackgroundColor; + if (!aCanPaintNonWhite) { + color = NS_RGB(255, 255, 255); + } + aRenderingContext.SetColor(color); aRenderingContext.FillRect(bgClipArea); } @@ -3394,9 +3401,8 @@ nsCSSRendering::PaintRoundedBackground(nsIPresContext* aPresContext, const nsRect& aBgClipArea, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, - nscoord aDX, - nscoord aDY, - PRInt16 aTheRadius[4]) + PRInt16 aTheRadius[4], + PRBool aCanPaintNonWhite) { RoundedRect outerPath; QBCurve cr1,cr2,cr3,cr4; @@ -3412,7 +3418,11 @@ nsCSSRendering::PaintRoundedBackground(nsIPresContext* aPresContext, aPresContext->GetPixelsToTwips(&p2t); twipsPerPixel = NSToCoordRound(p2t); - aRenderingContext.SetColor(aColor.mBackgroundColor); + nscolor color = aColor.mBackgroundColor; + if (!aCanPaintNonWhite) { + color = NS_RGB(255, 255, 255); + } + aRenderingContext.SetColor(color); // Adjust for background-clip, if necessary if (aColor.mBackgroundClip != NS_STYLE_BG_CLIP_BORDER) { diff --git a/mozilla/layout/base/nsCSSRendering.h b/mozilla/layout/base/nsCSSRendering.h index ce3e138e10c..8f4f2e6c895 100644 --- a/mozilla/layout/base/nsCSSRendering.h +++ b/mozilla/layout/base/nsCSSRendering.h @@ -140,8 +140,6 @@ public: const nsRect& aBorderArea, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY, PRBool aUsePrintSettings); /** @@ -157,8 +155,6 @@ public: const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY, PRBool aUsePrintSettings=PR_FALSE); /** * Called by the presShell when painting is finished, so we can clear our @@ -249,8 +245,7 @@ protected: const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY); + PRBool aCanPaintNonWhite); static void PaintRoundedBackground(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, @@ -258,9 +253,8 @@ protected: const nsRect& aBorderArea, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, - nscoord aDX, - nscoord aDY, - PRInt16 aTheRadius[4]); + PRInt16 aTheRadius[4], + PRBool aCanPaintNonWhite); static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style, nscolor aBackgroundColor, diff --git a/mozilla/layout/base/nsLayoutUtils.cpp b/mozilla/layout/base/nsLayoutUtils.cpp index 368b9db9164..d846e136942 100644 --- a/mozilla/layout/base/nsLayoutUtils.cpp +++ b/mozilla/layout/base/nsLayoutUtils.cpp @@ -40,6 +40,7 @@ #include "nsIPresContext.h" #include "nsIContent.h" #include "nsFrameList.h" +#include "nsLayoutAtoms.h" /** * A namespace class for static layout utilities. @@ -161,3 +162,18 @@ nsLayoutUtils::GetAfterFrame(nsIFrame* aFrame, nsIPresContext* aPresContext) return nsnull; } + +nsIFrame* +nsLayoutUtils::GetPageFrame(nsIFrame* aFrame) +{ + nsIFrame* frame = aFrame; + while (frame) { + nsCOMPtr type; + frame->GetFrameType(getter_AddRefs(type)); + if (type.get() == nsLayoutAtoms::pageFrame) { + return frame; + } + frame->GetParent(&frame); + } + return nsnull; +} diff --git a/mozilla/layout/base/nsLayoutUtils.h b/mozilla/layout/base/nsLayoutUtils.h index fed01d4d3a2..40e78783f6a 100644 --- a/mozilla/layout/base/nsLayoutUtils.h +++ b/mozilla/layout/base/nsLayoutUtils.h @@ -72,6 +72,11 @@ public: */ static nsIFrame* GetAfterFrame(nsIFrame* aFrame, nsIPresContext* aPresContext); + /** --------------------------------------------------- + * Giving a child frame it searches "up" the tree until it + * finds a "Page" frame. + */ + static nsIFrame* GetPageFrame(nsIFrame* aFrame); }; #endif // nsLayoutUtils_h__ diff --git a/mozilla/layout/base/public/nsLayoutUtils.h b/mozilla/layout/base/public/nsLayoutUtils.h index fed01d4d3a2..40e78783f6a 100644 --- a/mozilla/layout/base/public/nsLayoutUtils.h +++ b/mozilla/layout/base/public/nsLayoutUtils.h @@ -72,6 +72,11 @@ public: */ static nsIFrame* GetAfterFrame(nsIFrame* aFrame, nsIPresContext* aPresContext); + /** --------------------------------------------------- + * Giving a child frame it searches "up" the tree until it + * finds a "Page" frame. + */ + static nsIFrame* GetPageFrame(nsIFrame* aFrame); }; #endif // nsLayoutUtils_h__ diff --git a/mozilla/layout/base/src/nsLayoutUtils.cpp b/mozilla/layout/base/src/nsLayoutUtils.cpp index 368b9db9164..d846e136942 100644 --- a/mozilla/layout/base/src/nsLayoutUtils.cpp +++ b/mozilla/layout/base/src/nsLayoutUtils.cpp @@ -40,6 +40,7 @@ #include "nsIPresContext.h" #include "nsIContent.h" #include "nsFrameList.h" +#include "nsLayoutAtoms.h" /** * A namespace class for static layout utilities. @@ -161,3 +162,18 @@ nsLayoutUtils::GetAfterFrame(nsIFrame* aFrame, nsIPresContext* aPresContext) return nsnull; } + +nsIFrame* +nsLayoutUtils::GetPageFrame(nsIFrame* aFrame) +{ + nsIFrame* frame = aFrame; + while (frame) { + nsCOMPtr type; + frame->GetFrameType(getter_AddRefs(type)); + if (type.get() == nsLayoutAtoms::pageFrame) { + return frame; + } + frame->GetParent(&frame); + } + return nsnull; +} diff --git a/mozilla/layout/forms/nsButtonFrameRenderer.cpp b/mozilla/layout/forms/nsButtonFrameRenderer.cpp index e590b9812e5..02dd9cd892f 100644 --- a/mozilla/layout/forms/nsButtonFrameRenderer.cpp +++ b/mozilla/layout/forms/nsButtonFrameRenderer.cpp @@ -183,7 +183,7 @@ nsButtonFrameRenderer::PaintBorderAndBackground(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, mFrame, aDirtyRect, buttonRect, *border, *padding, - 0, 0, PR_FALSE); + PR_FALSE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame, aDirtyRect, buttonRect, *border, context, 0); } diff --git a/mozilla/layout/forms/nsFieldSetFrame.cpp b/mozilla/layout/forms/nsFieldSetFrame.cpp index 5ab147cc0ff..a261c41116c 100644 --- a/mozilla/layout/forms/nsFieldSetFrame.cpp +++ b/mozilla/layout/forms/nsFieldSetFrame.cpp @@ -217,7 +217,7 @@ nsFieldSetFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *borderStyle, - *paddingStyle, 0, 0, PR_TRUE); + *paddingStyle, PR_TRUE); if (mLegendFrame) { diff --git a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp index 1388f22b18a..ab6f630a9ba 100644 --- a/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxCheckboxControlFrame.cpp @@ -250,7 +250,7 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myBorder, *myPadding, - 0, 0, PR_FALSE); + PR_FALSE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myBorder, mCheckButtonFaceStyle, 0); doDefaultPainting = PR_FALSE; diff --git a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp index 8bf0401f39a..e37280c6053 100644 --- a/mozilla/layout/forms/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/forms/nsGfxRadioControlFrame.cpp @@ -213,8 +213,7 @@ nsGfxRadioControlFrame::PaintRadioButton(nsIPresContext* aPresContext, tmpColor.mBackgroundColor = color->mColor; nsCSSRendering::PaintBackgroundWithSC(aPresContext, aRenderingContext, this, aDirtyRect, rect, - tmpColor, *myBorder, *myPadding, - 0, 0); + tmpColor, *myBorder, *myPadding, PR_FALSE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myBorder, mRadioButtonFaceStyle, 0); } diff --git a/mozilla/layout/generic/nsFrame.cpp b/mozilla/layout/generic/nsFrame.cpp index 01cfe66c430..0db0fa2c8cd 100644 --- a/mozilla/layout/generic/nsFrame.cpp +++ b/mozilla/layout/generic/nsFrame.cpp @@ -943,7 +943,8 @@ void nsFrame::PaintSelf(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, - PRIntn aSkipSides) + PRIntn aSkipSides, + PRBool aUsePrintBackgroundSettings) { // The visibility check belongs here since child elements have the // opportunity to override the visibility property and display even if @@ -968,7 +969,7 @@ nsFrame::PaintSelf(nsIPresContext* aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, *padding, - 0, 0, PR_TRUE); + aUsePrintBackgroundSettings); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, mStyleContext, aSkipSides); diff --git a/mozilla/layout/generic/nsFrame.h b/mozilla/layout/generic/nsFrame.h index d47453a203b..bd51c81d452 100644 --- a/mozilla/layout/generic/nsFrame.h +++ b/mozilla/layout/generic/nsFrame.h @@ -478,7 +478,8 @@ protected: void PaintSelf(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, - PRIntn aSkipSides = 0); + PRIntn aSkipSides = 0, + PRBool aUsePrintBackgroundSettings = PR_TRUE); PRInt16 DisplaySelection(nsIPresContext* aPresContext, PRBool isOkToTurnOn = PR_FALSE); diff --git a/mozilla/layout/generic/nsPageFrame.cpp b/mozilla/layout/generic/nsPageFrame.cpp index 817d8956eb8..013d95ca4eb 100644 --- a/mozilla/layout/generic/nsPageFrame.cpp +++ b/mozilla/layout/generic/nsPageFrame.cpp @@ -758,7 +758,7 @@ nsPageFrame::DrawBackground(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, *padding, - 0, 0, PR_TRUE); + PR_TRUE); } } diff --git a/mozilla/layout/html/base/src/nsFrame.cpp b/mozilla/layout/html/base/src/nsFrame.cpp index 01cfe66c430..0db0fa2c8cd 100644 --- a/mozilla/layout/html/base/src/nsFrame.cpp +++ b/mozilla/layout/html/base/src/nsFrame.cpp @@ -943,7 +943,8 @@ void nsFrame::PaintSelf(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, - PRIntn aSkipSides) + PRIntn aSkipSides, + PRBool aUsePrintBackgroundSettings) { // The visibility check belongs here since child elements have the // opportunity to override the visibility property and display even if @@ -968,7 +969,7 @@ nsFrame::PaintSelf(nsIPresContext* aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, *padding, - 0, 0, PR_TRUE); + aUsePrintBackgroundSettings); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, mStyleContext, aSkipSides); diff --git a/mozilla/layout/html/base/src/nsFrame.h b/mozilla/layout/html/base/src/nsFrame.h index d47453a203b..bd51c81d452 100644 --- a/mozilla/layout/html/base/src/nsFrame.h +++ b/mozilla/layout/html/base/src/nsFrame.h @@ -478,7 +478,8 @@ protected: void PaintSelf(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, const nsRect& aDirtyRect, - PRIntn aSkipSides = 0); + PRIntn aSkipSides = 0, + PRBool aUsePrintBackgroundSettings = PR_TRUE); PRInt16 DisplaySelection(nsIPresContext* aPresContext, PRBool isOkToTurnOn = PR_FALSE); diff --git a/mozilla/layout/html/base/src/nsHRFrame.cpp b/mozilla/layout/html/base/src/nsHRFrame.cpp index c7adb49d23a..354bb82a603 100644 --- a/mozilla/layout/html/base/src/nsHRFrame.cpp +++ b/mozilla/layout/html/base/src/nsHRFrame.cpp @@ -70,6 +70,8 @@ public: PRUint32 aFlags); NS_IMETHOD GetFrameType(nsIAtom** aType) const; + virtual PRBool CanPaintBackground() { return PR_FALSE; } + protected: PRBool GetNoShade(); @@ -194,7 +196,7 @@ HRuleFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this,aDirtyRect, rect, - *border, *padding, 0, 0, PR_FALSE); + *border, *padding, PR_FALSE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this,aDirtyRect, rect, *border, mStyleContext, 0); diff --git a/mozilla/layout/html/base/src/nsPageFrame.cpp b/mozilla/layout/html/base/src/nsPageFrame.cpp index 817d8956eb8..013d95ca4eb 100644 --- a/mozilla/layout/html/base/src/nsPageFrame.cpp +++ b/mozilla/layout/html/base/src/nsPageFrame.cpp @@ -758,7 +758,7 @@ nsPageFrame::DrawBackground(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, *padding, - 0, 0, PR_TRUE); + PR_TRUE); } } diff --git a/mozilla/layout/html/forms/src/nsButtonFrameRenderer.cpp b/mozilla/layout/html/forms/src/nsButtonFrameRenderer.cpp index e590b9812e5..02dd9cd892f 100644 --- a/mozilla/layout/html/forms/src/nsButtonFrameRenderer.cpp +++ b/mozilla/layout/html/forms/src/nsButtonFrameRenderer.cpp @@ -183,7 +183,7 @@ nsButtonFrameRenderer::PaintBorderAndBackground(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, mFrame, aDirtyRect, buttonRect, *border, *padding, - 0, 0, PR_FALSE); + PR_FALSE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, mFrame, aDirtyRect, buttonRect, *border, context, 0); } diff --git a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp index 5ab147cc0ff..a261c41116c 100644 --- a/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/mozilla/layout/html/forms/src/nsFieldSetFrame.cpp @@ -217,7 +217,7 @@ nsFieldSetFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *borderStyle, - *paddingStyle, 0, 0, PR_TRUE); + *paddingStyle, PR_TRUE); if (mLegendFrame) { diff --git a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp index 1388f22b18a..ab6f630a9ba 100644 --- a/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxCheckboxControlFrame.cpp @@ -250,7 +250,7 @@ nsGfxCheckboxControlFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myBorder, *myPadding, - 0, 0, PR_FALSE); + PR_FALSE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myBorder, mCheckButtonFaceStyle, 0); doDefaultPainting = PR_FALSE; diff --git a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp index 8bf0401f39a..e37280c6053 100644 --- a/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp +++ b/mozilla/layout/html/forms/src/nsGfxRadioControlFrame.cpp @@ -213,8 +213,7 @@ nsGfxRadioControlFrame::PaintRadioButton(nsIPresContext* aPresContext, tmpColor.mBackgroundColor = color->mColor; nsCSSRendering::PaintBackgroundWithSC(aPresContext, aRenderingContext, this, aDirtyRect, rect, - tmpColor, *myBorder, *myPadding, - 0, 0); + tmpColor, *myBorder, *myPadding, PR_FALSE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, rect, *myBorder, mRadioButtonFaceStyle, 0); } diff --git a/mozilla/layout/html/style/src/nsCSSRendering.cpp b/mozilla/layout/html/style/src/nsCSSRendering.cpp index 9859ad4fd65..acae38a40b8 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.cpp +++ b/mozilla/layout/html/style/src/nsCSSRendering.cpp @@ -63,6 +63,7 @@ #include "nsIServiceManager.h" #include "nsIDOMHTMLBodyElement.h" #include "nsIDOMHTMLDocument.h" +#include "nsLayoutUtils.h" #define BORDER_FULL 0 //entire side #define BORDER_INSIDE 1 //inside half @@ -2749,8 +2750,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext, const nsRect& aBorderArea, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY,PRBool aUsePrintSettings) + PRBool aUsePrintSettings) { NS_PRECONDITION(aForFrame, "Frame is expected to be provided to PaintBackground"); @@ -2786,7 +2786,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext, if (!isCanvas) { PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame, aDirtyRect, aBorderArea, *color, aBorder, - aPadding, aDX, aDY, aUsePrintSettings); + aPadding, aUsePrintSettings); return; } @@ -2827,7 +2827,7 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext, PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame, aDirtyRect, aBorderArea, canvasColor, - aBorder, aPadding, aDX, aDY, aUsePrintSettings); + aBorder, aPadding, aUsePrintSettings); } void @@ -2839,24 +2839,19 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY, PRBool aUsePrintSettings) { NS_PRECONDITION(aForFrame, "Frame is expected to be provided to PaintBackground"); - // if we are printing, bail for now - PRBool canDrawBackgroundImage=PR_TRUE,canDrawBackgroundColor=PR_TRUE; - if(aUsePrintSettings){ + PRBool canDrawBackgroundImage = PR_TRUE; + PRBool canDrawBackgroundColor = PR_TRUE; + + if (aUsePrintSettings) { aPresContext->GetBackgroundImageDraw(canDrawBackgroundImage); aPresContext->GetBackgroundColorDraw(canDrawBackgroundColor); - - // only turn off background printing if we are currently printing. - if(!canDrawBackgroundImage && !canDrawBackgroundColor){ - return; - } } + // Check to see if we have an appearance defined. If so, we let the theme // renderer draw the background and bail out. const nsStyleDisplay* displayData; @@ -2890,9 +2885,9 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, } // if there is no background image or background images are turned off, try a color. - if (aColor.mBackgroundImage.IsEmpty() || (canDrawBackgroundColor && !canDrawBackgroundImage)) { + if (aColor.mBackgroundImage.IsEmpty() || !canDrawBackgroundImage) { PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea, - aColor, aBorder, aPadding, aDX, aDY); + aColor, aBorder, aPadding, canDrawBackgroundColor); return; } @@ -2915,7 +2910,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, if (NS_FAILED(rv) || !req || !(status & imgIRequest::STATUS_FRAME_COMPLETE) || !(status & imgIRequest::STATUS_SIZE_AVAILABLE)) { PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea, - aColor, aBorder, aPadding, aDX, aDY); + aColor, aBorder, aPadding, canDrawBackgroundColor); return; } @@ -3011,7 +3006,7 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, // The background color is rendered over the 'background-clip' area if (needBackgroundColor) { PaintBackgroundColor(aPresContext, aRenderingContext, aForFrame, bgClipArea, - aColor, aBorder, aPadding, aDX, aDY); + aColor, aBorder, aPadding, canDrawBackgroundColor); } if ((tileWidth == 0) || (tileHeight == 0) || dirtyRect.IsEmpty()) { @@ -3057,6 +3052,14 @@ nsCSSRendering::PaintBackgroundWithSC(nsIPresContext* aPresContext, presShell->GetRootFrame(&rootFrame); NS_ASSERTION(rootFrame, "no root frame"); + PRBool isPaginated = PR_FALSE; + aPresContext->IsPaginated(&isPaginated); + if (isPaginated) { + nsIFrame* page = nsLayoutUtils::GetPageFrame(aForFrame); + NS_ASSERTION(page, "no page"); + rootFrame = page; + } + rootFrame->GetView(aPresContext, &viewportView); NS_ASSERTION(viewportView, "no viewport view"); viewportView->GetBounds(viewportArea); @@ -3321,8 +3324,7 @@ nsCSSRendering::PaintBackgroundColor(nsIPresContext* aPresContext, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY) + PRBool aCanPaintNonWhite) { if (aColor.mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT) { // nothing to paint @@ -3364,7 +3366,8 @@ nsCSSRendering::PaintBackgroundColor(nsIPresContext* aPresContext, for (side = 0; side < 4; ++side) { if (borderRadii[side] > 0) { PaintRoundedBackground(aPresContext, aRenderingContext, aForFrame, - bgClipArea, aColor, aBorder, aDX, aDY, borderRadii); + bgClipArea, aColor, aBorder, borderRadii, + aCanPaintNonWhite); return; } } @@ -3379,7 +3382,11 @@ nsCSSRendering::PaintBackgroundColor(nsIPresContext* aPresContext, bgClipArea.Deflate(border); } - aRenderingContext.SetColor(aColor.mBackgroundColor); + nscolor color = aColor.mBackgroundColor; + if (!aCanPaintNonWhite) { + color = NS_RGB(255, 255, 255); + } + aRenderingContext.SetColor(color); aRenderingContext.FillRect(bgClipArea); } @@ -3394,9 +3401,8 @@ nsCSSRendering::PaintRoundedBackground(nsIPresContext* aPresContext, const nsRect& aBgClipArea, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, - nscoord aDX, - nscoord aDY, - PRInt16 aTheRadius[4]) + PRInt16 aTheRadius[4], + PRBool aCanPaintNonWhite) { RoundedRect outerPath; QBCurve cr1,cr2,cr3,cr4; @@ -3412,7 +3418,11 @@ nsCSSRendering::PaintRoundedBackground(nsIPresContext* aPresContext, aPresContext->GetPixelsToTwips(&p2t); twipsPerPixel = NSToCoordRound(p2t); - aRenderingContext.SetColor(aColor.mBackgroundColor); + nscolor color = aColor.mBackgroundColor; + if (!aCanPaintNonWhite) { + color = NS_RGB(255, 255, 255); + } + aRenderingContext.SetColor(color); // Adjust for background-clip, if necessary if (aColor.mBackgroundClip != NS_STYLE_BG_CLIP_BORDER) { diff --git a/mozilla/layout/html/style/src/nsCSSRendering.h b/mozilla/layout/html/style/src/nsCSSRendering.h index ce3e138e10c..8f4f2e6c895 100644 --- a/mozilla/layout/html/style/src/nsCSSRendering.h +++ b/mozilla/layout/html/style/src/nsCSSRendering.h @@ -140,8 +140,6 @@ public: const nsRect& aBorderArea, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY, PRBool aUsePrintSettings); /** @@ -157,8 +155,6 @@ public: const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY, PRBool aUsePrintSettings=PR_FALSE); /** * Called by the presShell when painting is finished, so we can clear our @@ -249,8 +245,7 @@ protected: const nsStyleBackground& aColor, const nsStyleBorder& aBorder, const nsStylePadding& aPadding, - nscoord aDX, - nscoord aDY); + PRBool aCanPaintNonWhite); static void PaintRoundedBackground(nsIPresContext* aPresContext, nsIRenderingContext& aRenderingContext, @@ -258,9 +253,8 @@ protected: const nsRect& aBorderArea, const nsStyleBackground& aColor, const nsStyleBorder& aBorder, - nscoord aDX, - nscoord aDY, - PRInt16 aTheRadius[4]); + PRInt16 aTheRadius[4], + PRBool aCanPaintNonWhite); static nscolor MakeBevelColor(PRIntn whichSide, PRUint8 style, nscolor aBackgroundColor, diff --git a/mozilla/layout/html/table/src/nsTableCellFrame.cpp b/mozilla/layout/html/table/src/nsTableCellFrame.cpp index a4c9884be59..9133be83975 100644 --- a/mozilla/layout/html/table/src/nsTableCellFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableCellFrame.cpp @@ -425,7 +425,7 @@ nsTableCellFrame::PaintUnderlay(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(&aPresContext, aRenderingContext, this, aDirtyRect, rect, aStyleBorder, aStylePadding, - 0, 0, PR_TRUE); + PR_TRUE); // draw the border only when there is content or showing empty cells if (!GetContentEmpty() || NS_STYLE_TABLE_EMPTY_CELLS_SHOW == aCellTableStyle.mEmptyCells) { PRIntn skipSides = GetSkipSides(); @@ -1541,7 +1541,7 @@ nsBCTableCellFrame::PaintUnderlay(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(&aPresContext, aRenderingContext, this, aDirtyRect, rect, myBorder, aStylePadding, - 0, 0, PR_TRUE); + PR_TRUE); // borders are painted by nsTableFrame } diff --git a/mozilla/layout/html/table/src/nsTableFrame.cpp b/mozilla/layout/html/table/src/nsTableFrame.cpp index 18eb03b8299..a219d7ab967 100644 --- a/mozilla/layout/html/table/src/nsTableFrame.cpp +++ b/mozilla/layout/html/table/src/nsTableFrame.cpp @@ -1470,7 +1470,7 @@ nsTableFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, *padding, - 0, 0, PR_TRUE); + PR_TRUE); // paint the border here only for separate borders if (!IsBorderCollapse()) { diff --git a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp index 1a153ca04eb..4d4f57dfe9f 100644 --- a/mozilla/layout/mathml/base/src/nsMathMLChar.cpp +++ b/mozilla/layout/mathml/base/src/nsMathMLChar.cpp @@ -1908,11 +1908,11 @@ nsMathMLChar::Paint(nsIPresContext* aPresContext, 0 == (backg->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT)) nsCSSRendering::PaintBackgroundWithSC(aPresContext, aRenderingContext, aForFrame, aDirtyRect, rect, *backg, *border, *padding, - 0, 0); + PR_TRUE); //else // our container frame will take care of painting its background // nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, aForFrame, - // aDirtyRect, rect, *border, *padding, 0, 0); + // aDirtyRect, rect, *border, *padding, PR_TRUE); #if defined(NS_DEBUG) && defined(SHOW_BOUNDING_BOX) // for visual debug PRIntn skipSides = 0; //aForFrame->GetSkipSides(); diff --git a/mozilla/layout/printing/nsPrintEngine.cpp b/mozilla/layout/printing/nsPrintEngine.cpp index 5655bfd8e0e..5b9aba6888a 100644 --- a/mozilla/layout/printing/nsPrintEngine.cpp +++ b/mozilla/layout/printing/nsPrintEngine.cpp @@ -133,6 +133,7 @@ static const char* kPrintingPromptService = "@mozilla.org/embedcomp/printingprom #include "nsLayoutCID.h" #include "nsGenericHTMLElement.h" #include "nsIPresShell.h" +#include "nsLayoutUtils.h" #include "nsViewsCID.h" #include "nsWidgetsCID.h" @@ -3687,25 +3688,6 @@ nsPrintEngine::DoProgressForSeparateFrames() } } -/** --------------------------------------------------- - * Giving a child frame it searches "up" the tree until it - * finds a "Page" frame. - */ -static nsIFrame * GetPageFrame(nsIFrame * aFrame) -{ - nsIFrame * frame = aFrame; - while (frame != nsnull) { - nsCOMPtr type; - frame->GetFrameType(getter_AddRefs(type)); - if (type.get() == nsLayoutAtoms::pageFrame) { - return frame; - } - frame->GetParent(&frame); - } - return nsnull; -} - - /** --------------------------------------------------- * Find by checking content's tag type */ @@ -3900,12 +3882,12 @@ nsPrintEngine::GetPageRangeForSelection(nsIPresShell * aPresShell, // the FindSelectionBounds step, but walking up to find // the parent of a child frame isn't expensive and it makes // FindSelectionBounds a little easier to understand - startPageFrame = GetPageFrame(startFrame); + startPageFrame = nsLayoutUtils::GetPageFrame(startFrame); endPageFrame = startPageFrame; aEndRect = aStartRect; } else { - startPageFrame = GetPageFrame(startFrame); - endPageFrame = GetPageFrame(endFrame); + startPageFrame = nsLayoutUtils::GetPageFrame(startFrame); + endPageFrame = nsLayoutUtils::GetPageFrame(endFrame); } } else { return NS_ERROR_FAILURE; diff --git a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp index cbf5a49647b..82bfc63365d 100644 --- a/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp +++ b/mozilla/layout/svg/base/src/nsSVGOuterSVGFrame.cpp @@ -804,7 +804,7 @@ nsSVGOuterSVGFrame::Paint(nsIPresContext* aPresContext, // nsRect rect(0, 0, mRect.width, mRect.height); // // nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, -// // aDirtyRect, rect, *border, *padding, 0, 0); +// // aDirtyRect, rect, *border, *padding, PR_TRUE); // nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, // aDirtyRect, rect, *border, mStyleContext, 0); // nsCSSRendering::PaintOutline(aPresContext, aRenderingContext, this, diff --git a/mozilla/layout/tables/nsTableCellFrame.cpp b/mozilla/layout/tables/nsTableCellFrame.cpp index a4c9884be59..9133be83975 100644 --- a/mozilla/layout/tables/nsTableCellFrame.cpp +++ b/mozilla/layout/tables/nsTableCellFrame.cpp @@ -425,7 +425,7 @@ nsTableCellFrame::PaintUnderlay(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(&aPresContext, aRenderingContext, this, aDirtyRect, rect, aStyleBorder, aStylePadding, - 0, 0, PR_TRUE); + PR_TRUE); // draw the border only when there is content or showing empty cells if (!GetContentEmpty() || NS_STYLE_TABLE_EMPTY_CELLS_SHOW == aCellTableStyle.mEmptyCells) { PRIntn skipSides = GetSkipSides(); @@ -1541,7 +1541,7 @@ nsBCTableCellFrame::PaintUnderlay(nsIPresContext& aPresContext, nsRect rect(0, 0, mRect.width, mRect.height); nsCSSRendering::PaintBackground(&aPresContext, aRenderingContext, this, aDirtyRect, rect, myBorder, aStylePadding, - 0, 0, PR_TRUE); + PR_TRUE); // borders are painted by nsTableFrame } diff --git a/mozilla/layout/tables/nsTableFrame.cpp b/mozilla/layout/tables/nsTableFrame.cpp index 18eb03b8299..a219d7ab967 100644 --- a/mozilla/layout/tables/nsTableFrame.cpp +++ b/mozilla/layout/tables/nsTableFrame.cpp @@ -1470,7 +1470,7 @@ nsTableFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *border, *padding, - 0, 0, PR_TRUE); + PR_TRUE); // paint the border here only for separate borders if (!IsBorderCollapse()) { diff --git a/mozilla/layout/xul/base/src/nsBoxFrame.cpp b/mozilla/layout/xul/base/src/nsBoxFrame.cpp index e32e7b167dc..8aa5413891c 100644 --- a/mozilla/layout/xul/base/src/nsBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsBoxFrame.cpp @@ -1455,7 +1455,7 @@ nsBoxFrame::Paint(nsIPresContext* aPresContext, } if (NS_FRAME_PAINT_LAYER_BACKGROUND == aWhichLayer) { - PaintSelf(aPresContext, aRenderingContext, aDirtyRect); + PaintSelf(aPresContext, aRenderingContext, aDirtyRect, 0, PR_FALSE); } nsCOMPtr frameType; diff --git a/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp b/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp index 94140dd32ea..b5715607746 100644 --- a/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp +++ b/mozilla/layout/xul/base/src/nsGroupBoxFrame.cpp @@ -164,7 +164,7 @@ nsGroupBoxFrame::Paint(nsIPresContext* aPresContext, nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, aDirtyRect, rect, *borderStyleData, - *paddingStyleData, 0, 0, PR_FALSE); + *paddingStyleData, PR_FALSE); if (groupBox) { diff --git a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp index b2c5d218f84..98872fd7d43 100644 --- a/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp +++ b/mozilla/layout/xul/base/src/tree/src/nsTreeBodyFrame.cpp @@ -3152,7 +3152,7 @@ nsTreeBodyFrame::PaintBackgroundLayer(nsStyleContext* aStyleContext, nsCSSRendering::PaintBackgroundWithSC(aPresContext, aRenderingContext, this, aDirtyRect, aRect, *myColor, *myBorder, *myPadding, - 0, 0); + PR_TRUE); nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, aDirtyRect, aRect, *myBorder, mStyleContext, 0);