Bug 735898. Part 5: Simple tweaks to avoid wrapping empty lists and to reorder boolean tests. r=mattwoodrow

This commit is contained in:
Robert O'Callahan 2012-04-16 17:43:47 +12:00
parent 99b4ec2a83
commit 659fb75915
2 changed files with 11 additions and 7 deletions

View File

@ -2155,13 +2155,17 @@ nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
(aFlags & DISPLAY_CHILD_FORCE_STACKING_CONTEXT)) {
// Genuine stacking contexts, and positioned pseudo-stacking-contexts,
// go in this level.
rv = aLists.PositionedDescendants()->AppendNewToTop(new (aBuilder)
nsDisplayWrapList(aBuilder, child, &list));
NS_ENSURE_SUCCESS(rv, rv);
if (!list.IsEmpty()) {
rv = aLists.PositionedDescendants()->AppendNewToTop(new (aBuilder)
nsDisplayWrapList(aBuilder, child, &list));
NS_ENSURE_SUCCESS(rv, rv);
}
} else if (disp->IsFloating()) {
rv = aLists.Floats()->AppendNewToTop(new (aBuilder)
nsDisplayWrapList(aBuilder, child, &list));
NS_ENSURE_SUCCESS(rv, rv);
if (!list.IsEmpty()) {
rv = aLists.Floats()->AppendNewToTop(new (aBuilder)
nsDisplayWrapList(aBuilder, child, &list));
NS_ENSURE_SUCCESS(rv, rv);
}
} else {
aLists.Content()->AppendToTop(&list);
}

View File

@ -612,8 +612,8 @@ public:
// If we're paginated and a block, and have NS_BLOCK_CLIP_PAGINATED_OVERFLOW
// set, then we want to clip our overflow.
return
aFrame->PresContext()->IsPaginated() &&
(aFrame->GetStateBits() & NS_BLOCK_CLIP_PAGINATED_OVERFLOW) != 0 &&
aFrame->PresContext()->IsPaginated() &&
aFrame->GetType() == nsGkAtoms::blockFrame;
}