From bde1c4256efa69bf6a1153c124ee67eb6e4f335c Mon Sep 17 00:00:00 2001 From: "roc+%cs.cmu.edu" Date: Tue, 26 Jul 2005 21:35:59 +0000 Subject: [PATCH] Bug 299742. Blocks that contain lines with clearance need not reflow those lines if there are no floats in the space manager yet and no lines need to be reflowed otherwise. --- layout/generic/nsBlockFrame.cpp | 6 ++++-- layout/generic/nsSpaceManager.h | 2 ++ 2 files changed, 6 insertions(+), 2 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 6519777020e..42ad93b19ff 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -680,8 +680,10 @@ nsBlockFrame::Reflow(nsPresContext* aPresContext, // See if it's an incremental reflow command targeted only at // absolute frames and we can skip ReflowDirtyLines(). PRBool needToReflowLines = aMetrics.mComputeMEW || - // If we have lines with clearance, we need to check their positions - (GetStateBits() & NS_BLOCK_HAS_CLEAR_CHILDREN) || + // If we have lines with clearance, and the space manager already has + // floats, we need to check the positions of our lines with clearance + ((GetStateBits() & NS_BLOCK_HAS_CLEAR_CHILDREN) && + aReflowState.mSpaceManager->HasAnyFloats()) || // The areas of any floats in this block or in blocks under us // need to be put into the space manager --- unless we are our own // space manager, in which case it doesn't matter. diff --git a/layout/generic/nsSpaceManager.h b/layout/generic/nsSpaceManager.h index f903308497c..4cbcb155875 100644 --- a/layout/generic/nsSpaceManager.h +++ b/layout/generic/nsSpaceManager.h @@ -281,6 +281,8 @@ public: */ void ClearRegions(); + PRBool HasAnyFloats() { return mFrameInfoMap != nsnull; } + /** * Methods for dealing with the propagation of float damage during * reflow.