Bug 1063369. When we clone an imgRequestProxy and it currently has an imgCacheValidator checking if the request is still valid over the network make sure to add the new proxy to the validator so that the validator can update the proxy to point to a new request if it finds the old request to be stale. r=seth

Since the CSS image loader (for example background images) always uses a cloned request for painting the image this results in stale images being shown.

This patch is almost the same as the patch Boris Zbarsky posted to bug 432391 in 2011, but I didn't notice that patch until too late. There is one siginificant difference though. We call AddProxy and SetNotificationsDeferred before calling SyncNotifyListener in this patch. Calling them after leads to orange on try server.
This commit is contained in:
Timothy Nikkel 2015-04-10 01:15:39 -05:00
parent 8b3d6a3dc6
commit c2c72dfc25

View File

@ -7,7 +7,7 @@
#include "ImageLogging.h"
#include "imgRequestProxy.h"
#include "imgIOnloadBlocker.h"
#include "imgLoader.h"
#include "Image.h"
#include "ImageOps.h"
#include "nsError.h"
@ -695,6 +695,11 @@ imgRequestProxy::PerformClone(imgINotificationObserver* aObserver,
return rv;
}
if (GetOwner() && GetOwner()->GetValidator()) {
clone->SetNotificationsDeferred(true);
GetOwner()->GetValidator()->AddProxy(clone);
}
// Assign to *aClone before calling Notify so that if the caller expects to
// only be notified for requests it's already holding pointers to it won't be
// surprised.