From 95f8a82db4d968decf08e76e0d19432f91e26540 Mon Sep 17 00:00:00 2001 From: kipp Date: Thu, 4 Jun 1998 17:50:53 +0000 Subject: [PATCH] Log view creation when it's done; create view when child and parent opacities differ git-svn-id: svn://10.0.0.236/trunk@3224 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsHTMLFrame.cpp | 26 ++++++++++++++++++-- mozilla/layout/html/base/src/nsHTMLFrame.cpp | 26 ++++++++++++++++++-- 2 files changed, 48 insertions(+), 4 deletions(-) diff --git a/mozilla/layout/generic/nsHTMLFrame.cpp b/mozilla/layout/generic/nsHTMLFrame.cpp index 74eb37031cc..d6ca232a5bb 100644 --- a/mozilla/layout/generic/nsHTMLFrame.cpp +++ b/mozilla/layout/generic/nsHTMLFrame.cpp @@ -16,6 +16,7 @@ * Reserved. */ #include "nsHTMLFrame.h" +#include "nsFrame.h" #include "nsIStyleContext.h" #include "nsStyleConsts.h" #include "nsViewsCID.h" @@ -41,11 +42,24 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, nsIFrame* parent; aFrame->GetGeometricParent(parent); if (nsnull != parent) { - nsStyleColor* color = (nsStyleColor*) + // Get my nsStyleColor + nsStyleColor* myColor = (nsStyleColor*) aStyleContext->GetData(eStyleStruct_Color); - if (color->mOpacity < 1.0f) { + + // Get parent's nsStyleColor + nsIStyleContext* parentSC; + parent->GetStyleContext(aPresContext, parentSC); + nsStyleColor* parentColor = (nsStyleColor*) + parentSC->GetData(eStyleStruct_Color); + + // If the opacities are different then I need a view + if (myColor->mOpacity != parentColor->mOpacity) { + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLFrame::CreateViewForFrame: frame=%p opacity=%g parentOpacity=%g", + aFrame, myColor->mOpacity, parentColor->mOpacity)); aForce = PR_TRUE; } + NS_RELEASE(parentSC); } } @@ -54,10 +68,14 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, nsStylePosition* position = (nsStylePosition*) aStyleContext->GetData(eStyleStruct_Position); if (NS_STYLE_POSITION_RELATIVE == position->mPosition) { + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLFrame::CreateViewForFrame: frame=%p relatively positioned", + aFrame)); aForce = PR_TRUE; } } +#if 0 // See if the frame is supposed to scroll if (!aForce) { nsStyleDisplay* display = (nsStyleDisplay*) @@ -67,6 +85,7 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, scrollView = PR_TRUE; } } +#endif if (aForce) { // Create a view @@ -108,6 +127,9 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, NS_RELEASE(view); NS_RELEASE(parView); + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLFrame::CreateViewForFrame: frame=%p view=%p", + aFrame)); return result; } } diff --git a/mozilla/layout/html/base/src/nsHTMLFrame.cpp b/mozilla/layout/html/base/src/nsHTMLFrame.cpp index 74eb37031cc..d6ca232a5bb 100644 --- a/mozilla/layout/html/base/src/nsHTMLFrame.cpp +++ b/mozilla/layout/html/base/src/nsHTMLFrame.cpp @@ -16,6 +16,7 @@ * Reserved. */ #include "nsHTMLFrame.h" +#include "nsFrame.h" #include "nsIStyleContext.h" #include "nsStyleConsts.h" #include "nsViewsCID.h" @@ -41,11 +42,24 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, nsIFrame* parent; aFrame->GetGeometricParent(parent); if (nsnull != parent) { - nsStyleColor* color = (nsStyleColor*) + // Get my nsStyleColor + nsStyleColor* myColor = (nsStyleColor*) aStyleContext->GetData(eStyleStruct_Color); - if (color->mOpacity < 1.0f) { + + // Get parent's nsStyleColor + nsIStyleContext* parentSC; + parent->GetStyleContext(aPresContext, parentSC); + nsStyleColor* parentColor = (nsStyleColor*) + parentSC->GetData(eStyleStruct_Color); + + // If the opacities are different then I need a view + if (myColor->mOpacity != parentColor->mOpacity) { + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLFrame::CreateViewForFrame: frame=%p opacity=%g parentOpacity=%g", + aFrame, myColor->mOpacity, parentColor->mOpacity)); aForce = PR_TRUE; } + NS_RELEASE(parentSC); } } @@ -54,10 +68,14 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, nsStylePosition* position = (nsStylePosition*) aStyleContext->GetData(eStyleStruct_Position); if (NS_STYLE_POSITION_RELATIVE == position->mPosition) { + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLFrame::CreateViewForFrame: frame=%p relatively positioned", + aFrame)); aForce = PR_TRUE; } } +#if 0 // See if the frame is supposed to scroll if (!aForce) { nsStyleDisplay* display = (nsStyleDisplay*) @@ -67,6 +85,7 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, scrollView = PR_TRUE; } } +#endif if (aForce) { // Create a view @@ -108,6 +127,9 @@ nsHTMLFrame::CreateViewForFrame(nsIPresContext* aPresContext, NS_RELEASE(view); NS_RELEASE(parView); + NS_FRAME_LOG(NS_FRAME_TRACE_CALLS, + ("nsHTMLFrame::CreateViewForFrame: frame=%p view=%p", + aFrame)); return result; } }