From 579c8e2248aca880d38151f5bd3211cac207bae7 Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Fri, 8 Oct 1999 04:32:46 +0000 Subject: [PATCH] Frame space reductions. r=kipp@netscape.com Table cell frames and table caption frames now use block frames and not area frames. This saves 24 bytes per frame instance git-svn-id: svn://10.0.0.236/trunk@50200 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsAreaFrame.cpp | 26 ------------------ mozilla/layout/generic/nsBlockFrame.cpp | 27 ++++++++++++++++++- mozilla/layout/generic/nsBlockFrame.h | 2 +- mozilla/layout/generic/nsBlockReflowState.cpp | 27 ++++++++++++++++++- mozilla/layout/generic/nsBlockReflowState.h | 27 ++++++++++++++++++- mozilla/layout/generic/nsHTMLParts.h | 21 ++++++++------- mozilla/layout/html/base/src/nsAreaFrame.cpp | 26 ------------------ mozilla/layout/html/base/src/nsBlockFrame.cpp | 27 ++++++++++++++++++- mozilla/layout/html/base/src/nsBlockFrame.h | 2 +- .../html/base/src/nsBlockReflowState.cpp | 27 ++++++++++++++++++- .../layout/html/base/src/nsBlockReflowState.h | 27 ++++++++++++++++++- mozilla/layout/html/base/src/nsHTMLParts.h | 21 ++++++++------- 12 files changed, 180 insertions(+), 80 deletions(-) diff --git a/mozilla/layout/generic/nsAreaFrame.cpp b/mozilla/layout/generic/nsAreaFrame.cpp index 4411549fa29..87cdf87928a 100644 --- a/mozilla/layout/generic/nsAreaFrame.cpp +++ b/mozilla/layout/generic/nsAreaFrame.cpp @@ -368,32 +368,6 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, #endif #endif - if (mFlags & NS_AREA_WRAP_SIZE) { - // When the area frame is supposed to wrap around all in-flow - // children, make sure its big enough to include those that stick - // outside the box. - if (NS_FRAME_OUTSIDE_CHILDREN & mState) { - nscoord xMost = aDesiredSize.mCombinedArea.XMost(); - if (xMost > aDesiredSize.width) { -#ifdef NOISY_FINAL_SIZE - ListTag(stdout); - printf(": changing desired width from %d to %d\n", - aDesiredSize.width, xMost); -#endif - aDesiredSize.width = xMost; - } - nscoord yMost = aDesiredSize.mCombinedArea.YMost(); - if (yMost > aDesiredSize.height) { -#ifdef NOISY_FINAL_SIZE - ListTag(stdout); - printf(": changing desired height from %d to %d\n", - aDesiredSize.height, yMost); -#endif - aDesiredSize.height = yMost; - } - } - } - // Let the absolutely positioned container reflow any absolutely positioned // child frames that need to be reflowed, e.g., elements with a percentage // based width/height diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 7d2f9961dd3..2ca95f665df 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -940,7 +940,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine, const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID; nsresult -NS_NewBlockFrame(nsIFrame** aNewFrame) +NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags) { NS_PRECONDITION(aNewFrame, "null OUT ptr"); if (nsnull == aNewFrame) { @@ -950,6 +950,7 @@ NS_NewBlockFrame(nsIFrame** aNewFrame) if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } + it->SetFlags(aFlags); *aNewFrame = it; return NS_OK; } @@ -1340,6 +1341,30 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); + if (mFlags & NS_BLOCK_WRAP_SIZE) { + // When the area frame is supposed to wrap around all in-flow + // children, make sure its big enough to include those that stick + // outside the box. + if (NS_FRAME_OUTSIDE_CHILDREN & mState) { + nscoord xMost = aMetrics.mCombinedArea.XMost(); + if (xMost > aMetrics.width) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired width from %d to %d\n", aMetrics.width, xMost); +#endif + aMetrics.width = xMost; + } + nscoord yMost = aMetrics.mCombinedArea.YMost(); + if (yMost > aMetrics.height) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired height from %d to %d\n", aMetrics.height, yMost); +#endif + aMetrics.height = yMost; + } + } + } + // If this is an incremental reflow and we changed size, then make sure our // border is repainted if necessary if (eReflowReason_Incremental == aReflowState.reason) { diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h index 07dbc04220d..12c283ebf0c 100644 --- a/mozilla/layout/generic/nsBlockFrame.h +++ b/mozilla/layout/generic/nsBlockFrame.h @@ -56,7 +56,7 @@ extern const nsIID kBlockFrameCID; class nsBlockFrame : public nsBlockFrameSuper { public: - friend nsresult NS_NewBlockFrame(nsIFrame** aNewFrame); + friend nsresult NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags); // nsISupports NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 7d2f9961dd3..2ca95f665df 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -940,7 +940,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine, const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID; nsresult -NS_NewBlockFrame(nsIFrame** aNewFrame) +NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags) { NS_PRECONDITION(aNewFrame, "null OUT ptr"); if (nsnull == aNewFrame) { @@ -950,6 +950,7 @@ NS_NewBlockFrame(nsIFrame** aNewFrame) if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } + it->SetFlags(aFlags); *aNewFrame = it; return NS_OK; } @@ -1340,6 +1341,30 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); + if (mFlags & NS_BLOCK_WRAP_SIZE) { + // When the area frame is supposed to wrap around all in-flow + // children, make sure its big enough to include those that stick + // outside the box. + if (NS_FRAME_OUTSIDE_CHILDREN & mState) { + nscoord xMost = aMetrics.mCombinedArea.XMost(); + if (xMost > aMetrics.width) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired width from %d to %d\n", aMetrics.width, xMost); +#endif + aMetrics.width = xMost; + } + nscoord yMost = aMetrics.mCombinedArea.YMost(); + if (yMost > aMetrics.height) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired height from %d to %d\n", aMetrics.height, yMost); +#endif + aMetrics.height = yMost; + } + } + } + // If this is an incremental reflow and we changed size, then make sure our // border is repainted if necessary if (eReflowReason_Incremental == aReflowState.reason) { diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 7d2f9961dd3..2ca95f665df 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -940,7 +940,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine, const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID; nsresult -NS_NewBlockFrame(nsIFrame** aNewFrame) +NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags) { NS_PRECONDITION(aNewFrame, "null OUT ptr"); if (nsnull == aNewFrame) { @@ -950,6 +950,7 @@ NS_NewBlockFrame(nsIFrame** aNewFrame) if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } + it->SetFlags(aFlags); *aNewFrame = it; return NS_OK; } @@ -1340,6 +1341,30 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); + if (mFlags & NS_BLOCK_WRAP_SIZE) { + // When the area frame is supposed to wrap around all in-flow + // children, make sure its big enough to include those that stick + // outside the box. + if (NS_FRAME_OUTSIDE_CHILDREN & mState) { + nscoord xMost = aMetrics.mCombinedArea.XMost(); + if (xMost > aMetrics.width) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired width from %d to %d\n", aMetrics.width, xMost); +#endif + aMetrics.width = xMost; + } + nscoord yMost = aMetrics.mCombinedArea.YMost(); + if (yMost > aMetrics.height) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired height from %d to %d\n", aMetrics.height, yMost); +#endif + aMetrics.height = yMost; + } + } + } + // If this is an incremental reflow and we changed size, then make sure our // border is repainted if necessary if (eReflowReason_Incremental == aReflowState.reason) { diff --git a/mozilla/layout/generic/nsHTMLParts.h b/mozilla/layout/generic/nsHTMLParts.h index 273cf6fe2c7..46cba1dedb2 100644 --- a/mozilla/layout/generic/nsHTMLParts.h +++ b/mozilla/layout/generic/nsHTMLParts.h @@ -246,7 +246,11 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, #define NS_BLOCK_MARGIN_ROOT 0x4 #define NS_BLOCK_DOCUMENT_ROOT 0x8 #define NS_BLOCK_SPACE_MGR 0x10 -#define NS_AREA_WRAP_SIZE 0x20 +#define NS_BLOCK_WRAP_SIZE 0x20 + +// Create a frame that supports "display: block" layout behavior +extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame, + PRUint32 aFlags = 0); // Special Generated Content Frame extern nsresult @@ -257,23 +261,23 @@ NS_NewAttributeContent(nsIContent ** aResult); // By default, area frames will extend // their height to cover any children that "stick out". extern nsresult NS_NewSelectsAreaFrame(nsIFrame** aNewFrame, - PRUint32 aFlags = NS_AREA_WRAP_SIZE); + PRUint32 aFlags = NS_BLOCK_WRAP_SIZE); // Create a basic area frame. By default, area frames will extend // their height to cover any children that "stick out". extern nsresult NS_NewAreaFrame(nsIFrame** aNewFrame, - PRUint32 aFlags = NS_AREA_WRAP_SIZE); + PRUint32 aFlags = NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE); // These AreaFrame's shrink wrap around their contents inline nsresult NS_NewTableCellInnerFrame(nsIFrame** aNewFrame) { - return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_AREA_WRAP_SIZE); + return NS_NewBlockFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE); } inline nsresult NS_NewTableCaptionFrame(nsIFrame** aNewFrame) { - return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_AREA_WRAP_SIZE); + return NS_NewBlockFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE); } -// This type of AreaFrame is the document root and is a margin root for -// margin collapsing. +// This type of AreaFrame is the document root, a margin root, and the +// initial containing block for absolutely positioned elements inline nsresult NS_NewDocumentElementFrame(nsIFrame** aNewFrame) { return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT); } @@ -296,9 +300,6 @@ inline nsresult NS_NewRelativeItemWrapperFrame(nsIFrame** aNewFrame) { extern nsresult NS_NewBRFrame(nsIFrame** aNewFrame); -// Create a frame that supports "display: block" layout behavior -extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame); - extern nsresult NS_NewCommentFrame(nsIFrame** aFrameResult); extern nsresult NS_NewHRFrame(nsIFrame** aNewFrame); diff --git a/mozilla/layout/html/base/src/nsAreaFrame.cpp b/mozilla/layout/html/base/src/nsAreaFrame.cpp index 4411549fa29..87cdf87928a 100644 --- a/mozilla/layout/html/base/src/nsAreaFrame.cpp +++ b/mozilla/layout/html/base/src/nsAreaFrame.cpp @@ -368,32 +368,6 @@ nsAreaFrame::Reflow(nsIPresContext& aPresContext, #endif #endif - if (mFlags & NS_AREA_WRAP_SIZE) { - // When the area frame is supposed to wrap around all in-flow - // children, make sure its big enough to include those that stick - // outside the box. - if (NS_FRAME_OUTSIDE_CHILDREN & mState) { - nscoord xMost = aDesiredSize.mCombinedArea.XMost(); - if (xMost > aDesiredSize.width) { -#ifdef NOISY_FINAL_SIZE - ListTag(stdout); - printf(": changing desired width from %d to %d\n", - aDesiredSize.width, xMost); -#endif - aDesiredSize.width = xMost; - } - nscoord yMost = aDesiredSize.mCombinedArea.YMost(); - if (yMost > aDesiredSize.height) { -#ifdef NOISY_FINAL_SIZE - ListTag(stdout); - printf(": changing desired height from %d to %d\n", - aDesiredSize.height, yMost); -#endif - aDesiredSize.height = yMost; - } - } - } - // Let the absolutely positioned container reflow any absolutely positioned // child frames that need to be reflowed, e.g., elements with a percentage // based width/height diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 7d2f9961dd3..2ca95f665df 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -940,7 +940,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine, const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID; nsresult -NS_NewBlockFrame(nsIFrame** aNewFrame) +NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags) { NS_PRECONDITION(aNewFrame, "null OUT ptr"); if (nsnull == aNewFrame) { @@ -950,6 +950,7 @@ NS_NewBlockFrame(nsIFrame** aNewFrame) if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } + it->SetFlags(aFlags); *aNewFrame = it; return NS_OK; } @@ -1340,6 +1341,30 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); + if (mFlags & NS_BLOCK_WRAP_SIZE) { + // When the area frame is supposed to wrap around all in-flow + // children, make sure its big enough to include those that stick + // outside the box. + if (NS_FRAME_OUTSIDE_CHILDREN & mState) { + nscoord xMost = aMetrics.mCombinedArea.XMost(); + if (xMost > aMetrics.width) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired width from %d to %d\n", aMetrics.width, xMost); +#endif + aMetrics.width = xMost; + } + nscoord yMost = aMetrics.mCombinedArea.YMost(); + if (yMost > aMetrics.height) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired height from %d to %d\n", aMetrics.height, yMost); +#endif + aMetrics.height = yMost; + } + } + } + // If this is an incremental reflow and we changed size, then make sure our // border is repainted if necessary if (eReflowReason_Incremental == aReflowState.reason) { diff --git a/mozilla/layout/html/base/src/nsBlockFrame.h b/mozilla/layout/html/base/src/nsBlockFrame.h index 07dbc04220d..12c283ebf0c 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.h +++ b/mozilla/layout/html/base/src/nsBlockFrame.h @@ -56,7 +56,7 @@ extern const nsIID kBlockFrameCID; class nsBlockFrame : public nsBlockFrameSuper { public: - friend nsresult NS_NewBlockFrame(nsIFrame** aNewFrame); + friend nsresult NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags); // nsISupports NS_IMETHOD QueryInterface(const nsIID& aIID, void** aInstancePtr); diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 7d2f9961dd3..2ca95f665df 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -940,7 +940,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine, const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID; nsresult -NS_NewBlockFrame(nsIFrame** aNewFrame) +NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags) { NS_PRECONDITION(aNewFrame, "null OUT ptr"); if (nsnull == aNewFrame) { @@ -950,6 +950,7 @@ NS_NewBlockFrame(nsIFrame** aNewFrame) if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } + it->SetFlags(aFlags); *aNewFrame = it; return NS_OK; } @@ -1340,6 +1341,30 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); + if (mFlags & NS_BLOCK_WRAP_SIZE) { + // When the area frame is supposed to wrap around all in-flow + // children, make sure its big enough to include those that stick + // outside the box. + if (NS_FRAME_OUTSIDE_CHILDREN & mState) { + nscoord xMost = aMetrics.mCombinedArea.XMost(); + if (xMost > aMetrics.width) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired width from %d to %d\n", aMetrics.width, xMost); +#endif + aMetrics.width = xMost; + } + nscoord yMost = aMetrics.mCombinedArea.YMost(); + if (yMost > aMetrics.height) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired height from %d to %d\n", aMetrics.height, yMost); +#endif + aMetrics.height = yMost; + } + } + } + // If this is an incremental reflow and we changed size, then make sure our // border is repainted if necessary if (eReflowReason_Incremental == aReflowState.reason) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 7d2f9961dd3..2ca95f665df 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -940,7 +940,7 @@ nsBlockReflowState::RecoverStateFrom(nsLineBox* aLine, const nsIID kBlockFrameCID = NS_BLOCK_FRAME_CID; nsresult -NS_NewBlockFrame(nsIFrame** aNewFrame) +NS_NewBlockFrame(nsIFrame** aNewFrame, PRUint32 aFlags) { NS_PRECONDITION(aNewFrame, "null OUT ptr"); if (nsnull == aNewFrame) { @@ -950,6 +950,7 @@ NS_NewBlockFrame(nsIFrame** aNewFrame) if (nsnull == it) { return NS_ERROR_OUT_OF_MEMORY; } + it->SetFlags(aFlags); *aNewFrame = it; return NS_OK; } @@ -1340,6 +1341,30 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); + if (mFlags & NS_BLOCK_WRAP_SIZE) { + // When the area frame is supposed to wrap around all in-flow + // children, make sure its big enough to include those that stick + // outside the box. + if (NS_FRAME_OUTSIDE_CHILDREN & mState) { + nscoord xMost = aMetrics.mCombinedArea.XMost(); + if (xMost > aMetrics.width) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired width from %d to %d\n", aMetrics.width, xMost); +#endif + aMetrics.width = xMost; + } + nscoord yMost = aMetrics.mCombinedArea.YMost(); + if (yMost > aMetrics.height) { +#ifdef NOISY_FINAL_SIZE + ListTag(stdout); + printf(": changing desired height from %d to %d\n", aMetrics.height, yMost); +#endif + aMetrics.height = yMost; + } + } + } + // If this is an incremental reflow and we changed size, then make sure our // border is repainted if necessary if (eReflowReason_Incremental == aReflowState.reason) { diff --git a/mozilla/layout/html/base/src/nsHTMLParts.h b/mozilla/layout/html/base/src/nsHTMLParts.h index 273cf6fe2c7..46cba1dedb2 100644 --- a/mozilla/layout/html/base/src/nsHTMLParts.h +++ b/mozilla/layout/html/base/src/nsHTMLParts.h @@ -246,7 +246,11 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, #define NS_BLOCK_MARGIN_ROOT 0x4 #define NS_BLOCK_DOCUMENT_ROOT 0x8 #define NS_BLOCK_SPACE_MGR 0x10 -#define NS_AREA_WRAP_SIZE 0x20 +#define NS_BLOCK_WRAP_SIZE 0x20 + +// Create a frame that supports "display: block" layout behavior +extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame, + PRUint32 aFlags = 0); // Special Generated Content Frame extern nsresult @@ -257,23 +261,23 @@ NS_NewAttributeContent(nsIContent ** aResult); // By default, area frames will extend // their height to cover any children that "stick out". extern nsresult NS_NewSelectsAreaFrame(nsIFrame** aNewFrame, - PRUint32 aFlags = NS_AREA_WRAP_SIZE); + PRUint32 aFlags = NS_BLOCK_WRAP_SIZE); // Create a basic area frame. By default, area frames will extend // their height to cover any children that "stick out". extern nsresult NS_NewAreaFrame(nsIFrame** aNewFrame, - PRUint32 aFlags = NS_AREA_WRAP_SIZE); + PRUint32 aFlags = NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE); // These AreaFrame's shrink wrap around their contents inline nsresult NS_NewTableCellInnerFrame(nsIFrame** aNewFrame) { - return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_AREA_WRAP_SIZE); + return NS_NewBlockFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE); } inline nsresult NS_NewTableCaptionFrame(nsIFrame** aNewFrame) { - return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_AREA_WRAP_SIZE); + return NS_NewBlockFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_WRAP_SIZE); } -// This type of AreaFrame is the document root and is a margin root for -// margin collapsing. +// This type of AreaFrame is the document root, a margin root, and the +// initial containing block for absolutely positioned elements inline nsresult NS_NewDocumentElementFrame(nsIFrame** aNewFrame) { return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_DOCUMENT_ROOT|NS_BLOCK_MARGIN_ROOT); } @@ -296,9 +300,6 @@ inline nsresult NS_NewRelativeItemWrapperFrame(nsIFrame** aNewFrame) { extern nsresult NS_NewBRFrame(nsIFrame** aNewFrame); -// Create a frame that supports "display: block" layout behavior -extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame); - extern nsresult NS_NewCommentFrame(nsIFrame** aFrameResult); extern nsresult NS_NewHRFrame(nsIFrame** aNewFrame);