Added flags to factory method to allow NS_BLOCK_SPACE_MGR to be specified for abs. Positioned fieldsets. Fixes bug 23611. r=rods,pierre

This commit is contained in:
attinasi%netscape.com 2000-01-18 15:42:45 +00:00
parent b6ce9d3882
commit 8c62444298
2 changed files with 22 additions and 4 deletions

View File

@ -89,7 +89,7 @@ protected:
};
nsresult
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aStateFlags )
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
@ -99,6 +99,10 @@ NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
// set the state flags (if any are provided)
it->SetFrameState( aStateFlags );
*aNewFrame = it;
return NS_OK;
}
@ -163,7 +167,12 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext* aPresContext,
const nsStyleDisplay* styleDisplay;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
PRUint8 flags = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay) ? NS_BLOCK_SHRINK_WRAP : 0;
PRUint32 flags = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay) ? NS_BLOCK_SHRINK_WRAP : 0;
// add in the parent state (we need it to be inherited)
PRUint32 parentState;
GetFrameState( &parentState );
flags |= parentState;
nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell));

View File

@ -89,7 +89,7 @@ protected:
};
nsresult
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame, PRUint32 aStateFlags )
{
NS_PRECONDITION(aNewFrame, "null OUT ptr");
if (nsnull == aNewFrame) {
@ -99,6 +99,10 @@ NS_NewFieldSetFrame(nsIPresShell* aPresShell, nsIFrame** aNewFrame)
if (!it) {
return NS_ERROR_OUT_OF_MEMORY;
}
// set the state flags (if any are provided)
it->SetFrameState( aStateFlags );
*aNewFrame = it;
return NS_OK;
}
@ -163,7 +167,12 @@ nsFieldSetFrame::SetInitialChildList(nsIPresContext* aPresContext,
const nsStyleDisplay* styleDisplay;
GetStyleData(eStyleStruct_Display, (const nsStyleStruct*&) styleDisplay);
PRUint8 flags = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay) ? NS_BLOCK_SHRINK_WRAP : 0;
PRUint32 flags = (NS_STYLE_DISPLAY_BLOCK != styleDisplay->mDisplay) ? NS_BLOCK_SHRINK_WRAP : 0;
// add in the parent state (we need it to be inherited)
PRUint32 parentState;
GetFrameState( &parentState );
flags |= parentState;
nsCOMPtr<nsIPresShell> shell;
aPresContext->GetShell(getter_AddRefs(shell));