Bug 1409114 - Part 11: Create an AutoBuildingDisplayList when we create background items for table columns and column groups, so that we initialize the invalidation state correctly. r=kamidphish

Differential Revision: https://phabricator.services.mozilla.com/D31563

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Matt Woodrow 2019-05-20 23:16:59 +00:00
parent dfc3175e1c
commit 17a9052fe9
3 changed files with 21 additions and 8 deletions

View File

@ -3817,7 +3817,9 @@ bool nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
nsDisplayListBuilder* aBuilder, nsIFrame* aFrame,
const nsRect& aBackgroundRect, nsDisplayList* aList,
bool aAllowWillPaintBorderOptimization, ComputedStyle* aComputedStyle,
const nsRect& aBackgroundOriginRect, nsIFrame* aSecondaryReferenceFrame) {
const nsRect& aBackgroundOriginRect, nsIFrame* aSecondaryReferenceFrame,
Maybe<nsDisplayListBuilder::AutoBuildingDisplayList>*
aAutoBuildingDisplayList) {
ComputedStyle* bgSC = aComputedStyle;
const nsStyleBackground* bg = nullptr;
nsRect bgRect = aBackgroundRect;
@ -3872,6 +3874,9 @@ bool nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
// need to create an item for hit testing.
if ((drawBackgroundColor && color != NS_RGBA(0, 0, 0, 0)) ||
aBuilder->IsForEventDelivery()) {
if (aAutoBuildingDisplayList && !*aAutoBuildingDisplayList) {
aAutoBuildingDisplayList->emplace(aBuilder, aFrame);
}
Maybe<DisplayListClipState::AutoSaveRestore> clipState;
nsRect bgColorRect = bgRect;
if (bg && !aBuilder->IsForEventDelivery()) {
@ -3960,6 +3965,10 @@ bool nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
continue;
}
if (aAutoBuildingDisplayList && !*aAutoBuildingDisplayList) {
aAutoBuildingDisplayList->emplace(aBuilder, aFrame);
}
if (bg->mImage.mLayers[i].mBlendMode != NS_STYLE_BLEND_NORMAL) {
needBlendContainer = true;
}

View File

@ -4465,7 +4465,9 @@ class nsDisplayBackgroundImage : public nsDisplayImageContainer {
bool aAllowWillPaintBorderOptimization = true,
mozilla::ComputedStyle* aComputedStyle = nullptr,
const nsRect& aBackgroundOriginRect = nsRect(),
nsIFrame* aSecondaryReferenceFrame = nullptr);
nsIFrame* aSecondaryReferenceFrame = nullptr,
mozilla::Maybe<nsDisplayListBuilder::AutoBuildingDisplayList>*
aAutoBuildingDisplayList = nullptr);
LayerState GetLayerState(
nsDisplayListBuilder* aBuilder, LayerManager* aManager,

View File

@ -499,16 +499,18 @@ void nsTableCellFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
nsTableColFrame* col = backgrounds->GetColForIndex(ColIndex());
nsTableColGroupFrame* colGroup = col->GetTableColGroupFrame();
Maybe<nsDisplayListBuilder::AutoBuildingDisplayList> buildingForColGroup;
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, colGroup, bgRect, backgrounds->ColGroupBackgrounds(), false,
nullptr, colGroup->GetRect() + backgrounds->TableToReferenceFrame(),
this, &buildingForColGroup);
Maybe<nsDisplayListBuilder::AutoBuildingDisplayList> buildingForCol;
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, col, bgRect, backgrounds->ColBackgrounds(), false, nullptr,
col->GetRect() + colGroup->GetPosition() +
backgrounds->TableToReferenceFrame(),
this);
nsDisplayBackgroundImage::AppendBackgroundItemsToTop(
aBuilder, colGroup, bgRect, backgrounds->ColGroupBackgrounds(), false,
nullptr, colGroup->GetRect() + backgrounds->TableToReferenceFrame(),
this);
this, &buildingForCol);
}
}