Changed the handling for fixed backgrounds a little

This commit is contained in:
troy@netscape.com
1999-04-21 22:08:01 +00:00
parent 0dd597bc73
commit 403a039d28
2 changed files with 24 additions and 28 deletions

View File

@@ -234,6 +234,12 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
aForce = PR_TRUE;
}
// See if the frame has a fixed background attachment
if (NS_STYLE_BG_ATTACHMENT_FIXED == color->mBackgroundAttachment) {
aForce = PR_TRUE;
fixedBackgroundAttachment = PR_TRUE;
}
// See if the frame is being relatively positioned or absolutely
// positioned
if (!aForce) {
@@ -288,14 +294,6 @@ 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 +336,12 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext,
aFrame->GetRect(bounds);
view->Init(viewManager, bounds, parentView);
// 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);
// Insert the view into the view hierarchy. If the parent view is a
// scrolling view we need to do this differently
nsIScrollableView* scrollingView;
@@ -347,12 +351,6 @@ 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