From d4ad679a1007be4b88dfbfb3a99c304b658dc37b Mon Sep 17 00:00:00 2001 From: "L. David Baron" Date: Thu, 5 Aug 2010 21:59:19 -0700 Subject: [PATCH] nsBlockFrame::ReflowFloatContinuations doesn't need anything in AddFloat other than FlowAndPlaceFloat. (Bug 563584, patch 14) r=roc --- layout/generic/nsBlockFrame.cpp | 2 +- layout/generic/nsBlockReflowState.cpp | 20 +++++++++----------- 2 files changed, 10 insertions(+), 12 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index fa5650108b7..e5721671a40 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -5750,7 +5750,7 @@ nsBlockFrame::ReflowFloatContinuations(nsBlockReflowState& aState, // Reflow nsReflowStatus fStatus = NS_FRAME_COMPLETE; - aState.AddFloat(nsnull, f, aState.mContentArea.width, fStatus); + aState.FlowAndPlaceFloat(f, fStatus); if (!NS_FRAME_IS_FULLY_COMPLETE(fStatus)) { rv = SplitFloat(aState, f, fStatus); NS_ENSURE_SUCCESS(rv, rv); diff --git a/layout/generic/nsBlockReflowState.cpp b/layout/generic/nsBlockReflowState.cpp index d569e76134a..7a9cc41f804 100644 --- a/layout/generic/nsBlockReflowState.cpp +++ b/layout/generic/nsBlockReflowState.cpp @@ -542,7 +542,8 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout, nscoord aAvailableWidth, nsReflowStatus& aReflowStatus) { - NS_PRECONDITION(!aLineLayout || mBlock->end_lines() != mCurrentLine, "null ptr"); + NS_PRECONDITION(aLineLayout, "must have line layout"); + NS_PRECONDITION(mBlock->end_lines() != mCurrentLine, "null ptr"); NS_PRECONDITION(aFloat->GetStateBits() & NS_FRAME_OUT_OF_FLOW, "aFloat must be an out-of-flow frame"); @@ -570,11 +571,10 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout, // don't let this one go on the current line, since that would violate // float ordering. nsRect floatAvailableSpace = GetFloatAvailableSpace().mRect; - if (!aLineLayout || - (mBelowCurrentLineFloats.IsEmpty() && - (aLineLayout->LineIsEmpty() || - mBlock->ComputeFloatWidth(*this, floatAvailableSpace, aFloat) - <= aAvailableWidth))) { + if (mBelowCurrentLineFloats.IsEmpty() && + (aLineLayout->LineIsEmpty() || + mBlock->ComputeFloatWidth(*this, floatAvailableSpace, aFloat) + <= aAvailableWidth)) { nsFloatManager::SavedState floatManagerState; mFloatManager->PushState(&floatManagerState); @@ -586,11 +586,9 @@ nsBlockReflowState::AddFloat(nsLineLayout* aLineLayout, nsRect availSpace(nsPoint(floatAvailSpace.mRect.x + BorderPadding().left, mY), floatAvailSpace.mRect.Size()); - if (aLineLayout) { - aLineLayout->UpdateBand(availSpace, aFloat); - // Record this float in the current-line list - mCurrentLineFloats.Append(mFloatCacheFreeList.Alloc(aFloat)); - } + aLineLayout->UpdateBand(availSpace, aFloat); + // Record this float in the current-line list + mCurrentLineFloats.Append(mFloatCacheFreeList.Alloc(aFloat)); } else { if (placed) {