From 8c624442987dd5578b2106ef4f99f7a640ae91c7 Mon Sep 17 00:00:00 2001 From: "attinasi%netscape.com" Date: Tue, 18 Jan 2000 15:42:45 +0000 Subject: [PATCH] Added flags to factory method to allow NS_BLOCK_SPACE_MGR to be specified for abs. Positioned fieldsets. Fixes bug 23611. r=rods,pierre --- layout/forms/nsFieldSetFrame.cpp | 13 +++++++++++-- layout/html/forms/src/nsFieldSetFrame.cpp | 13 +++++++++++-- 2 files changed, 22 insertions(+), 4 deletions(-) diff --git a/layout/forms/nsFieldSetFrame.cpp b/layout/forms/nsFieldSetFrame.cpp index 0c1559fbf5d8..20e5b5b3977b 100644 --- a/layout/forms/nsFieldSetFrame.cpp +++ b/layout/forms/nsFieldSetFrame.cpp @@ -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 shell; aPresContext->GetShell(getter_AddRefs(shell)); diff --git a/layout/html/forms/src/nsFieldSetFrame.cpp b/layout/html/forms/src/nsFieldSetFrame.cpp index 0c1559fbf5d8..20e5b5b3977b 100644 --- a/layout/html/forms/src/nsFieldSetFrame.cpp +++ b/layout/html/forms/src/nsFieldSetFrame.cpp @@ -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 shell; aPresContext->GetShell(getter_AddRefs(shell));