зеркало из https://github.com/mozilla/gecko-dev.git
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:
Родитель
72a74dab8e
Коммит
cddf1ab187
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
Загрузка…
Ссылка в новой задаче