mirror of
https://gitlab.winehq.org/wine/wine-gecko.git
synced 2024-09-13 09:24:08 -07:00
Bug 689623. Part 7. Clear the list of visible images on presshells that we don't descend into while building the display list of visible images. r=mats
This commit is contained in:
parent
9660b7d867
commit
c382d9d2b7
@ -5315,6 +5315,8 @@ PresShell::MarkImagesInListVisible(const nsDisplayList& aList)
|
||||
void
|
||||
PresShell::RebuildImageVisibility(const nsDisplayList& aList)
|
||||
{
|
||||
MOZ_ASSERT(!mImageVisibilityVisited, "already visited?");
|
||||
mImageVisibilityVisited = true;
|
||||
nsTArray< nsCOMPtr<nsIImageLoadingContent > > beforeimagelist;
|
||||
beforeimagelist.SwapElements(mVisibleImages);
|
||||
MarkImagesInListVisible(aList);
|
||||
@ -5323,6 +5325,22 @@ PresShell::RebuildImageVisibility(const nsDisplayList& aList)
|
||||
}
|
||||
}
|
||||
|
||||
/* static */ void
|
||||
PresShell::ClearImageVisibilityVisited(nsView* aView, bool aClear)
|
||||
{
|
||||
nsViewManager* vm = aView->GetViewManager();
|
||||
if (aClear) {
|
||||
PresShell* presShell = static_cast<PresShell*>(vm->GetPresShell());
|
||||
if (!presShell->mImageVisibilityVisited) {
|
||||
presShell->ClearVisibleImagesList();
|
||||
}
|
||||
presShell->mImageVisibilityVisited = false;
|
||||
}
|
||||
for (nsView* v = aView->GetFirstChild(); v; v = v->GetNextSibling()) {
|
||||
ClearImageVisibilityVisited(v, v->GetViewManager() != vm);
|
||||
}
|
||||
}
|
||||
|
||||
void
|
||||
PresShell::ClearVisibleImagesList()
|
||||
{
|
||||
@ -5363,6 +5381,8 @@ PresShell::UpdateImageVisibility()
|
||||
|
||||
RebuildImageVisibility(list);
|
||||
|
||||
ClearImageVisibilityVisited(rootFrame->GetView(), true);
|
||||
|
||||
list.DeleteAll();
|
||||
}
|
||||
|
||||
@ -5421,6 +5441,8 @@ PresShell::Paint(nsView* aViewToPaint,
|
||||
NS_ASSERTION(!mIsDestroying, "painting a destroyed PresShell");
|
||||
NS_ASSERTION(aViewToPaint, "null view");
|
||||
|
||||
MOZ_ASSERT(!mImageVisibilityVisited, "should have been cleared");
|
||||
|
||||
if (!mIsActive || mIsZombie) {
|
||||
return;
|
||||
}
|
||||
|
@ -712,6 +712,7 @@ protected:
|
||||
nsRevocableEventPtr<nsRunnableMethod<PresShell> > mUpdateImageVisibilityEvent;
|
||||
|
||||
void ClearVisibleImagesList();
|
||||
static void ClearImageVisibilityVisited(nsView* aView, bool aClear);
|
||||
static void MarkImagesInListVisible(const nsDisplayList& aList);
|
||||
|
||||
// A list of images that are visible or almost visible.
|
||||
@ -806,6 +807,8 @@ protected:
|
||||
bool mAsyncResizeTimerIsActive : 1;
|
||||
bool mInResize : 1;
|
||||
|
||||
bool mImageVisibilityVisited : 1;
|
||||
|
||||
static bool sDisableNonTestMouseEvents;
|
||||
};
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user