From eed8ac6824f919a8a23d757a3142d9e4f379e62a Mon Sep 17 00:00:00 2001 From: "kipp%netscape.com" Date: Wed, 3 Nov 1999 00:42:12 +0000 Subject: [PATCH] r=troy; remove another 4 bytes from each block frame for a total of 10% today :-) git-svn-id: svn://10.0.0.236/trunk@52629 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockFrame.cpp | 15 ++++++--------- mozilla/layout/generic/nsBlockFrame.h | 12 ++++++------ mozilla/layout/generic/nsBlockReflowState.cpp | 15 ++++++--------- mozilla/layout/generic/nsBlockReflowState.h | 15 ++++++--------- mozilla/layout/generic/nsHTMLParts.h | 16 ++++++++-------- mozilla/layout/html/base/src/nsBlockFrame.cpp | 15 ++++++--------- mozilla/layout/html/base/src/nsBlockFrame.h | 12 ++++++------ .../layout/html/base/src/nsBlockReflowState.cpp | 15 ++++++--------- .../layout/html/base/src/nsBlockReflowState.h | 15 ++++++--------- mozilla/layout/html/base/src/nsHTMLParts.h | 16 ++++++++-------- 10 files changed, 64 insertions(+), 82 deletions(-) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index 0fc242578d5..275681f0853 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -1195,9 +1195,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con if (0 != mState) { fprintf(out, " [state=%08x]", mState); } - if (0 != mFlags) { - fprintf(out, " [flags=%x]", mFlags); - } PRInt32 numInlineLines = 0; PRInt32 numBlockLines = 0; if (nsnull != mLines) { @@ -1393,7 +1390,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Should we create a space manager? nsCOMPtr spaceManager; - if (mFlags & NS_BLOCK_SPACE_MGR) { + if (NS_BLOCK_SPACE_MGR & mState) { nsSpaceManager* rawPtr = new nsSpaceManager(this); if (!rawPtr) { return NS_ERROR_OUT_OF_MEMORY; @@ -1407,7 +1404,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics); - if (NS_BLOCK_MARGIN_ROOT & mFlags) { + if (NS_BLOCK_MARGIN_ROOT & mState) { state.mIsTopMarginRoot = PR_TRUE; state.mIsBottomMarginRoot = PR_TRUE; } @@ -1505,7 +1502,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); - if (mFlags & NS_BLOCK_WRAP_SIZE) { + if (NS_BLOCK_WRAP_SIZE & mState) { // 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. @@ -1767,7 +1764,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, // There are two options here. We either shrink wrap around our // contents or we fluff out to the maximum block width. Note: // We always shrink wrap when given an unconstrained width. - if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) && + if ((0 == (NS_BLOCK_SHRINK_WRAP & mState)) && !aState.mUnconstrainedWidth && !compact) { // Set our width to the max width if we aren't already that @@ -5804,10 +5801,10 @@ nsBlockFrame::Init(nsIPresContext& aPresContext, nsIFrame* aPrevInFlow) { if (aPrevInFlow) { - // Copy over the block/area frame flags + // Copy over the block/area frame type flags nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow; - SetFlags(blockFrame->mFlags); + SetFlags(blockFrame->mState & NS_BLOCK_FLAGS_MASK); } nsresult rv = nsBlockFrameSuper::Init(aPresContext, aContent, aParent, diff --git a/mozilla/layout/generic/nsBlockFrame.h b/mozilla/layout/generic/nsBlockFrame.h index 75963c51ad1..51d24c11745 100644 --- a/mozilla/layout/generic/nsBlockFrame.h +++ b/mozilla/layout/generic/nsBlockFrame.h @@ -20,6 +20,7 @@ #define nsBlockFrame_h___ #include "nsHTMLContainerFrame.h" +#include "nsHTMLParts.h" class nsBlockReflowState; class nsBulletFrame; @@ -36,11 +37,12 @@ class nsFirstLineFrame; #define NS_BLOCK_FRAME_LAST_LIST_INDEX NS_BLOCK_FRAME_BULLET_LIST_INDEX /** - * Additional frame-state bits + * Additional frame-state bits. There are more of these bits + * defined in nsHTMLParts.h (XXX: note: this should be cleaned up) */ #define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET 0x80000000 #define NS_BLOCK_IS_HTML_PARAGRAPH 0x40000000 -#define NS_BLOCK_HAS_FIRST_LETTER_STYLE 0x10000000 +#define NS_BLOCK_HAS_FIRST_LETTER_STYLE 0x20000000 #define nsBlockFrameSuper nsHTMLContainerFrame @@ -144,7 +146,8 @@ protected: nsIStyleContext* GetFirstLetterStyle(nsIPresContext* aPresContext); void SetFlags(PRUint32 aFlags) { - mFlags = aFlags; + mState &= ~NS_BLOCK_FLAGS_MASK; + mState |= aFlags; } PRBool HaveOutsideBullet() const { @@ -346,9 +349,6 @@ protected: nsLineBox* mLines; - // XXX subclass! - PRUint32 mFlags; - // Text run information nsTextRun* mTextRuns; diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index 0fc242578d5..275681f0853 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -1195,9 +1195,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con if (0 != mState) { fprintf(out, " [state=%08x]", mState); } - if (0 != mFlags) { - fprintf(out, " [flags=%x]", mFlags); - } PRInt32 numInlineLines = 0; PRInt32 numBlockLines = 0; if (nsnull != mLines) { @@ -1393,7 +1390,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Should we create a space manager? nsCOMPtr spaceManager; - if (mFlags & NS_BLOCK_SPACE_MGR) { + if (NS_BLOCK_SPACE_MGR & mState) { nsSpaceManager* rawPtr = new nsSpaceManager(this); if (!rawPtr) { return NS_ERROR_OUT_OF_MEMORY; @@ -1407,7 +1404,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics); - if (NS_BLOCK_MARGIN_ROOT & mFlags) { + if (NS_BLOCK_MARGIN_ROOT & mState) { state.mIsTopMarginRoot = PR_TRUE; state.mIsBottomMarginRoot = PR_TRUE; } @@ -1505,7 +1502,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); - if (mFlags & NS_BLOCK_WRAP_SIZE) { + if (NS_BLOCK_WRAP_SIZE & mState) { // 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. @@ -1767,7 +1764,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, // There are two options here. We either shrink wrap around our // contents or we fluff out to the maximum block width. Note: // We always shrink wrap when given an unconstrained width. - if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) && + if ((0 == (NS_BLOCK_SHRINK_WRAP & mState)) && !aState.mUnconstrainedWidth && !compact) { // Set our width to the max width if we aren't already that @@ -5804,10 +5801,10 @@ nsBlockFrame::Init(nsIPresContext& aPresContext, nsIFrame* aPrevInFlow) { if (aPrevInFlow) { - // Copy over the block/area frame flags + // Copy over the block/area frame type flags nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow; - SetFlags(blockFrame->mFlags); + SetFlags(blockFrame->mState & NS_BLOCK_FLAGS_MASK); } nsresult rv = nsBlockFrameSuper::Init(aPresContext, aContent, aParent, diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index 0fc242578d5..275681f0853 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -1195,9 +1195,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con if (0 != mState) { fprintf(out, " [state=%08x]", mState); } - if (0 != mFlags) { - fprintf(out, " [flags=%x]", mFlags); - } PRInt32 numInlineLines = 0; PRInt32 numBlockLines = 0; if (nsnull != mLines) { @@ -1393,7 +1390,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Should we create a space manager? nsCOMPtr spaceManager; - if (mFlags & NS_BLOCK_SPACE_MGR) { + if (NS_BLOCK_SPACE_MGR & mState) { nsSpaceManager* rawPtr = new nsSpaceManager(this); if (!rawPtr) { return NS_ERROR_OUT_OF_MEMORY; @@ -1407,7 +1404,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics); - if (NS_BLOCK_MARGIN_ROOT & mFlags) { + if (NS_BLOCK_MARGIN_ROOT & mState) { state.mIsTopMarginRoot = PR_TRUE; state.mIsBottomMarginRoot = PR_TRUE; } @@ -1505,7 +1502,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); - if (mFlags & NS_BLOCK_WRAP_SIZE) { + if (NS_BLOCK_WRAP_SIZE & mState) { // 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. @@ -1767,7 +1764,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, // There are two options here. We either shrink wrap around our // contents or we fluff out to the maximum block width. Note: // We always shrink wrap when given an unconstrained width. - if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) && + if ((0 == (NS_BLOCK_SHRINK_WRAP & mState)) && !aState.mUnconstrainedWidth && !compact) { // Set our width to the max width if we aren't already that @@ -5804,10 +5801,10 @@ nsBlockFrame::Init(nsIPresContext& aPresContext, nsIFrame* aPrevInFlow) { if (aPrevInFlow) { - // Copy over the block/area frame flags + // Copy over the block/area frame type flags nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow; - SetFlags(blockFrame->mFlags); + SetFlags(blockFrame->mState & NS_BLOCK_FLAGS_MASK); } nsresult rv = nsBlockFrameSuper::Init(aPresContext, aContent, aParent, diff --git a/mozilla/layout/generic/nsHTMLParts.h b/mozilla/layout/generic/nsHTMLParts.h index 15412a25526..b4cb8e84531 100644 --- a/mozilla/layout/generic/nsHTMLParts.h +++ b/mozilla/layout/generic/nsHTMLParts.h @@ -241,12 +241,12 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, // policies. // Flags for block/area frames -#define NS_BLOCK_SHRINK_WRAP 0x1 -#define NS_BLOCK_NO_AUTO_MARGINS 0x2 -#define NS_BLOCK_MARGIN_ROOT 0x4 -#define NS_BLOCK_DOCUMENT_ROOT 0x8 -#define NS_BLOCK_SPACE_MGR 0x10 -#define NS_BLOCK_WRAP_SIZE 0x20 +#define NS_BLOCK_SHRINK_WRAP 0x00010000 +#define NS_BLOCK_NO_AUTO_MARGINS 0x00020000 +#define NS_BLOCK_MARGIN_ROOT 0x00040000 +#define NS_BLOCK_SPACE_MGR 0x00080000 +#define NS_BLOCK_WRAP_SIZE 0x00100000 +#define NS_BLOCK_FLAGS_MASK 0x00ff0000 // Create a frame that supports "display: block" layout behavior extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame, @@ -261,7 +261,7 @@ 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_BLOCK_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". @@ -279,7 +279,7 @@ inline nsresult NS_NewTableCaptionFrame(nsIFrame** aNewFrame) { // 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); + return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT); } // This type of AreaFrame is a margin root, but does not shrink wrap diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index 0fc242578d5..275681f0853 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -1195,9 +1195,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con if (0 != mState) { fprintf(out, " [state=%08x]", mState); } - if (0 != mFlags) { - fprintf(out, " [flags=%x]", mFlags); - } PRInt32 numInlineLines = 0; PRInt32 numBlockLines = 0; if (nsnull != mLines) { @@ -1393,7 +1390,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Should we create a space manager? nsCOMPtr spaceManager; - if (mFlags & NS_BLOCK_SPACE_MGR) { + if (NS_BLOCK_SPACE_MGR & mState) { nsSpaceManager* rawPtr = new nsSpaceManager(this); if (!rawPtr) { return NS_ERROR_OUT_OF_MEMORY; @@ -1407,7 +1404,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics); - if (NS_BLOCK_MARGIN_ROOT & mFlags) { + if (NS_BLOCK_MARGIN_ROOT & mState) { state.mIsTopMarginRoot = PR_TRUE; state.mIsBottomMarginRoot = PR_TRUE; } @@ -1505,7 +1502,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); - if (mFlags & NS_BLOCK_WRAP_SIZE) { + if (NS_BLOCK_WRAP_SIZE & mState) { // 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. @@ -1767,7 +1764,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, // There are two options here. We either shrink wrap around our // contents or we fluff out to the maximum block width. Note: // We always shrink wrap when given an unconstrained width. - if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) && + if ((0 == (NS_BLOCK_SHRINK_WRAP & mState)) && !aState.mUnconstrainedWidth && !compact) { // Set our width to the max width if we aren't already that @@ -5804,10 +5801,10 @@ nsBlockFrame::Init(nsIPresContext& aPresContext, nsIFrame* aPrevInFlow) { if (aPrevInFlow) { - // Copy over the block/area frame flags + // Copy over the block/area frame type flags nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow; - SetFlags(blockFrame->mFlags); + SetFlags(blockFrame->mState & NS_BLOCK_FLAGS_MASK); } nsresult rv = nsBlockFrameSuper::Init(aPresContext, aContent, aParent, diff --git a/mozilla/layout/html/base/src/nsBlockFrame.h b/mozilla/layout/html/base/src/nsBlockFrame.h index 75963c51ad1..51d24c11745 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.h +++ b/mozilla/layout/html/base/src/nsBlockFrame.h @@ -20,6 +20,7 @@ #define nsBlockFrame_h___ #include "nsHTMLContainerFrame.h" +#include "nsHTMLParts.h" class nsBlockReflowState; class nsBulletFrame; @@ -36,11 +37,12 @@ class nsFirstLineFrame; #define NS_BLOCK_FRAME_LAST_LIST_INDEX NS_BLOCK_FRAME_BULLET_LIST_INDEX /** - * Additional frame-state bits + * Additional frame-state bits. There are more of these bits + * defined in nsHTMLParts.h (XXX: note: this should be cleaned up) */ #define NS_BLOCK_FRAME_HAS_OUTSIDE_BULLET 0x80000000 #define NS_BLOCK_IS_HTML_PARAGRAPH 0x40000000 -#define NS_BLOCK_HAS_FIRST_LETTER_STYLE 0x10000000 +#define NS_BLOCK_HAS_FIRST_LETTER_STYLE 0x20000000 #define nsBlockFrameSuper nsHTMLContainerFrame @@ -144,7 +146,8 @@ protected: nsIStyleContext* GetFirstLetterStyle(nsIPresContext* aPresContext); void SetFlags(PRUint32 aFlags) { - mFlags = aFlags; + mState &= ~NS_BLOCK_FLAGS_MASK; + mState |= aFlags; } PRBool HaveOutsideBullet() const { @@ -346,9 +349,6 @@ protected: nsLineBox* mLines; - // XXX subclass! - PRUint32 mFlags; - // Text run information nsTextRun* mTextRuns; diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index 0fc242578d5..275681f0853 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -1195,9 +1195,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con if (0 != mState) { fprintf(out, " [state=%08x]", mState); } - if (0 != mFlags) { - fprintf(out, " [flags=%x]", mFlags); - } PRInt32 numInlineLines = 0; PRInt32 numBlockLines = 0; if (nsnull != mLines) { @@ -1393,7 +1390,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Should we create a space manager? nsCOMPtr spaceManager; - if (mFlags & NS_BLOCK_SPACE_MGR) { + if (NS_BLOCK_SPACE_MGR & mState) { nsSpaceManager* rawPtr = new nsSpaceManager(this); if (!rawPtr) { return NS_ERROR_OUT_OF_MEMORY; @@ -1407,7 +1404,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics); - if (NS_BLOCK_MARGIN_ROOT & mFlags) { + if (NS_BLOCK_MARGIN_ROOT & mState) { state.mIsTopMarginRoot = PR_TRUE; state.mIsBottomMarginRoot = PR_TRUE; } @@ -1505,7 +1502,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); - if (mFlags & NS_BLOCK_WRAP_SIZE) { + if (NS_BLOCK_WRAP_SIZE & mState) { // 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. @@ -1767,7 +1764,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, // There are two options here. We either shrink wrap around our // contents or we fluff out to the maximum block width. Note: // We always shrink wrap when given an unconstrained width. - if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) && + if ((0 == (NS_BLOCK_SHRINK_WRAP & mState)) && !aState.mUnconstrainedWidth && !compact) { // Set our width to the max width if we aren't already that @@ -5804,10 +5801,10 @@ nsBlockFrame::Init(nsIPresContext& aPresContext, nsIFrame* aPrevInFlow) { if (aPrevInFlow) { - // Copy over the block/area frame flags + // Copy over the block/area frame type flags nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow; - SetFlags(blockFrame->mFlags); + SetFlags(blockFrame->mState & NS_BLOCK_FLAGS_MASK); } nsresult rv = nsBlockFrameSuper::Init(aPresContext, aContent, aParent, diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index 0fc242578d5..275681f0853 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -1195,9 +1195,6 @@ nsBlockFrame::List(nsIPresContext* aPresContext, FILE* out, PRInt32 aIndent) con if (0 != mState) { fprintf(out, " [state=%08x]", mState); } - if (0 != mFlags) { - fprintf(out, " [flags=%x]", mFlags); - } PRInt32 numInlineLines = 0; PRInt32 numBlockLines = 0; if (nsnull != mLines) { @@ -1393,7 +1390,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Should we create a space manager? nsCOMPtr spaceManager; - if (mFlags & NS_BLOCK_SPACE_MGR) { + if (NS_BLOCK_SPACE_MGR & mState) { nsSpaceManager* rawPtr = new nsSpaceManager(this); if (!rawPtr) { return NS_ERROR_OUT_OF_MEMORY; @@ -1407,7 +1404,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, } nsBlockReflowState state(aReflowState, &aPresContext, this, aMetrics); - if (NS_BLOCK_MARGIN_ROOT & mFlags) { + if (NS_BLOCK_MARGIN_ROOT & mState) { state.mIsTopMarginRoot = PR_TRUE; state.mIsBottomMarginRoot = PR_TRUE; } @@ -1505,7 +1502,7 @@ nsBlockFrame::Reflow(nsIPresContext& aPresContext, // Compute our final size ComputeFinalSize(aReflowState, state, aMetrics); - if (mFlags & NS_BLOCK_WRAP_SIZE) { + if (NS_BLOCK_WRAP_SIZE & mState) { // 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. @@ -1767,7 +1764,7 @@ nsBlockFrame::ComputeFinalSize(const nsHTMLReflowState& aReflowState, // There are two options here. We either shrink wrap around our // contents or we fluff out to the maximum block width. Note: // We always shrink wrap when given an unconstrained width. - if ((0 == (NS_BLOCK_SHRINK_WRAP & mFlags)) && + if ((0 == (NS_BLOCK_SHRINK_WRAP & mState)) && !aState.mUnconstrainedWidth && !compact) { // Set our width to the max width if we aren't already that @@ -5804,10 +5801,10 @@ nsBlockFrame::Init(nsIPresContext& aPresContext, nsIFrame* aPrevInFlow) { if (aPrevInFlow) { - // Copy over the block/area frame flags + // Copy over the block/area frame type flags nsBlockFrame* blockFrame = (nsBlockFrame*)aPrevInFlow; - SetFlags(blockFrame->mFlags); + SetFlags(blockFrame->mState & NS_BLOCK_FLAGS_MASK); } nsresult rv = nsBlockFrameSuper::Init(aPresContext, aContent, aParent, diff --git a/mozilla/layout/html/base/src/nsHTMLParts.h b/mozilla/layout/html/base/src/nsHTMLParts.h index 15412a25526..b4cb8e84531 100644 --- a/mozilla/layout/html/base/src/nsHTMLParts.h +++ b/mozilla/layout/html/base/src/nsHTMLParts.h @@ -241,12 +241,12 @@ NS_CreateHTMLElement(nsIHTMLContent** aResult, // policies. // Flags for block/area frames -#define NS_BLOCK_SHRINK_WRAP 0x1 -#define NS_BLOCK_NO_AUTO_MARGINS 0x2 -#define NS_BLOCK_MARGIN_ROOT 0x4 -#define NS_BLOCK_DOCUMENT_ROOT 0x8 -#define NS_BLOCK_SPACE_MGR 0x10 -#define NS_BLOCK_WRAP_SIZE 0x20 +#define NS_BLOCK_SHRINK_WRAP 0x00010000 +#define NS_BLOCK_NO_AUTO_MARGINS 0x00020000 +#define NS_BLOCK_MARGIN_ROOT 0x00040000 +#define NS_BLOCK_SPACE_MGR 0x00080000 +#define NS_BLOCK_WRAP_SIZE 0x00100000 +#define NS_BLOCK_FLAGS_MASK 0x00ff0000 // Create a frame that supports "display: block" layout behavior extern nsresult NS_NewBlockFrame(nsIFrame** aNewFrame, @@ -261,7 +261,7 @@ 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_BLOCK_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". @@ -279,7 +279,7 @@ inline nsresult NS_NewTableCaptionFrame(nsIFrame** aNewFrame) { // 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); + return NS_NewAreaFrame(aNewFrame, NS_BLOCK_SPACE_MGR|NS_BLOCK_MARGIN_ROOT); } // This type of AreaFrame is a margin root, but does not shrink wrap