From 03bd1366df81004dd53eeb0553c6f97b4559fe3f Mon Sep 17 00:00:00 2001 From: Mats Palmgren Date: Mon, 16 Nov 2015 17:32:39 +0100 Subject: [PATCH] Bug 1153695 - Wrap nsAutoOOFFrameList in a scope to ensure its dtor runs before the VerifyOverflowSituation() call (to avoid frames appearing to be on two child lists). r=roc --- layout/generic/nsBlockFrame.cpp | 20 +++++++++++--------- 1 file changed, 11 insertions(+), 9 deletions(-) diff --git a/layout/generic/nsBlockFrame.cpp b/layout/generic/nsBlockFrame.cpp index ed0f34161f85..7999202c5cdf 100644 --- a/layout/generic/nsBlockFrame.cpp +++ b/layout/generic/nsBlockFrame.cpp @@ -4713,18 +4713,20 @@ nsBlockFrame::DrainSelfOverflowList() // No need to reparent frames in our own overflow lines/oofs, because they're // already ours. But we should put overflow floats back in mFloats. - nsAutoOOFFrameList oofs(this); - if (oofs.mList.NotEmpty()) { + // (explicit scope to remove the OOF list before VerifyOverflowSituation) + { + 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"); - } + 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); + // The overflow floats go after our regular floats. + mFloats.AppendFrames(nullptr, oofs.mList); + } } - if (!ourOverflowLines->mLines.empty()) { mFrames.AppendFrames(nullptr, ourOverflowLines->mFrames); mLines.splice(mLines.end(), ourOverflowLines->mLines);