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
This commit is contained in:
kipp
1998-06-04 17:50:53 +00:00
parent e265ed4281
commit 95f8a82db4
2 changed files with 48 additions and 4 deletions

View File

@@ -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;
}
}

View File

@@ -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;
}
}