diff --git a/mozilla/content/base/src/nsStyleContext.cpp b/mozilla/content/base/src/nsStyleContext.cpp index c7b748e7833..154d872778b 100644 --- a/mozilla/content/base/src/nsStyleContext.cpp +++ b/mozilla/content/base/src/nsStyleContext.cpp @@ -87,7 +87,6 @@ void StyleColorImpl::ResetFrom(const nsStyleColor* aParent, nsIPresContext* aPre { if (nsnull != aParent) { mColor = aParent->mColor; - mOpacity = aParent->mOpacity; } else { if (nsnull != aPresContext) { @@ -96,9 +95,10 @@ void StyleColorImpl::ResetFrom(const nsStyleColor* aParent, nsIPresContext* aPre else { mColor = NS_RGB(0x00, 0x00, 0x00); } - mOpacity = 1.0F; } + mOpacity = 1.0f; + mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL; mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT; mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY; diff --git a/mozilla/layout/base/public/nsIStyleContext.h b/mozilla/layout/base/public/nsIStyleContext.h index 7f0f24c043d..6ab38d10eb9 100644 --- a/mozilla/layout/base/public/nsIStyleContext.h +++ b/mozilla/layout/base/public/nsIStyleContext.h @@ -65,7 +65,7 @@ struct nsStyleColor : public nsStyleStruct { PRUint8 mCursor; // [reset] See nsStyleConsts.h NS_STYLE_CURSOR_* nsString mCursorImage; // [reset] url string - float mOpacity; // [inherited] percentage + float mOpacity; // [reset] percentage protected: nsStyleColor(void); diff --git a/mozilla/layout/base/src/nsStyleContext.cpp b/mozilla/layout/base/src/nsStyleContext.cpp index c7b748e7833..154d872778b 100644 --- a/mozilla/layout/base/src/nsStyleContext.cpp +++ b/mozilla/layout/base/src/nsStyleContext.cpp @@ -87,7 +87,6 @@ void StyleColorImpl::ResetFrom(const nsStyleColor* aParent, nsIPresContext* aPre { if (nsnull != aParent) { mColor = aParent->mColor; - mOpacity = aParent->mOpacity; } else { if (nsnull != aPresContext) { @@ -96,9 +95,10 @@ void StyleColorImpl::ResetFrom(const nsStyleColor* aParent, nsIPresContext* aPre else { mColor = NS_RGB(0x00, 0x00, 0x00); } - mOpacity = 1.0F; } + mOpacity = 1.0f; + mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL; mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT; mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY; diff --git a/mozilla/layout/generic/nsHTMLContainerFrame.cpp b/mozilla/layout/generic/nsHTMLContainerFrame.cpp index 8153dc43a25..e337df759e5 100644 --- a/mozilla/layout/generic/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/generic/nsHTMLContainerFrame.cpp @@ -440,29 +440,17 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, aFrame->GetView(view); // If we don't yet have a view; see if we need a view if (nsnull == view) { + // We don't yet have a view; see if we need a view + // Get my nsStyleColor const nsStyleColor* myColor = (const nsStyleColor*) aStyleContext->GetStyleData(eStyleStruct_Color); - // See if the opacity is not the same as the geometric parent - // frames opacity. - if (!aForce) { - nsIFrame* parent; - aFrame->GetGeometricParent(parent); - if (nsnull != parent) { - // Get parent's nsStyleColor - const nsStyleColor* parentColor; - parent->GetStyleData(eStyleStruct_Color, - (const nsStyleStruct*&)parentColor); - - // If the opacities are different then I need a view - if (myColor->mOpacity != parentColor->mOpacity) { - NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, - ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p opacity=%g parentOpacity=%g", - aFrame, myColor->mOpacity, parentColor->mOpacity)); - aForce = PR_TRUE; - } - } + if (myColor->mOpacity != 1.0f) { + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p opacity=%g", + aFrame, myColor->mOpacity)); + aForce = PR_TRUE; } // See if the frame is being relatively positioned @@ -518,6 +506,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, if (NS_STYLE_BG_COLOR_TRANSPARENT & myColor->mBackgroundFlags) { viewManager->SetViewContentTransparency(view, PR_TRUE); } + viewManager->SetViewOpacity(view, myColor->mOpacity); NS_RELEASE(viewManager); } diff --git a/mozilla/layout/html/base/src/nsBodyFrame.cpp b/mozilla/layout/html/base/src/nsBodyFrame.cpp index 565f5557cdd..c89cbe27698 100644 --- a/mozilla/layout/html/base/src/nsBodyFrame.cpp +++ b/mozilla/layout/html/base/src/nsBodyFrame.cpp @@ -872,7 +872,7 @@ nsBodyFrame::CreateAbsoluteView(nsIStyleContext* aStyleContext) const nsnull, nsnull, zIndex, pClip); viewManager->InsertChild(containingView, view, 0); //XXX this needs to be conditional... - viewManager->SetViewContentTransparency(view, PR_TRUE); + viewManager->SetViewContentTransparency(view, PR_FALSE); viewManager->SetViewOpacity(view, color->mOpacity); NS_RELEASE(viewManager); } diff --git a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp index 8153dc43a25..e337df759e5 100644 --- a/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLContainerFrame.cpp @@ -440,29 +440,17 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, aFrame->GetView(view); // If we don't yet have a view; see if we need a view if (nsnull == view) { + // We don't yet have a view; see if we need a view + // Get my nsStyleColor const nsStyleColor* myColor = (const nsStyleColor*) aStyleContext->GetStyleData(eStyleStruct_Color); - // See if the opacity is not the same as the geometric parent - // frames opacity. - if (!aForce) { - nsIFrame* parent; - aFrame->GetGeometricParent(parent); - if (nsnull != parent) { - // Get parent's nsStyleColor - const nsStyleColor* parentColor; - parent->GetStyleData(eStyleStruct_Color, - (const nsStyleStruct*&)parentColor); - - // If the opacities are different then I need a view - if (myColor->mOpacity != parentColor->mOpacity) { - NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, - ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p opacity=%g parentOpacity=%g", - aFrame, myColor->mOpacity, parentColor->mOpacity)); - aForce = PR_TRUE; - } - } + if (myColor->mOpacity != 1.0f) { + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLContainerFrame::CreateViewForFrame: frame=%p opacity=%g", + aFrame, myColor->mOpacity)); + aForce = PR_TRUE; } // See if the frame is being relatively positioned @@ -518,6 +506,7 @@ nsHTMLContainerFrame::CreateViewForFrame(nsIPresContext& aPresContext, if (NS_STYLE_BG_COLOR_TRANSPARENT & myColor->mBackgroundFlags) { viewManager->SetViewContentTransparency(view, PR_TRUE); } + viewManager->SetViewOpacity(view, myColor->mOpacity); NS_RELEASE(viewManager); } diff --git a/mozilla/layout/style/nsStyleContext.cpp b/mozilla/layout/style/nsStyleContext.cpp index c7b748e7833..154d872778b 100644 --- a/mozilla/layout/style/nsStyleContext.cpp +++ b/mozilla/layout/style/nsStyleContext.cpp @@ -87,7 +87,6 @@ void StyleColorImpl::ResetFrom(const nsStyleColor* aParent, nsIPresContext* aPre { if (nsnull != aParent) { mColor = aParent->mColor; - mOpacity = aParent->mOpacity; } else { if (nsnull != aPresContext) { @@ -96,9 +95,10 @@ void StyleColorImpl::ResetFrom(const nsStyleColor* aParent, nsIPresContext* aPre else { mColor = NS_RGB(0x00, 0x00, 0x00); } - mOpacity = 1.0F; } + mOpacity = 1.0f; + mBackgroundAttachment = NS_STYLE_BG_ATTACHMENT_SCROLL; mBackgroundFlags = NS_STYLE_BG_COLOR_TRANSPARENT; mBackgroundRepeat = NS_STYLE_BG_REPEAT_XY;