Bug 560067 - Ensure visibility tracking code doesn't choke on visibility:hidden images. r=tnikkel

visibility: hidden still goes into BuildDisplayListForChild (because
children might be visible), but the child itself might not be visible.

Differential Revision: https://phabricator.services.mozilla.com/D122117
This commit is contained in:
Emilio Cobos Álvarez 2022-05-20 12:22:05 +00:00
Родитель 8bd5597bae
Коммит cfb2c25163
2 изменённых файлов: 7 добавлений и 3 удалений

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

@ -4181,13 +4181,15 @@ void nsIFrame::BuildDisplayListForChild(nsDisplayListBuilder* aBuilder,
// REVIEW: Taken from nsBoxFrame::Paint
// Don't paint our children if the theme object is a leaf.
if (IsThemed(ourDisp) && !PresContext()->Theme()->WidgetIsContainer(
ourDisp->EffectiveAppearance()))
ourDisp->EffectiveAppearance())) {
return;
}
// Since we're now sure that we're adding this frame to the display list
// (which means we're painting it, modulo occlusion), mark it as visible
// within the displayport.
if (isPaintingToWindow && child->TrackingVisibility()) {
if (isPaintingToWindow && child->TrackingVisibility() &&
child->IsVisibleForPainting()) {
child->PresShell()->EnsureFrameInApproximatelyVisibleList(child);
awayFromCommonPath = true;
}

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

@ -2290,7 +2290,9 @@ already_AddRefed<imgIRequest> nsImageFrame::GetCurrentRequest() const {
void nsImageFrame::BuildDisplayList(nsDisplayListBuilder* aBuilder,
const nsDisplayListSet& aLists) {
if (!IsVisibleForPainting()) return;
if (!IsVisibleForPainting()) {
return;
}
DisplayBorderBackgroundOutline(aBuilder, aLists);