From 4051bf71de37555b6388e30f0ba19388bffc774c Mon Sep 17 00:00:00 2001 From: "troy%netscape.com" Date: Wed, 29 Sep 1999 05:09:19 +0000 Subject: [PATCH] Fix for bug #15152. Moved check for "no wrap" inside of loop. This fixes a problem where blocks inside of blocks were not getting marked dirty git-svn-id: svn://10.0.0.236/trunk@49303 18797224-902f-48f8-a5cc-f745e15eee43 --- mozilla/layout/generic/nsBlockFrame.cpp | 14 ++++---------- mozilla/layout/generic/nsBlockReflowState.cpp | 14 ++++---------- mozilla/layout/generic/nsBlockReflowState.h | 14 ++++---------- mozilla/layout/html/base/src/nsBlockFrame.cpp | 14 ++++---------- .../layout/html/base/src/nsBlockReflowState.cpp | 14 ++++---------- mozilla/layout/html/base/src/nsBlockReflowState.h | 14 ++++---------- 6 files changed, 24 insertions(+), 60 deletions(-) diff --git a/mozilla/layout/generic/nsBlockFrame.cpp b/mozilla/layout/generic/nsBlockFrame.cpp index b842e84a744..dcd40ca9bd1 100644 --- a/mozilla/layout/generic/nsBlockFrame.cpp +++ b/mozilla/layout/generic/nsBlockFrame.cpp @@ -1885,12 +1885,6 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) mStyleContext->GetStyleData(eStyleStruct_Text); if (NS_STYLE_TEXT_ALIGN_LEFT == mStyleText->mTextAlign) { - // If it's preformatted text, then we don't need to mark any lines - // as dirty - if (aState.mNoWrap) { - return NS_OK; - } - tryAndSkipLines = PR_TRUE; } } @@ -1902,15 +1896,15 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) aState.mReflowState.mComputedWidth; while (nsnull != line) { - // We don't have to mark the line dirty if: + // We don't have to mark the line dirty if all of the following are true: // - the line fits within the new available space // - it's inline (not a block) - // - it's either the last line in the block -or- it ended with a - // break after + // - we're not wrapping text -or- it's the last line in the block -or- the + // line ended with a break after // - there are no floaters associated with the line (reflowing the // placeholder frame causes the floater to be reflowed) if (line->IsBlock() || - (line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || + (!aState.mNoWrap && line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || line->mFloaters.NotEmpty() || (line->mBounds.XMost() > newAvailWidth)) { diff --git a/mozilla/layout/generic/nsBlockReflowState.cpp b/mozilla/layout/generic/nsBlockReflowState.cpp index b842e84a744..dcd40ca9bd1 100644 --- a/mozilla/layout/generic/nsBlockReflowState.cpp +++ b/mozilla/layout/generic/nsBlockReflowState.cpp @@ -1885,12 +1885,6 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) mStyleContext->GetStyleData(eStyleStruct_Text); if (NS_STYLE_TEXT_ALIGN_LEFT == mStyleText->mTextAlign) { - // If it's preformatted text, then we don't need to mark any lines - // as dirty - if (aState.mNoWrap) { - return NS_OK; - } - tryAndSkipLines = PR_TRUE; } } @@ -1902,15 +1896,15 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) aState.mReflowState.mComputedWidth; while (nsnull != line) { - // We don't have to mark the line dirty if: + // We don't have to mark the line dirty if all of the following are true: // - the line fits within the new available space // - it's inline (not a block) - // - it's either the last line in the block -or- it ended with a - // break after + // - we're not wrapping text -or- it's the last line in the block -or- the + // line ended with a break after // - there are no floaters associated with the line (reflowing the // placeholder frame causes the floater to be reflowed) if (line->IsBlock() || - (line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || + (!aState.mNoWrap && line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || line->mFloaters.NotEmpty() || (line->mBounds.XMost() > newAvailWidth)) { diff --git a/mozilla/layout/generic/nsBlockReflowState.h b/mozilla/layout/generic/nsBlockReflowState.h index b842e84a744..dcd40ca9bd1 100644 --- a/mozilla/layout/generic/nsBlockReflowState.h +++ b/mozilla/layout/generic/nsBlockReflowState.h @@ -1885,12 +1885,6 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) mStyleContext->GetStyleData(eStyleStruct_Text); if (NS_STYLE_TEXT_ALIGN_LEFT == mStyleText->mTextAlign) { - // If it's preformatted text, then we don't need to mark any lines - // as dirty - if (aState.mNoWrap) { - return NS_OK; - } - tryAndSkipLines = PR_TRUE; } } @@ -1902,15 +1896,15 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) aState.mReflowState.mComputedWidth; while (nsnull != line) { - // We don't have to mark the line dirty if: + // We don't have to mark the line dirty if all of the following are true: // - the line fits within the new available space // - it's inline (not a block) - // - it's either the last line in the block -or- it ended with a - // break after + // - we're not wrapping text -or- it's the last line in the block -or- the + // line ended with a break after // - there are no floaters associated with the line (reflowing the // placeholder frame causes the floater to be reflowed) if (line->IsBlock() || - (line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || + (!aState.mNoWrap && line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || line->mFloaters.NotEmpty() || (line->mBounds.XMost() > newAvailWidth)) { diff --git a/mozilla/layout/html/base/src/nsBlockFrame.cpp b/mozilla/layout/html/base/src/nsBlockFrame.cpp index b842e84a744..dcd40ca9bd1 100644 --- a/mozilla/layout/html/base/src/nsBlockFrame.cpp +++ b/mozilla/layout/html/base/src/nsBlockFrame.cpp @@ -1885,12 +1885,6 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) mStyleContext->GetStyleData(eStyleStruct_Text); if (NS_STYLE_TEXT_ALIGN_LEFT == mStyleText->mTextAlign) { - // If it's preformatted text, then we don't need to mark any lines - // as dirty - if (aState.mNoWrap) { - return NS_OK; - } - tryAndSkipLines = PR_TRUE; } } @@ -1902,15 +1896,15 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) aState.mReflowState.mComputedWidth; while (nsnull != line) { - // We don't have to mark the line dirty if: + // We don't have to mark the line dirty if all of the following are true: // - the line fits within the new available space // - it's inline (not a block) - // - it's either the last line in the block -or- it ended with a - // break after + // - we're not wrapping text -or- it's the last line in the block -or- the + // line ended with a break after // - there are no floaters associated with the line (reflowing the // placeholder frame causes the floater to be reflowed) if (line->IsBlock() || - (line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || + (!aState.mNoWrap && line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || line->mFloaters.NotEmpty() || (line->mBounds.XMost() > newAvailWidth)) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.cpp b/mozilla/layout/html/base/src/nsBlockReflowState.cpp index b842e84a744..dcd40ca9bd1 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.cpp +++ b/mozilla/layout/html/base/src/nsBlockReflowState.cpp @@ -1885,12 +1885,6 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) mStyleContext->GetStyleData(eStyleStruct_Text); if (NS_STYLE_TEXT_ALIGN_LEFT == mStyleText->mTextAlign) { - // If it's preformatted text, then we don't need to mark any lines - // as dirty - if (aState.mNoWrap) { - return NS_OK; - } - tryAndSkipLines = PR_TRUE; } } @@ -1902,15 +1896,15 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) aState.mReflowState.mComputedWidth; while (nsnull != line) { - // We don't have to mark the line dirty if: + // We don't have to mark the line dirty if all of the following are true: // - the line fits within the new available space // - it's inline (not a block) - // - it's either the last line in the block -or- it ended with a - // break after + // - we're not wrapping text -or- it's the last line in the block -or- the + // line ended with a break after // - there are no floaters associated with the line (reflowing the // placeholder frame causes the floater to be reflowed) if (line->IsBlock() || - (line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || + (!aState.mNoWrap && line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || line->mFloaters.NotEmpty() || (line->mBounds.XMost() > newAvailWidth)) { diff --git a/mozilla/layout/html/base/src/nsBlockReflowState.h b/mozilla/layout/html/base/src/nsBlockReflowState.h index b842e84a744..dcd40ca9bd1 100644 --- a/mozilla/layout/html/base/src/nsBlockReflowState.h +++ b/mozilla/layout/html/base/src/nsBlockReflowState.h @@ -1885,12 +1885,6 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) mStyleContext->GetStyleData(eStyleStruct_Text); if (NS_STYLE_TEXT_ALIGN_LEFT == mStyleText->mTextAlign) { - // If it's preformatted text, then we don't need to mark any lines - // as dirty - if (aState.mNoWrap) { - return NS_OK; - } - tryAndSkipLines = PR_TRUE; } } @@ -1902,15 +1896,15 @@ nsBlockFrame::PrepareResizeReflow(nsBlockReflowState& aState) aState.mReflowState.mComputedWidth; while (nsnull != line) { - // We don't have to mark the line dirty if: + // We don't have to mark the line dirty if all of the following are true: // - the line fits within the new available space // - it's inline (not a block) - // - it's either the last line in the block -or- it ended with a - // break after + // - we're not wrapping text -or- it's the last line in the block -or- the + // line ended with a break after // - there are no floaters associated with the line (reflowing the // placeholder frame causes the floater to be reflowed) if (line->IsBlock() || - (line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || + (!aState.mNoWrap && line->mNext && (line->mBreakType == NS_STYLE_CLEAR_NONE)) || line->mFloaters.NotEmpty() || (line->mBounds.XMost() > newAvailWidth)) {