Bug 601723 - Fix gifs not animating on page reload. r=joe a=blocking-final

This commit is contained in:
Alon Zakai 2011-01-26 10:52:42 -08:00
Родитель 98d4fd6f32
Коммит 2ac8df0047
1 изменённых файлов: 12 добавлений и 4 удалений

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

@ -166,12 +166,14 @@ nsresult imgRequestProxy::ChangeOwner(imgRequest *aNewOwner)
for (PRUint32 i = 0; i < oldLockCount; i++)
LockImage();
// If we had animation requests, apply them here
for (PRUint32 i = 0; i < oldAnimationConsumers; i++)
IncrementAnimationConsumers();
if (mCanceled) {
// If we had animation requests, restore them before exiting
// (otherwise we restore them later below)
for (PRUint32 i = 0; i < oldAnimationConsumers; i++)
IncrementAnimationConsumers();
if (mCanceled)
return NS_OK;
}
// Were we decoded before?
PRBool wasDecoded = PR_FALSE;
@ -185,6 +187,12 @@ nsresult imgRequestProxy::ChangeOwner(imgRequest *aNewOwner)
// OnStopRequest, if needed.
mOwner->RemoveProxy(this, NS_IMAGELIB_CHANGING_OWNER, PR_FALSE);
// If we had animation requests, restore them here. Note that we
// do this *after* RemoveProxy, which clears out animation consumers
// (see bug 601723).
for (PRUint32 i = 0; i < oldAnimationConsumers; i++)
IncrementAnimationConsumers();
mOwner = aNewOwner;
mOwner->AddProxy(this);