From 901b911c7d36325a277abe7bca2bc4e76ee62bad Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Wed, 7 Oct 2015 00:54:51 +0200 Subject: [PATCH] Bug 790260 - Make CollectFloats remove the IS_PUSHED_FLOAT bit in case the float was collected from the PushedFloats list. r=roc --- layout/generic/nsBlockFrame.cpp | 17 +++++++++++++++++ 1 file changed, 17 insertions(+) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index 15d614925d1d..d55b3befb424 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -2001,6 +2001,8 @@ nsBlockFrame::ReparentFloats(nsIFrame* aFirstFrame, nsBlockFrame* aOldParent, aOldParent->CollectFloats(aFirstFrame, list, aReparentSiblings); if (list.NotEmpty()) { for (nsIFrame* f : list) { + MOZ_ASSERT(!(f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT), + "CollectFloats should've removed that bit"); ReparentFrame(f, aOldParent, this); } mFloats.AppendFrames(nullptr, list); @@ -4576,6 +4578,12 @@ nsBlockFrame::PushLines(nsBlockReflowState& aState, CollectFloats(overBegin->mFirstChild, floats, true); if (floats.NotEmpty()) { +#ifdef DEBUG + for (nsIFrame* f : floats) { + MOZ_ASSERT(!(f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT), + "CollectFloats should've removed that bit"); + } +#endif // Push the floats onto the front of the overflow out-of-flows list nsAutoOOFFrameList oofs(this); oofs.mList.InsertFrames(nullptr, nullptr, floats); @@ -4705,6 +4713,12 @@ nsBlockFrame::DrainSelfOverflowList() // already ours. But we should put overflow floats back in mFloats. nsAutoOOFFrameList oofs(this); if (oofs.mList.NotEmpty()) { +#ifdef DEBUG + for (nsIFrame* f : oofs.mList) { + MOZ_ASSERT(!(f->GetStateBits() & NS_FRAME_IS_PUSHED_FLOAT), + "CollectFloats should've removed that bit"); + } +#endif // The overflow floats go after our regular floats. mFloats.AppendFrames(nullptr, oofs.mList); } @@ -7171,6 +7185,9 @@ nsBlockFrame::DoCollectFloats(nsIFrame* aFrame, nsFrameList& aList, nsLayoutUtils::GetFloatFromPlaceholder(aFrame) : nullptr; while (outOfFlowFrame && outOfFlowFrame->GetParent() == this) { RemoveFloat(outOfFlowFrame); + // Remove the IS_PUSHED_FLOAT bit, in case |outOfFlowFrame| came from + // the PushedFloats list. + outOfFlowFrame->RemoveStateBits(NS_FRAME_IS_PUSHED_FLOAT); aList.AppendFrame(nullptr, outOfFlowFrame); outOfFlowFrame = outOfFlowFrame->GetNextInFlow(); // FIXME: By not pulling floats whose parent is one of our