Bug 1324524 - Make sure we use nsDisplayTableCellbackground for tables with border-collapse. r=tnikkel

This commit is contained in:
Matt Woodrow
2017-02-13 13:07:36 +13:00
parent 46fce73c53
commit ea678c6b9b
4 changed files with 48 additions and 6 deletions

View File

@@ -502,16 +502,20 @@ nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
if (aBuilder->IsForEventDelivery() ||
!StyleBackground()->IsTransparent(this) ||
StyleDisplay()->mAppearance) {
if (!tableFrame->IsBorderCollapse() ||
aBuilder->IsAtRootOfPseudoStackingContext() ||
aBuilder->IsForEventDelivery()) {
// The cell background was not painted by the nsTablePainter,
// so we need to do it. We have special background processing here
// so we need to duplicate some code from nsFrame::DisplayBorderBackgroundOutline
if (!tableFrame->IsBorderCollapse()) {
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(aBuilder,
this,
GetRectRelativeToSelf(),
aLists.BorderBackground());
} else if (aBuilder->IsAtRootOfPseudoStackingContext() ||
aBuilder->IsForEventDelivery()) {
// The cell background was not painted by the nsTablePainter,
// so we need to do it. We have special background processing here
// so we need to duplicate some code from nsFrame::DisplayBorderBackgroundOutline
nsDisplayTableItem* item =
new (aBuilder) nsDisplayTableCellBackground(aBuilder, this);
aLists.BorderBackground()->AppendNewToTop(item);
item->UpdateForFrameBackground(this);
} else {
// The nsTablePainter will paint our background. Make sure it
// knows if we're background-attachment:fixed.