From b19ff5f47202290a4cb86f1de6e13387022c1470 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Mon, 20 Jul 1998 23:58:00 +0000 Subject: [PATCH] Changed Paint() to use the parent frame's color style struct. We can't use our color style struct because we're a pseudo frame and so the style system forces us to have a transparent background --- layout/html/table/src/nsTableFrame.cpp | 23 +++++++++++------------ layout/tables/nsTableFrame.cpp | 23 +++++++++++------------ 2 files changed, 22 insertions(+), 24 deletions(-) diff --git a/layout/html/table/src/nsTableFrame.cpp b/layout/html/table/src/nsTableFrame.cpp index a8e69f85267..07fdb3de019 100644 --- a/layout/html/table/src/nsTableFrame.cpp +++ b/layout/html/table/src/nsTableFrame.cpp @@ -1058,19 +1058,18 @@ NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext, (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); if (disp->mVisible) { - const nsStyleColor* myColor = - (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color); - const nsStyleSpacing* mySpacing = + const nsStyleSpacing* spacing = (const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing); - NS_ASSERTION(nsnull != myColor, "null style color"); - NS_ASSERTION(nsnull != mySpacing, "null style spacing"); - if (nsnull!=mySpacing) - { - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *mySpacing, 0); - } + + // Use our parent's color style structure, because we're a pseudo frame + // and that the style system marks us as having a transparent background + const nsStyleColor* color; + mGeometricParent->GetStyleData(eStyleStruct_Color, (nsStyleStruct*&)color); + + nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, + aDirtyRect, mRect, *color); + nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, + aDirtyRect, mRect, *spacing, 0); } // for debug... diff --git a/layout/tables/nsTableFrame.cpp b/layout/tables/nsTableFrame.cpp index a8e69f85267..07fdb3de019 100644 --- a/layout/tables/nsTableFrame.cpp +++ b/layout/tables/nsTableFrame.cpp @@ -1058,19 +1058,18 @@ NS_METHOD nsTableFrame::Paint(nsIPresContext& aPresContext, (const nsStyleDisplay*)mStyleContext->GetStyleData(eStyleStruct_Display); if (disp->mVisible) { - const nsStyleColor* myColor = - (const nsStyleColor*)mStyleContext->GetStyleData(eStyleStruct_Color); - const nsStyleSpacing* mySpacing = + const nsStyleSpacing* spacing = (const nsStyleSpacing*)mStyleContext->GetStyleData(eStyleStruct_Spacing); - NS_ASSERTION(nsnull != myColor, "null style color"); - NS_ASSERTION(nsnull != mySpacing, "null style spacing"); - if (nsnull!=mySpacing) - { - nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *myColor); - nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, - aDirtyRect, mRect, *mySpacing, 0); - } + + // Use our parent's color style structure, because we're a pseudo frame + // and that the style system marks us as having a transparent background + const nsStyleColor* color; + mGeometricParent->GetStyleData(eStyleStruct_Color, (nsStyleStruct*&)color); + + nsCSSRendering::PaintBackground(aPresContext, aRenderingContext, this, + aDirtyRect, mRect, *color); + nsCSSRendering::PaintBorder(aPresContext, aRenderingContext, this, + aDirtyRect, mRect, *spacing, 0); } // for debug...