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

This commit is contained in:
Mats Palmgren 2015-11-16 17:32:39 +01:00
Родитель 313a973bc0
Коммит 6e7818f946
1 изменённых файлов: 11 добавлений и 9 удалений

Просмотреть файл

@ -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);