Bug 783015 - Chrome refreshdriver runs all the time, r=khuey

This commit is contained in:
Olli Pettay 2012-08-21 16:14:06 -07:00
parent aba4cb5aa3
commit 29137b6a72

View File

@ -76,6 +76,13 @@ ImageLoader::AssociateRequestToFrame(imgIRequest* aRequest,
mRequestToFrameMap.Put(aRequest, newFrameSet);
frameSet = newFrameSet.forget();
nsPresContext* presContext = GetPresContext();
if (presContext) {
nsLayoutUtils::RegisterImageRequestIfAnimated(presContext,
aRequest,
nullptr);
}
}
RequestSet* requestSet = nullptr;
@ -365,12 +372,15 @@ ImageLoader::OnStartContainer(imgIRequest* aRequest, imgIContainer* aImage)
NS_IMETHODIMP
ImageLoader::OnImageIsAnimated(imgIRequest* aRequest)
{
// NB: Don't ignore this when cloning, it's our only chance to register
// the request with the refresh driver.
if (!mDocument) {
return NS_OK;
}
FrameSet* frameSet = nullptr;
if (!mRequestToFrameMap.Get(aRequest, &frameSet)) {
return NS_OK;
}
// Register with the refresh driver now that we are aware that
// we are animated.
nsPresContext* presContext = GetPresContext();