Make sure backgrounds are painted correctly by using the correct background to set up information on the view. b=119462 r=pierre sr=hyatt

git-svn-id: svn://10.0.0.236/trunk@112071 18797224-902f-48f8-a5cc-f745e15eee43
This commit is contained in:
dbaron%fas.harvard.edu
2002-01-14 15:00:30 +00:00
parent 034db8f206
commit 45b310844b
7 changed files with 47 additions and 21 deletions

View File

@@ -106,6 +106,7 @@
#include "nsIPrintPreviewContext.h"
#include "nsIDOMMutationEvent.h"
#include "nsChildIterator.h"
#include "nsCSSRendering.h"
static NS_DEFINE_CID(kTextNodeCID, NS_TEXTNODE_CID);
static NS_DEFINE_CID(kHTMLElementFactoryCID, NS_HTML_ELEMENT_FACTORY_CID);
@@ -9591,7 +9592,9 @@ SyncAndInvalidateView(nsIPresContext* aPresContext,
const nsStyleBackground* bg;
const nsStyleDisplay* disp;
const nsStyleVisibility* vis;
aFrame->GetStyleData(eStyleStruct_Background, (const nsStyleStruct*&) bg);
PRBool isCanvas;
PRBool hasBG =
nsCSSRendering::FindBackground(aPresContext, aFrame, &bg, &isCanvas);
aFrame->GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) disp);
aFrame->GetStyleData(eStyleStruct_Visibility, (const nsStyleStruct*&) vis);
@@ -9599,8 +9602,10 @@ SyncAndInvalidateView(nsIPresContext* aPresContext,
// See if the view should be hidden or visible
PRBool viewIsVisible = PR_TRUE;
PRBool viewHasTransparentContent = (bg->mBackgroundFlags &
NS_STYLE_BG_COLOR_TRANSPARENT) == NS_STYLE_BG_COLOR_TRANSPARENT;
PRBool viewHasTransparentContent =
!isCanvas &&
(!hasBG ||
(bg->mBackgroundFlags & NS_STYLE_BG_COLOR_TRANSPARENT));
if (NS_STYLE_VISIBILITY_COLLAPSE == vis->mVisible) {
viewIsVisible = PR_FALSE;