mirror of
https://github.com/mozilla/gecko-dev.git
synced 2025-01-26 06:38:36 +00:00
bug=96870 Add methods onto the nsIPresContext for setting and getting the background painting
boolean so printing can turn on and off backgrounds. r=peterl sr=attinasi
This commit is contained in:
parent
a1a76076a7
commit
6c7808bbc0
@ -2354,12 +2354,12 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
|
||||
|
||||
|
||||
// if we are printing, bail for now
|
||||
nsCOMPtr<nsIPrintContext> thePrinterContext = do_QueryInterface(aPresContext);
|
||||
if (thePrinterContext) {
|
||||
PRBool canDrawBackground;
|
||||
aPresContext->GetBackgroundDraw(canDrawBackground);
|
||||
if(!canDrawBackground){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// if there is no background image, try a color.
|
||||
if (aColor.mBackgroundImage.IsEmpty()) {
|
||||
// See if there's a background color specified. The background color
|
||||
|
@ -152,6 +152,8 @@ nsPresContext::nsPresContext()
|
||||
mImageAnimationMode = imgIContainer::kNormalAnimMode;
|
||||
mImageAnimationModePref = imgIContainer::kNormalAnimMode;
|
||||
|
||||
SetBackgroundDraw(PR_TRUE); // always draw the background
|
||||
|
||||
mStopped = PR_FALSE;
|
||||
mStopChrome = PR_TRUE;
|
||||
|
||||
|
@ -508,6 +508,13 @@ public:
|
||||
* Get the document charset
|
||||
*/
|
||||
NS_IMETHOD GetBidiCharset(nsAWritableString &aCharSet) = 0;
|
||||
|
||||
/**
|
||||
* Set and get methods for controling the background drawing
|
||||
*/
|
||||
NS_IMETHOD GetBackgroundDraw(PRBool &aCanDraw)=0;
|
||||
NS_IMETHOD SetBackgroundDraw(PRBool aCanDraw)=0;
|
||||
|
||||
#endif // IBMBIDI
|
||||
|
||||
/**
|
||||
|
@ -508,6 +508,13 @@ public:
|
||||
* Get the document charset
|
||||
*/
|
||||
NS_IMETHOD GetBidiCharset(nsAWritableString &aCharSet) = 0;
|
||||
|
||||
/**
|
||||
* Set and get methods for controling the background drawing
|
||||
*/
|
||||
NS_IMETHOD GetBackgroundDraw(PRBool &aCanDraw)=0;
|
||||
NS_IMETHOD SetBackgroundDraw(PRBool aCanDraw)=0;
|
||||
|
||||
#endif // IBMBIDI
|
||||
|
||||
/**
|
||||
|
@ -508,6 +508,13 @@ public:
|
||||
* Get the document charset
|
||||
*/
|
||||
NS_IMETHOD GetBidiCharset(nsAWritableString &aCharSet) = 0;
|
||||
|
||||
/**
|
||||
* Set and get methods for controling the background drawing
|
||||
*/
|
||||
NS_IMETHOD GetBackgroundDraw(PRBool &aCanDraw)=0;
|
||||
NS_IMETHOD SetBackgroundDraw(PRBool aCanDraw)=0;
|
||||
|
||||
#endif // IBMBIDI
|
||||
|
||||
/**
|
||||
|
@ -152,6 +152,8 @@ nsPresContext::nsPresContext()
|
||||
mImageAnimationMode = imgIContainer::kNormalAnimMode;
|
||||
mImageAnimationModePref = imgIContainer::kNormalAnimMode;
|
||||
|
||||
SetBackgroundDraw(PR_TRUE); // always draw the background
|
||||
|
||||
mStopped = PR_FALSE;
|
||||
mStopChrome = PR_TRUE;
|
||||
|
||||
|
@ -167,6 +167,9 @@ public:
|
||||
NS_IMETHOD SetIsRenderingOnlySelection(PRBool aVal) { mIsRenderingOnlySelection = aVal; return NS_OK; }
|
||||
NS_IMETHOD IsRenderingOnlySelection(PRBool* aResult);
|
||||
|
||||
NS_IMETHOD GetBackgroundDraw(PRBool &aCanDraw) { aCanDraw = mDrawBackground; return NS_OK; }
|
||||
NS_IMETHOD SetBackgroundDraw(PRBool aCanDraw) { mDrawBackground = aCanDraw; return NS_OK; }
|
||||
|
||||
#ifdef MOZ_REFLOW_PERF
|
||||
NS_IMETHOD CountReflows(const char * aName, PRUint32 aType, nsIFrame * aFrame);
|
||||
NS_IMETHOD PaintCount(const char * aName, nsIRenderingContext* aRenderingContext, nsIFrame * aFrame, PRUint32 aColor);
|
||||
@ -244,6 +247,7 @@ protected:
|
||||
nscoord mDefaultBackgroundImageOffsetX;
|
||||
nscoord mDefaultBackgroundImageOffsetY;
|
||||
PRUint8 mDefaultBackgroundImageAttachment;
|
||||
PRBool mDrawBackground;
|
||||
|
||||
nsSupportsHashtable mImageLoaders;
|
||||
|
||||
|
@ -71,6 +71,7 @@ protected:
|
||||
PrintContext::PrintContext() :
|
||||
mPageDim(0,0,0,0)
|
||||
{
|
||||
SetBackgroundDraw(PR_FALSE);
|
||||
}
|
||||
|
||||
PrintContext::~PrintContext()
|
||||
|
@ -76,6 +76,7 @@ PrintPreviewContext::PrintPreviewContext() :
|
||||
mPageDim(-1,-1,-1,-1),
|
||||
mCanPaginatedScroll(PR_TRUE)
|
||||
{
|
||||
SetBackgroundDraw(PR_FALSE);
|
||||
}
|
||||
|
||||
PrintPreviewContext::~PrintPreviewContext()
|
||||
|
@ -2354,12 +2354,12 @@ nsCSSRendering::PaintBackground(nsIPresContext* aPresContext,
|
||||
|
||||
|
||||
// if we are printing, bail for now
|
||||
nsCOMPtr<nsIPrintContext> thePrinterContext = do_QueryInterface(aPresContext);
|
||||
if (thePrinterContext) {
|
||||
PRBool canDrawBackground;
|
||||
aPresContext->GetBackgroundDraw(canDrawBackground);
|
||||
if(!canDrawBackground){
|
||||
return;
|
||||
}
|
||||
|
||||
|
||||
// if there is no background image, try a color.
|
||||
if (aColor.mBackgroundImage.IsEmpty()) {
|
||||
// See if there's a background color specified. The background color
|
||||
|
Loading…
x
Reference in New Issue
Block a user