Bug 334690. Fix regression in z-ordering of table cell content for event handling. r=bernd

This commit is contained in:
roc+%cs.cmu.edu 2006-05-01 01:18:32 +00:00
Родитель 91551fe45d
Коммит 33f7a99240
1 изменённых файлов: 9 добавлений и 10 удалений

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

@ -1405,19 +1405,18 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
PRBool aIsRoot)
{
nsDisplayList eventsBorderBackground;
// If we need to sort the event backgrounds, then we'll put descendant
// border-backgrounds into their own list so we don't accidentally sort
// some ancestor's border-background.
// If we need to sort the event backgrounds, then we'll put descendants'
// display items into their own set of lists.
PRBool sortEventBackgrounds = aIsRoot && aBuilder->IsForEventDelivery();
nsDisplayListSet lists(aLists,
sortEventBackgrounds ? &eventsBorderBackground : aLists.BorderBackground());
nsDisplayListCollection separatedCollection;
const nsDisplayListSet* lists = sortEventBackgrounds ? &separatedCollection : &aLists;
// Create dedicated background display items per-frame when we're
// handling events.
// XXX how to handle collapsed borders?
if (aBuilder->IsForEventDelivery() &&
aFrame->IsVisibleForPainting(aBuilder)) {
nsresult rv = lists.BorderBackground()->AppendNewToTop(new (aBuilder)
nsresult rv = lists->BorderBackground()->AppendNewToTop(new (aBuilder)
nsDisplayBackground(aFrame));
NS_ENSURE_SUCCESS(rv, rv);
}
@ -1432,7 +1431,7 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
// lets us get cell borders into the nsTableFrame's BorderBackground list.
nsIFrame* kid = aFrame->GetFirstChild(nsnull);
while (kid) {
nsresult rv = aFrame->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, lists);
nsresult rv = aFrame->BuildDisplayListForChild(aBuilder, kid, aDirtyRect, *lists);
NS_ENSURE_SUCCESS(rv, rv);
kid = kid->GetNextSibling();
}
@ -1441,11 +1440,11 @@ nsTableFrame::DisplayGenericTablePart(nsDisplayListBuilder* aBuilder,
// Ensure that the table frame event background goes before the
// table rowgroups event backgrounds, before the table row event backgrounds,
// before everything else (cells and their blocks)
eventsBorderBackground.Sort(aBuilder, CompareByTablePartRank, nsnull);
aLists.BorderBackground()->AppendToTop(&eventsBorderBackground);
separatedCollection.BorderBackground()->Sort(CompareByTablePartRank, nsnull);
separatedCollection.MoveTo(aLists);
}
return aFrame->DisplayOutline(aBuilder, lists);
return aFrame->DisplayOutline(aBuilder, aLists);
}
// table paint code is concerned primarily with borders and bg color