Bug 828312 patch 2: Make list renumbering code set NS_FRAME_HAS_DIRTY_CHILDREN correctly on intermediate blocks and inlines, and NS_FRAME_IS_DIRTY correctly on the bullets. r=bzbarsky

The change to mark NS_FRAME_IS_DIRTY on the bullets fixes a failure in
layout/reftests/bugs/418574-1.html exposed by patch 3.
This commit is contained in:
L. David Baron 2013-05-10 17:35:08 -07:00
Родитель 72a74dab8e
Коммит cddf1ab187
2 изменённых файлов: 23 добавлений и 2 удалений

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

@ -6660,6 +6660,15 @@ nsBlockFrame::RenumberListsInBlock(nsPresContext* aPresContext,
}
} while (bifLineIter.Next());
// We need to set NS_FRAME_HAS_DIRTY_CHILDREN bits up the tree between
// the bullet and the caller of RenumberLists. But the caller itself
// has to be responsible for setting the bit itself, since that caller
// might be making a FrameNeedsReflow call, which requires that the
// bit not be set yet.
if (renumberedABullet && aDepth != 0) {
aBlockFrame->AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
}
return renumberedABullet;
}
@ -6704,8 +6713,18 @@ nsBlockFrame::RenumberListsFor(nsPresContext* aPresContext,
if (changed) {
kidRenumberedABullet = true;
// The ordinal changed - mark the bullet frame dirty.
listItem->ChildIsDirty(bullet);
// The ordinal changed - mark the bullet frame, and any
// intermediate frames between it and the block (are there
// ever any?), dirty.
// The calling code will make the necessary FrameNeedsReflow
// call for the list ancestor.
bullet->AddStateBits(NS_FRAME_IS_DIRTY);
nsIFrame *f = bullet;
do {
nsIFrame *parent = f->GetParent();
parent->ChildIsDirty(f);
f = parent;
} while (f != listItem);
}
}

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

@ -360,6 +360,8 @@ nsContainerFrame::BuildDisplayListForNonBlockChildren(nsDisplayListBuilder* aB
/* virtual */ void
nsContainerFrame::ChildIsDirty(nsIFrame* aChild)
{
NS_ASSERTION(NS_SUBTREE_DIRTY(aChild), "child isn't actually dirty");
AddStateBits(NS_FRAME_HAS_DIRTY_CHILDREN);
}