From 2381754d68a3f4762a41b14ab70280ed4572a5b8 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 21 Apr 1999 21:27:50 +0000 Subject: [PATCH] Changed CreateViewForFrame() so it takes into account fixed background attachments and sets NS_VIEW_PUBLIC_FLAG_DONT_BITBLT --- layout/generic/nsHTMLContainerFrame.cpp | 15 +++++++++++++++ layout/html/base/src/nsHTMLContainerFrame.cpp | 15 +++++++++++++++ 2 files changed, 30 insertions(+) diff --git a/layout/generic/nsHTMLContainerFrame.cpp b/layout/generic/nsHTMLContainerFrame.cpp index 36ab64ce51d..018c150a9af 100644 --- a/layout/generic/nsHTMLContainerFrame.cpp +++ b/layout/generic/nsHTMLContainerFrame.cpp @@ -219,6 +219,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, // If we don't yet have a view, see if we need a view if (nsnull == view) { PRInt32 zIndex = 0; + PRBool fixedBackgroundAttachment = PR_FALSE; // Get nsStyleColor and nsStyleDisplay const nsStyleColor* color = (const nsStyleColor*) @@ -287,6 +288,14 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, } } + // See if the frame has a fixed background attachment + if (!aForce) { + if (NS_STYLE_BG_ATTACHMENT_FIXED == color->mBackgroundAttachment) { + aForce = PR_TRUE; + fixedBackgroundAttachment = PR_TRUE; + } + } + // See if the frame is a scrolled frame if (!aForce) { nsIAtom* pseudoTag; @@ -338,6 +347,12 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, viewManager->InsertChild(parentView, view, zIndex); } + // If the frame has a fixed background attachment, then indicate that the + // view's contents should repainted and not bitblt'd + PRUint32 viewFlags; + view->GetViewFlags(&viewFlags); + view->SetViewFlags(viewFlags | NS_VIEW_PUBLIC_FLAG_DONT_BITBLT); + // If the background color is transparent or the visibility is hidden // then mark the view as having transparent content. // XXX We could try and be smarter about this and check whether there's diff --git a/layout/html/base/src/nsHTMLContainerFrame.cpp b/layout/html/base/src/nsHTMLContainerFrame.cpp index 36ab64ce51d..018c150a9af 100644 --- a/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -219,6 +219,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, // If we don't yet have a view, see if we need a view if (nsnull == view) { PRInt32 zIndex = 0; + PRBool fixedBackgroundAttachment = PR_FALSE; // Get nsStyleColor and nsStyleDisplay const nsStyleColor* color = (const nsStyleColor*) @@ -287,6 +288,14 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, } } + // See if the frame has a fixed background attachment + if (!aForce) { + if (NS_STYLE_BG_ATTACHMENT_FIXED == color->mBackgroundAttachment) { + aForce = PR_TRUE; + fixedBackgroundAttachment = PR_TRUE; + } + } + // See if the frame is a scrolled frame if (!aForce) { nsIAtom* pseudoTag; @@ -338,6 +347,12 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, viewManager->InsertChild(parentView, view, zIndex); } + // If the frame has a fixed background attachment, then indicate that the + // view's contents should repainted and not bitblt'd + PRUint32 viewFlags; + view->GetViewFlags(&viewFlags); + view->SetViewFlags(viewFlags | NS_VIEW_PUBLIC_FLAG_DONT_BITBLT); + // If the background color is transparent or the visibility is hidden // then mark the view as having transparent content. // XXX We could try and be smarter about this and check whether there's