Bug 1565542. We need to check to resolve image decode promises when we get the frame update notification too. r=aosmond

When we reload the document the destruction of the old document triggers a discard request for the image. If timing is right we haven't locked the image in the new document yet so it discards.

We call LoadImage on the image, it returns the existing entry from the image cache, but it needs to validate. When it validates we send out all the progress in the progress tracker already. This includes frame complete and decode complete even though we have no decoded surfaces for this image right now.

The RequestDecodeForSize call in nsImageLoadingContent::MaybeResolveDecodePromises triggers a decode. When the decode finishes we send a frame update notification but we never send frame complete or decode complete because those are permanent once they happen.

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

--HG--
extra : moz-landing-system : lando
This commit is contained in:
Timothy Nikkel 2019-07-29 13:05:14 +00:00
Родитель 95c2abace2
Коммит 274b2a9485
1 изменённых файлов: 2 добавлений и 1 удалений

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

@ -210,7 +210,8 @@ nsImageLoadingContent::Notify(imgIRequest* aRequest, int32_t aType,
return OnLoadComplete(aRequest, status);
}
if (aType == imgINotificationObserver::FRAME_COMPLETE &&
if ((aType == imgINotificationObserver::FRAME_COMPLETE ||
aType == imgINotificationObserver::FRAME_UPDATE) &&
mCurrentRequest == aRequest) {
MaybeResolveDecodePromises();
}