diff --git a/layout/generic/BlockReflowInput.cpp b/layout/generic/BlockReflowInput.cpp index 26ea6a465368..074dc396ce30 100644 --- a/layout/generic/BlockReflowInput.cpp +++ b/layout/generic/BlockReflowInput.cpp @@ -1065,10 +1065,10 @@ BlockReflowInput::PushFloatPastBreak(nsIFrame *aFloat) * Place below-current-line floats. */ void -BlockReflowInput::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList, - nsLineBox* aLine) +BlockReflowInput::PlaceBelowCurrentLineFloats(nsLineBox* aLine) { - nsFloatCache* fc = aList.Head(); + MOZ_ASSERT(mBelowCurrentLineFloats.NotEmpty()); + nsFloatCache* fc = mBelowCurrentLineFloats.Head(); while (fc) { #ifdef DEBUG if (nsBlockFrame::gNoisyReflow) { @@ -1082,12 +1082,13 @@ BlockReflowInput::PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aList, bool placed = FlowAndPlaceFloat(fc->mFloat); nsFloatCache *next = fc->Next(); if (!placed) { - aList.Remove(fc); + mBelowCurrentLineFloats.Remove(fc); delete fc; aLine->SetHadFloatPushed(); } fc = next; } + aLine->AppendFloats(mBelowCurrentLineFloats); } nscoord diff --git a/layout/generic/BlockReflowInput.h b/layout/generic/BlockReflowInput.h index 8f5933a1b89f..2aa91c672f44 100644 --- a/layout/generic/BlockReflowInput.h +++ b/layout/generic/BlockReflowInput.h @@ -154,8 +154,7 @@ public: bool FlowAndPlaceFloat(nsIFrame* aFloat); - void PlaceBelowCurrentLineFloats(nsFloatCacheFreeList& aFloats, - nsLineBox* aLine); + void PlaceBelowCurrentLineFloats(nsLineBox* aLine); // Returns the first coordinate >= aBCoord that clears the // floats indicated by aBreakType and has enough inline size between floats diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 57ea749ff68b..294b27551392 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -4802,8 +4802,7 @@ nsBlockFrame::PlaceLine(BlockReflowInput& aState, if (aState.mBelowCurrentLineFloats.NotEmpty()) { // Reflow the below-current-line floats, which places on the line's // float list. - aState.PlaceBelowCurrentLineFloats(aState.mBelowCurrentLineFloats, aLine); - aLine->AppendFloats(aState.mBelowCurrentLineFloats); + aState.PlaceBelowCurrentLineFloats(aLine); } // When a line has floats, factor them into the combined-area